Browse Source

python: remove python demos and help docs from repository

K. Lange 1 year ago
parent
commit
ad6ad6fa89
38 changed files with 0 additions and 8106 deletions
  1. 0 34
      util/extra-help/0_index.trt
  2. 0 11
      util/extra-help/calculator.trt
  3. 0 5
      util/extra-help/file_browser.trt
  4. 0 50
      util/extra-help/help_browser.trt
  5. 0 56
      util/extra-help/licenses/0_toaruos.trt
  6. 0 39
      util/extra-help/licenses/cairo.trt
  7. 0 49
      util/extra-help/licenses/font_dejavu.trt
  8. 0 8
      util/extra-help/licenses/font_symbola.trt
  9. 0 35
      util/extra-help/licenses/font_vlgothic.trt
  10. 0 170
      util/extra-help/licenses/freetype.trt
  11. 0 506
      util/extra-help/licenses/lgpl-2.1.trt
  12. 0 169
      util/extra-help/licenses/lgpl-3.0.trt
  13. 0 7
      util/extra-help/licenses/pycairo.trt
  14. 0 8
      util/extra-help/licenses/python.trt
  15. 0 8
      util/extra-help/mines.trt
  16. 0 5
      util/extra-help/packages.trt
  17. 0 14
      util/extra-help/painting.trt
  18. 0 9
      util/fix-python.sh
  19. 0 82
      util/python-demos/about_applet.py
  20. 0 101
      util/python-demos/button.py
  21. 0 284
      util/python-demos/calculator.py
  22. 0 310
      util/python-demos/clock.py
  23. 0 456
      util/python-demos/dialog.py
  24. 0 332
      util/python-demos/file_browser.py
  25. 0 20
      util/python-demos/fswait.py
  26. 0 508
      util/python-demos/help-browser.py
  27. 0 54
      util/python-demos/icon_cache.py
  28. 0 439
      util/python-demos/input_box.py
  29. 0 429
      util/python-demos/menu_bar.py
  30. 0 381
      util/python-demos/mines.py
  31. 0 1609
      util/python-demos/panel.py
  32. 0 128
      util/python-demos/progress-bar.py
  33. 0 589
      util/python-demos/text_region.py
  34. 0 92
      util/python-demos/toaru_fonts.py
  35. 0 42
      util/python-demos/toaru_theme.py
  36. 0 115
      util/python-demos/weather_tool.py
  37. 0 889
      util/python-demos/yutani.py
  38. 0 63
      util/python-demos/yutani_mainloop.py

+ 0 - 34
util/extra-help/0_index.trt

@@ -1,34 +0,0 @@
-
-<h1>Welcome to ToaruOS!</h1>
-
-<img src="/usr/share/logo_login.png"></img>
-とあるOS (ToaruOS) is a hobby operating system built mostly from scratch, including both a kernel and userspace.
-
-<h2>Introduction</h2>
-
-This <link target="help_browser.trt"><i>Help Browser</i></link> is intended to provide guidance and assistance in using ToaruOS.
-
-For a listing of topics, see the <link target="special:contents">Table of Contents</link>.
-
-<h2>History</h2>
-
-ToaruOS started as a side project at the University of Illinois at Urbana-Champaign. For several months in late 2011 and early 2012, the University's SIGOps chapter managed development efforts focused on building the original compositing GUI. Since then, the project has mostly been a one-man effort with a handful of third party contributions.
-
-<h2>Kernel</h2>
-
-The Toaru kernel provides a basic Unix-like environment. The kernel uses a hybrid modular architecture, with loadable modules providing most device driver support. The core kernel includes support for Unix pipes and TTYs, a virtual file system, multitasking, ELF binary support, and various core platform features on x86 systems.
-Modules provide support for disk drives, ext2 filesystems, serial, keyboards and mice, a <mono>/proc</mono> filesystem similar to the one found in Linux, as well as an expanding collection of other device drivers.
-
-<h2>Userspace</h2>
-
-ToaruOS's userspace is focused on a rich graphical environment, backed by an in-house compositing window manager. ToaruOS's terminal emulator supports xterm-compatible 256-color modes, as well as Konsole 24-bit color modes and anti-aliased text with basic Unicode support. Program binaries are dynamically linked. Several graphical demos are provided, alongside a number of command-line applications. A port of SDL targetting the native graphical environment is also available.
-
-<h2>Third-Party Software</h2>
-
-The userspace depends on a number of third-party libraries which are outside of the development scope of the project. Additionally, several third-party applications and libraries have been integrated into ToaruOS's core userspace, or otherwise ported to ToaruOS.
-
-Please see the <link target="special:contents">Table of Contents</link> for a listing of licenses for included third-party software.
-
-<h2>Community</h2>
-
-You can join us through IRC in <mono>#toaruos</mono> on Freenode (<mono>irc.freenode.net</mono>).

+ 0 - 11
util/extra-help/calculator.trt

@@ -1,11 +0,0 @@
-
-<h1>Calculator</h1>
-
-<img src="/usr/share/icons/48/calculator.png"></img>
-A simple four-function calculator.
-
-<h2>Technical Details</h2>
-
-The calculator uses Python's integrated parsing and AST to format mathematical expressions. As such, some functions are different from a normal calculator. For example, you can use <mono>**</mono> as an exponent operator, parenthesis do not imply multiplication (<mono>2(4)</mono> is a syntax error; use <mono>2*(4)</mono> or similar instead), etc.
-
-

+ 0 - 5
util/extra-help/file_browser.trt

@@ -1,5 +0,0 @@
-
-<h1>File Browser</h1>
-
-<img src="/usr/share/icons/48/folder.png"></img>
-The <i>File Browser</i> allows visual navigation of the file system.

File diff suppressed because it is too large
+ 0 - 50
util/extra-help/help_browser.trt


+ 0 - 56
util/extra-help/licenses/0_toaruos.trt

@@ -1,56 +0,0 @@
-
-<h1>ToaruOS</h1>
-<mono>
-Copyright (c) 2011-2018 K. Lange.  All rights reserved.
-
-                          Dedicated to the memory of
-                               Dennis Ritchie
-                                  1941-2011
-
-Developed by: ToAruOS Kernel Development Team
-              http://toaruos.org
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to
-deal with the Software without restriction, including without limitation the
-rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
-sell copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-  1. Redistributions of source code must retain the above copyright notice,
-     this list of conditions and the following disclaimers.
-  2. Redistributions in binary form must reproduce the above copyright
-     notice, this list of conditions and the following disclaimers in the
-     documentation and/or other materials provided with the distribution.
-  3. Neither the names of the ToAruOS Kernel Development Team, K. Lange,
-     nor the names of its contributors may be used to endorse
-     or promote products derived from this Software without specific prior
-     written permission.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
-CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
-WITH THE SOFTWARE.
-</mono>
-<h2>Authors</h2>
-
-- K. Lange
-- Markus Schober
-- Tianyi Wang
-- Josh Kilmer
-- Patrick Lucas
-- Steve Jenson
-- Tyler Bindon
-- Mat "Lioncash" M.
-- Ivailo Monev
-- Dale Weiler
-- Mike Gerow
-- Matt White
-- Mike Gerow
-- Fabien Siron
-- Gil Mendes
-- Peter Harliman Liem
-- Shawn Anastasio
-

+ 0 - 39
util/extra-help/licenses/cairo.trt

@@ -1,39 +0,0 @@
-
-<h1>Cairo</h1>
-
-A copy of the LGPL v2.1 may be found <link target="licenses/lgpl-2.1.trt">here</link>.
-<mono>
-Cairo is free software.
-
-Every source file in the implementation[*] of cairo is available to be
-redistributed and/or modified under the terms of either the GNU Lesser
-General Public License (LGPL) version 2.1 or the Mozilla Public
-License (MPL) version 1.1.  Some files are available under more
-liberal terms, but we believe that in all cases, each file may be used
-under either the LGPL or the MPL.
-
-See the following files in this directory for the precise terms and
-conditions of either license:
-
-    COPYING-LGPL-2.1
-    COPYING-MPL-1.1
-
-Please see each file in the implementation for copyright and licensing
-information, (in the opening comment of each file).
-
-[*] The implementation of cairo is contained entirely within the "src"
-directory of the cairo source distribution. There are other components
-of the cairo source distribution (such as the "test", "util", and "perf")
-that are auxiliary to the library itself. None of the source code in these
-directories contributes to a build of the cairo library itself, (libcairo.so
-or cairo.dll or similar).
-
-These auxiliary components are also free software, but may be under
-different license terms than cairo itself. For example, most of the
-test cases in the perf and test directories are made available under
-an MIT license to simplify any use of this code for reference purposes
-in using cairo itself. Other files might be available under the GNU
-General Public License (GPL), for example. Again, please see the COPYING
-file under each directory and the opening comment of each file for copyright
-and licensing information.
-</mono>

+ 0 - 49
util/extra-help/licenses/font_dejavu.trt

@@ -1,49 +0,0 @@
-
-<h1>DejaVu / Bitstream Vera</h1>
-<mono>
-Copyright (c) 2003 by Bitstream, Inc. All Rights Reserved. Bitstream
-Vera is a trademark of Bitstream, Inc.
-
-Permission is hereby granted, free of charge, to any person obtaining a
-copy of the fonts accompanying this license ("Fonts") and associated
-documentation files (the "Font Software"), to reproduce and distribute
-the Font Software, including without limitation the rights to use,
-copy, merge, publish, distribute, and/or sell copies of the Font
-Software, and to permit persons to whom the Font Software is furnished
-to do so, subject to the following conditions:
-
-The above copyright and trademark notices and this permission notice
-shall be included in all copies of one or more of the Font Software
-typefaces.
-
-The Font Software may be modified, altered, or added to, and in
-particular the designs of glyphs or characters in the Fonts may be
-modified and additional glyphs or characters may be added to the Fonts,
-only if the fonts are renamed to names not containing either the words
-"Bitstream" or the word "Vera".
-
-This License becomes null and void to the extent applicable to Fonts or
-Font Software that has been modified and is distributed under the
-"Bitstream Vera" names.
-
-The Font Software may be sold as part of a larger software package but
-no copy of one or more of the Font Software typefaces may be sold by
-itself.
-
-THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
-OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL
-BITSTREAM OR THE GNOME FOUNDATION BE LIABLE FOR ANY CLAIM, DAMAGES OR
-OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL,
-OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR
-OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE THE FONT
-SOFTWARE OR FROM OTHER DEALINGS IN THE FONT SOFTWARE.
-
-Except as contained in this notice, the names of Gnome, the Gnome
-Foundation, and Bitstream Inc., shall not be used in advertising or
-otherwise to promote the sale, use or other dealings in this Font
-Software without prior written authorization from the Gnome Foundation
-or Bitstream Inc., respectively. For further information, contact:
-fonts at gnome dot org.
-</mono>

+ 0 - 8
util/extra-help/licenses/font_symbola.trt

@@ -1,8 +0,0 @@
-
-<h1>Symbola</h1>
-<mono>
-In lieu of a license
-Fonts in this site are offered free for any use; they may be installed,
-embedded, opened, edited, modified, regenerated, posted,
-packaged and redistributed. - George Douros
-</mono>

+ 0 - 35
util/extra-help/licenses/font_vlgothic.trt

@@ -1,35 +0,0 @@
-
-<h1>VL Gothic</h1>
-<mono>
-Copyright (c) 1990-2003 Wada Laboratory, the University of Tokyo.
-Copyright (c) 2003-2004 Electronic Font Open Laboratory (/efont/).
-Copyright (C) 2002-2010 M+ FONTS PROJECT Copyright (C) 2006-2010
-Daisuke SUZUKI .  Copyright (C) 2006-2010 Project Vine .  All rights
-reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
-1. Redistributions of source code must retain the above copyright
-   notice, this list of conditions and the following disclaimer.
-2. Redistributions in binary form must reproduce the above copyright
-   notice, this list of conditions and the following disclaimer in the
-   documentation and/or other materials provided with the distribution.
-3. Neither the name of the Wada Laboratory, the University of Tokyo nor
-   the names of its contributors may be used to endorse or promote
-   products derived from this software without specific prior written
-   permission.
-
-THIS SOFTWARE IS PROVIDED BY WADA LABORATORY, THE UNIVERSITY OF TOKYO
-AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
-INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
-IN NO EVENT SHALL THE LABORATORY OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
-STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
-IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGE.
-</mono>

+ 0 - 170
util/extra-help/licenses/freetype.trt

@@ -1,170 +0,0 @@
-
-<h1>Freetype</h1>
-<mono>
-                    The FreeType Project LICENSE
-                    ----------------------------
-
-                            2006-Jan-27
-
-                    Copyright 1996-2002, 2006 by
-          David Turner, Robert Wilhelm, and Werner Lemberg
-
-
-
-Introduction
-============
-
-  The FreeType  Project is distributed in  several archive packages;
-  some of them may contain, in addition to the FreeType font engine,
-  various tools and  contributions which rely on, or  relate to, the
-  FreeType Project.
-
-  This  license applies  to all  files found  in such  packages, and
-  which do not  fall under their own explicit  license.  The license
-  affects  thus  the  FreeType   font  engine,  the  test  programs,
-  documentation and makefiles, at the very least.
-
-  This  license   was  inspired  by  the  BSD,   Artistic,  and  IJG
-  (Independent JPEG  Group) licenses, which  all encourage inclusion
-  and  use of  free  software in  commercial  and freeware  products
-  alike.  As a consequence, its main points are that:
-
-    o We don't promise that this software works. However, we will be
-      interested in any kind of bug reports. (`as is' distribution)
-
-    o You can  use this software for whatever you  want, in parts or
-      full form, without having to pay us. (`royalty-free' usage)
-
-    o You may not pretend that  you wrote this software.  If you use
-      it, or  only parts of it,  in a program,  you must acknowledge
-      somewhere  in  your  documentation  that  you  have  used  the
-      FreeType code. (`credits')
-
-  We  specifically  permit  and  encourage  the  inclusion  of  this
-  software, with  or without modifications,  in commercial products.
-  We  disclaim  all warranties  covering  The  FreeType Project  and
-  assume no liability related to The FreeType Project.
-
-
-  Finally,  many  people  asked  us  for  a  preferred  form  for  a
-  credit/disclaimer to use in compliance with this license.  We thus
-  encourage you to use the following text:
-
-   """
-    Portions of this software are copyrigh © &lt;year&gt; The FreeType
-    Project (www.freetype.org).  All rights reserved.
-   """
-
-  Please replace &lt;year&gt; with the value from the FreeType version you
-  actually use.
-
-
-Legal Terms
-===========
-
-0. Definitions
---------------
-
-  Throughout this license,  the terms `package', `FreeType Project',
-  and  `FreeType  archive' refer  to  the  set  of files  originally
-  distributed  by the  authors  (David Turner,  Robert Wilhelm,  and
-  Werner Lemberg) as the `FreeType Project', be they named as alpha,
-  beta or final release.
-
-  `You' refers to  the licensee, or person using  the project, where
-  `using' is a generic term including compiling the project's source
-  code as  well as linking it  to form a  `program' or `executable'.
-  This  program is  referred to  as  `a program  using the  FreeType
-  engine'.
-
-  This  license applies  to all  files distributed  in  the original
-  FreeType  Project,   including  all  source   code,  binaries  and
-  documentation,  unless  otherwise  stated   in  the  file  in  its
-  original, unmodified form as  distributed in the original archive.
-  If you are  unsure whether or not a particular  file is covered by
-  this license, you must contact us to verify this.
-
-  The FreeType  Project is copyright (C) 1996-2000  by David Turner,
-  Robert Wilhelm, and Werner Lemberg.  All rights reserved except as
-  specified below.
-
-1. No Warranty
---------------
-
-  THE FREETYPE PROJECT  IS PROVIDED `AS IS' WITHOUT  WARRANTY OF ANY
-  KIND, EITHER  EXPRESS OR IMPLIED,  INCLUDING, BUT NOT  LIMITED TO,
-  WARRANTIES  OF  MERCHANTABILITY   AND  FITNESS  FOR  A  PARTICULAR
-  PURPOSE.  IN NO EVENT WILL ANY OF THE AUTHORS OR COPYRIGHT HOLDERS
-  BE LIABLE  FOR ANY DAMAGES CAUSED  BY THE USE OR  THE INABILITY TO
-  USE, OF THE FREETYPE PROJECT.
-
-2. Redistribution
------------------
-
-  This  license  grants  a  worldwide, royalty-free,  perpetual  and
-  irrevocable right  and license to use,  execute, perform, compile,
-  display,  copy,   create  derivative  works   of,  distribute  and
-  sublicense the  FreeType Project (in  both source and  object code
-  forms)  and  derivative works  thereof  for  any  purpose; and  to
-  authorize others  to exercise  some or all  of the  rights granted
-  herein, subject to the following conditions:
-
-    o Redistribution of  source code  must retain this  license file
-      (`FTL.TXT') unaltered; any  additions, deletions or changes to
-      the original  files must be clearly  indicated in accompanying
-      documentation.   The  copyright   notices  of  the  unaltered,
-      original  files must  be  preserved in  all  copies of  source
-      files.
-
-    o Redistribution in binary form must provide a  disclaimer  that
-      states  that  the software is based in part of the work of the
-      FreeType Team,  in  the  distribution  documentation.  We also
-      encourage you to put an URL to the FreeType web page  in  your
-      documentation, though this isn't mandatory.
-
-  These conditions  apply to any  software derived from or  based on
-  the FreeType Project,  not just the unmodified files.   If you use
-  our work, you  must acknowledge us.  However, no  fee need be paid
-  to us.
-
-3. Advertising
---------------
-
-  Neither the  FreeType authors and  contributors nor you  shall use
-  the name of the  other for commercial, advertising, or promotional
-  purposes without specific prior written permission.
-
-  We suggest,  but do not require, that  you use one or  more of the
-  following phrases to refer  to this software in your documentation
-  or advertising  materials: `FreeType Project',  `FreeType Engine',
-  `FreeType library', or `FreeType Distribution'.
-
-  As  you have  not signed  this license,  you are  not  required to
-  accept  it.   However,  as  the FreeType  Project  is  copyrighted
-  material, only  this license, or  another one contracted  with the
-  authors, grants you  the right to use, distribute,  and modify it.
-  Therefore,  by  using,  distributing,  or modifying  the  FreeType
-  Project, you indicate that you understand and accept all the terms
-  of this license.
-
-4. Contacts
------------
-
-  There are two mailing lists related to FreeType:
-
-    o freetype@nongnu.org
-
-      Discusses general use and applications of FreeType, as well as
-      future and  wanted additions to the  library and distribution.
-      If  you are looking  for support,  start in  this list  if you
-      haven't found anything to help you in the documentation.
-
-    o freetype-devel@nongnu.org
-
-      Discusses bugs,  as well  as engine internals,  design issues,
-      specific licenses, porting, etc.
-
-  Our home page can be found at
-
-      http://www.freetype.org
-</mono>

+ 0 - 506
util/extra-help/licenses/lgpl-2.1.trt

@@ -1,506 +0,0 @@
-
-<h1>GNU Lesser General Public License (LGPL) 2.1</h1>
-<mono>
-                  GNU LESSER GENERAL PUBLIC LICENSE
-                       Version 2.1, February 1999
-
- Copyright (C) 1991, 1999 Free Software Foundation, Inc.
- 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
-[This is the first released version of the Lesser GPL.  It also counts
- as the successor of the GNU Library Public License, version 2, hence
- the version number 2.1.]
-
-                            Preamble
-
-  The licenses for most software are designed to take away your
-freedom to share and change it.  By contrast, the GNU General Public
-Licenses are intended to guarantee your freedom to share and change
-free software--to make sure the software is free for all its users.
-
-  This license, the Lesser General Public License, applies to some
-specially designated software packages--typically libraries--of the
-Free Software Foundation and other authors who decide to use it.  You
-can use it too, but we suggest you first think carefully about whether
-this license or the ordinary General Public License is the better
-strategy to use in any particular case, based on the explanations below.
-
-  When we speak of free software, we are referring to freedom of use,
-not price.  Our General Public Licenses are designed to make sure that
-you have the freedom to distribute copies of free software (and charge
-for this service if you wish); that you receive source code or can get
-it if you want it; that you can change the software and use pieces of
-it in new free programs; and that you are informed that you can do
-these things.
-
-  To protect your rights, we need to make restrictions that forbid
-distributors to deny you these rights or to ask you to surrender these
-rights.  These restrictions translate to certain responsibilities for
-you if you distribute copies of the library or if you modify it.
-
-  For example, if you distribute copies of the library, whether gratis
-or for a fee, you must give the recipients all the rights that we gave
-you.  You must make sure that they, too, receive or can get the source
-code.  If you link other code with the library, you must provide
-complete object files to the recipients, so that they can relink them
-with the library after making changes to the library and recompiling
-it.  And you must show them these terms so they know their rights.
-
-  We protect your rights with a two-step method: (1) we copyright the
-library, and (2) we offer you this license, which gives you legal
-permission to copy, distribute and/or modify the library.
-
-  To protect each distributor, we want to make it very clear that
-there is no warranty for the free library.  Also, if the library is
-modified by someone else and passed on, the recipients should know
-that what they have is not the original version, so that the original
-author's reputation will not be affected by problems that might be
-introduced by others.
-
-  Finally, software patents pose a constant threat to the existence of
-any free program.  We wish to make sure that a company cannot
-effectively restrict the users of a free program by obtaining a
-restrictive license from a patent holder.  Therefore, we insist that
-any patent license obtained for a version of the library must be
-consistent with the full freedom of use specified in this license.
-
-  Most GNU software, including some libraries, is covered by the
-ordinary GNU General Public License.  This license, the GNU Lesser
-General Public License, applies to certain designated libraries, and
-is quite different from the ordinary General Public License.  We use
-this license for certain libraries in order to permit linking those
-libraries into non-free programs.
-
-  When a program is linked with a library, whether statically or using
-a shared library, the combination of the two is legally speaking a
-combined work, a derivative of the original library.  The ordinary
-General Public License therefore permits such linking only if the
-entire combination fits its criteria of freedom.  The Lesser General
-Public License permits more lax criteria for linking other code with
-the library.
-
-  We call this license the "Lesser" General Public License because it
-does Less to protect the user's freedom than the ordinary General
-Public License.  It also provides other free software developers Less
-of an advantage over competing non-free programs.  These disadvantages
-are the reason we use the ordinary General Public License for many
-libraries.  However, the Lesser license provides advantages in certain
-special circumstances.
-
-  For example, on rare occasions, there may be a special need to
-encourage the widest possible use of a certain library, so that it becomes
-a de-facto standard.  To achieve this, non-free programs must be
-allowed to use the library.  A more frequent case is that a free
-library does the same job as widely used non-free libraries.  In this
-case, there is little to gain by limiting the free library to free
-software only, so we use the Lesser General Public License.
-
-  In other cases, permission to use a particular library in non-free
-programs enables a greater number of people to use a large body of
-free software.  For example, permission to use the GNU C Library in
-non-free programs enables many more people to use the whole GNU
-operating system, as well as its variant, the GNU/Linux operating
-system.
-
-  Although the Lesser General Public License is Less protective of the
-users' freedom, it does ensure that the user of a program that is
-linked with the Library has the freedom and the wherewithal to run
-that program using a modified version of the Library.
-
-  The precise terms and conditions for copying, distribution and
-modification follow.  Pay close attention to the difference between a
-"work based on the library" and a "work that uses the library".  The
-former contains code derived from the library, whereas the latter must
-be combined with the library in order to run.
-
-                  GNU LESSER GENERAL PUBLIC LICENSE
-   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
-  0. This License Agreement applies to any software library or other
-program which contains a notice placed by the copyright holder or
-other authorized party saying it may be distributed under the terms of
-this Lesser General Public License (also called "this License").
-Each licensee is addressed as "you".
-
-  A "library" means a collection of software functions and/or data
-prepared so as to be conveniently linked with application programs
-(which use some of those functions and data) to form executables.
-
-  The "Library", below, refers to any such software library or work
-which has been distributed under these terms.  A "work based on the
-Library" means either the Library or any derivative work under
-copyright law: that is to say, a work containing the Library or a
-portion of it, either verbatim or with modifications and/or translated
-straightforwardly into another language.  (Hereinafter, translation is
-included without limitation in the term "modification".)
-
-  "Source code" for a work means the preferred form of the work for
-making modifications to it.  For a library, complete source code means
-all the source code for all modules it contains, plus any associated
-interface definition files, plus the scripts used to control compilation
-and installation of the library.
-
-  Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope.  The act of
-running a program using the Library is not restricted, and output from
-such a program is covered only if its contents constitute a work based
-on the Library (independent of the use of the Library in a tool for
-writing it).  Whether that is true depends on what the Library does
-and what the program that uses the Library does.
-
-  1. You may copy and distribute verbatim copies of the Library's
-complete source code as you receive it, in any medium, provided that
-you conspicuously and appropriately publish on each copy an
-appropriate copyright notice and disclaimer of warranty; keep intact
-all the notices that refer to this License and to the absence of any
-warranty; and distribute a copy of this License along with the
-Library.
-
-  You may charge a fee for the physical act of transferring a copy,
-and you may at your option offer warranty protection in exchange for a
-fee.
-
-  2. You may modify your copy or copies of the Library or any portion
-of it, thus forming a work based on the Library, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
-    a) The modified work must itself be a software library.
-
-    b) You must cause the files modified to carry prominent notices
-    stating that you changed the files and the date of any change.
-
-    c) You must cause the whole of the work to be licensed at no
-    charge to all third parties under the terms of this License.
-
-    d) If a facility in the modified Library refers to a function or a
-    table of data to be supplied by an application program that uses
-    the facility, other than as an argument passed when the facility
-    is invoked, then you must make a good faith effort to ensure that,
-    in the event an application does not supply such function or
-    table, the facility still operates, and performs whatever part of
-    its purpose remains meaningful.
-
-    (For example, a function in a library to compute square roots has
-    a purpose that is entirely well-defined independent of the
-    application.  Therefore, Subsection 2d requires that any
-    application-supplied function or table used by this function must
-    be optional: if the application does not supply it, the square
-    root function must still compute square roots.)
-
-These requirements apply to the modified work as a whole.  If
-identifiable sections of that work are not derived from the Library,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works.  But when you
-distribute the same sections as part of a whole which is a work based
-on the Library, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote
-it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Library.
-
-In addition, mere aggregation of another work not based on the Library
-with the Library (or with a work based on the Library) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
-  3. You may opt to apply the terms of the ordinary GNU General Public
-License instead of this License to a given copy of the Library.  To do
-this, you must alter all the notices that refer to this License, so
-that they refer to the ordinary GNU General Public License, version 2,
-instead of to this License.  (If a newer version than version 2 of the
-ordinary GNU General Public License has appeared, then you can specify
-that version instead if you wish.)  Do not make any other change in
-these notices.
-
-  Once this change is made in a given copy, it is irreversible for
-that copy, so the ordinary GNU General Public License applies to all
-subsequent copies and derivative works made from that copy.
-
-  This option is useful when you wish to copy part of the code of
-the Library into a program that is not a library.
-
-  4. You may copy and distribute the Library (or a portion or
-derivative of it, under Section 2) in object code or executable form
-under the terms of Sections 1 and 2 above provided that you accompany
-it with the complete corresponding machine-readable source code, which
-must be distributed under the terms of Sections 1 and 2 above on a
-medium customarily used for software interchange.
-
-  If distribution of object code is made by offering access to copy
-from a designated place, then offering equivalent access to copy the
-source code from the same place satisfies the requirement to
-distribute the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
-  5. A program that contains no derivative of any portion of the
-Library, but is designed to work with the Library by being compiled or
-linked with it, is called a "work that uses the Library".  Such a
-work, in isolation, is not a derivative work of the Library, and
-therefore falls outside the scope of this License.
-
-  However, linking a "work that uses the Library" with the Library
-creates an executable that is a derivative of the Library (because it
-contains portions of the Library), rather than a "work that uses the
-library".  The executable is therefore covered by this License.
-Section 6 states terms for distribution of such executables.
-
-  When a "work that uses the Library" uses material from a header file
-that is part of the Library, the object code for the work may be a
-derivative work of the Library even though the source code is not.
-Whether this is true is especially significant if the work can be
-linked without the Library, or if the work is itself a library.  The
-threshold for this to be true is not precisely defined by law.
-
-  If such an object file uses only numerical parameters, data
-structure layouts and accessors, and small macros and small inline
-functions (ten lines or less in length), then the use of the object
-file is unrestricted, regardless of whether it is legally a derivative
-work.  (Executables containing this object code plus portions of the
-Library will still fall under Section 6.)
-
-  Otherwise, if the work is a derivative of the Library, you may
-distribute the object code for the work under the terms of Section 6.
-Any executables containing that work also fall under Section 6,
-whether or not they are linked directly with the Library itself.
-
-  6. As an exception to the Sections above, you may also combine or
-link a "work that uses the Library" with the Library to produce a
-work containing portions of the Library, and distribute that work
-under terms of your choice, provided that the terms permit
-modification of the work for the customer's own use and reverse
-engineering for debugging such modifications.
-
-  You must give prominent notice with each copy of the work that the
-Library is used in it and that the Library and its use are covered by
-this License.  You must supply a copy of this License.  If the work
-during execution displays copyright notices, you must include the
-copyright notice for the Library among them, as well as a reference
-directing the user to the copy of this License.  Also, you must do one
-of these things:
-
-    a) Accompany the work with the complete corresponding
-    machine-readable source code for the Library including whatever
-    changes were used in the work (which must be distributed under
-    Sections 1 and 2 above); and, if the work is an executable linked
-    with the Library, with the complete machine-readable "work that
-    uses the Library", as object code and/or source code, so that the
-    user can modify the Library and then relink to produce a modified
-    executable containing the modified Library.  (It is understood
-    that the user who changes the contents of definitions files in the
-    Library will not necessarily be able to recompile the application
-    to use the modified definitions.)
-
-    b) Use a suitable shared library mechanism for linking with the
-    Library.  A suitable mechanism is one that (1) uses at run time a
-    copy of the library already present on the user's computer system,
-    rather than copying library functions into the executable, and (2)
-    will operate properly with a modified version of the library, if
-    the user installs one, as long as the modified version is
-    interface-compatible with the version that the work was made with.
-
-    c) Accompany the work with a written offer, valid for at
-    least three years, to give the same user the materials
-    specified in Subsection 6a, above, for a charge no more
-    than the cost of performing this distribution.
-
-    d) If distribution of the work is made by offering access to copy
-    from a designated place, offer equivalent access to copy the above
-    specified materials from the same place.
-
-    e) Verify that the user has already received a copy of these
-    materials or that you have already sent this user a copy.
-
-  For an executable, the required form of the "work that uses the
-Library" must include any data and utility programs needed for
-reproducing the executable from it.  However, as a special exception,
-the materials to be distributed need not include anything that is
-normally distributed (in either source or binary form) with the major
-components (compiler, kernel, and so on) of the operating system on
-which the executable runs, unless that component itself accompanies
-the executable.
-
-  It may happen that this requirement contradicts the license
-restrictions of other proprietary libraries that do not normally
-accompany the operating system.  Such a contradiction means you cannot
-use both them and the Library together in an executable that you
-distribute.
-
-  7. You may place library facilities that are a work based on the
-Library side-by-side in a single library together with other library
-facilities not covered by this License, and distribute such a combined
-library, provided that the separate distribution of the work based on
-the Library and of the other library facilities is otherwise
-permitted, and provided that you do these two things:
-
-    a) Accompany the combined library with a copy of the same work
-    based on the Library, uncombined with any other library
-    facilities.  This must be distributed under the terms of the
-    Sections above.
-
-    b) Give prominent notice with the combined library of the fact
-    that part of it is a work based on the Library, and explaining
-    where to find the accompanying uncombined form of the same work.
-
-  8. You may not copy, modify, sublicense, link with, or distribute
-the Library except as expressly provided under this License.  Any
-attempt otherwise to copy, modify, sublicense, link with, or
-distribute the Library is void, and will automatically terminate your
-rights under this License.  However, parties who have received copies,
-or rights, from you under this License will not have their licenses
-terminated so long as such parties remain in full compliance.
-
-  9. You are not required to accept this License, since you have not
-signed it.  However, nothing else grants you permission to modify or
-distribute the Library or its derivative works.  These actions are
-prohibited by law if you do not accept this License.  Therefore, by
-modifying or distributing the Library (or any work based on the
-Library), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Library or works based on it.
-
-  10. Each time you redistribute the Library (or any work based on the
-Library), the recipient automatically receives a license from the
-original licensor to copy, distribute, link with or modify the Library
-subject to these terms and conditions.  You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties with
-this License.
-
-  11. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License.  If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Library at all.  For example, if a patent
-license would not permit royalty-free redistribution of the Library by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Library.
-
-If any portion of this section is held invalid or unenforceable under any
-particular circumstance, the balance of the section is intended to apply,
-and the section as a whole is intended to apply in other circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system which is
-implemented by public license practices.  Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
-  12. If the distribution and/or use of the Library is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Library under this License may add
-an explicit geographical distribution limitation excluding those countries,
-so that distribution is permitted only in or among countries not thus
-excluded.  In such case, this License incorporates the limitation as if
-written in the body of this License.
-
-  13. The Free Software Foundation may publish revised and/or new
-versions of the Lesser General Public License from time to time.
-Such new versions will be similar in spirit to the present version,
-but may differ in detail to address new problems or concerns.
-
-Each version is given a distinguishing version number.  If the Library
-specifies a version number of this License which applies to it and
-"any later version", you have the option of following the terms and
-conditions either of that version or of any later version published by
-the Free Software Foundation.  If the Library does not specify a
-license version number, you may choose any version ever published by
-the Free Software Foundation.
-
-  14. If you wish to incorporate parts of the Library into other free
-programs whose distribution conditions are incompatible with these,
-write to the author to ask for permission.  For software which is
-copyrighted by the Free Software Foundation, write to the Free
-Software Foundation; we sometimes make exceptions for this.  Our
-decision will be guided by the two goals of preserving the free status
-of all derivatives of our free software and of promoting the sharing
-and reuse of software generally.
-
-                            NO WARRANTY
-
-  15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
-WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
-EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
-OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
-KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
-LIBRARY IS WITH YOU.  SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
-THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
-
-  16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
-WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
-AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
-FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
-CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
-LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
-RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
-FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
-SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
-DAMAGES.
-
-                     END OF TERMS AND CONDITIONS
-
-           How to Apply These Terms to Your New Libraries
-
-  If you develop a new library, and you want it to be of the greatest
-possible use to the public, we recommend making it free software that
-everyone can redistribute and change.  You can do so by permitting
-redistribution under these terms (or, alternatively, under the terms of the
-ordinary General Public License).
-
-  To apply these terms, attach the following notices to the library.  It is
-safest to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least the
-"copyright" line and a pointer to where the full notice is found.
-
-    &lt;one line to give the library's name and a brief idea of what it does.&gt;
-    Copyright (C) &lt;year&gt;  &lt;name of author&gt;
-
-    This library is free software; you can redistribute it and/or
-    modify it under the terms of the GNU Lesser General Public
-    License as published by the Free Software Foundation; either
-    version 2.1 of the License, or (at your option) any later version.
-
-    This library is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-    Lesser General Public License for more details.
-
-    You should have received a copy of the GNU Lesser General Public
-    License along with this library; if not, write to the Free Software
-    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
-
-Also add information on how to contact you by electronic and paper mail.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the library, if
-necessary.  Here is a sample; alter the names:
-
-  Yoyodyne, Inc., hereby disclaims all copyright interest in the
-  library `Frob' (a library for tweaking knobs) written by James Random Hacker.
-
-  &lt;signature of Ty Coon&gt;, 1 April 1990
-  Ty Coon, President of Vice
-
-That's all there is to it!
-</mono>

+ 0 - 169
util/extra-help/licenses/lgpl-3.0.trt

@@ -1,169 +0,0 @@
-
-<h1>GNU Lesser General Public License (LGPL) 3.0</h1>
-<mono>
-                   GNU LESSER GENERAL PUBLIC LICENSE
-                       Version 3, 29 June 2007
-
- Copyright (C) 2007 Free Software Foundation, Inc. &lt;http://fsf.org/&gt;
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
-
-  This version of the GNU Lesser General Public License incorporates
-the terms and conditions of version 3 of the GNU General Public
-License, supplemented by the additional permissions listed below.
-
-  0. Additional Definitions.
-
-  As used herein, "this License" refers to version 3 of the GNU Lesser
-General Public License, and the "GNU GPL" refers to version 3 of the GNU
-General Public License.
-
-  "The Library" refers to a covered work governed by this License,
-other than an Application or a Combined Work as defined below.
-
-  An "Application" is any work that makes use of an interface provided
-by the Library, but which is not otherwise based on the Library.
-Defining a subclass of a class defined by the Library is deemed a mode
-of using an interface provided by the Library.
-
-  A "Combined Work" is a work produced by combining or linking an
-Application with the Library.  The particular version of the Library
-with which the Combined Work was made is also called the "Linked
-Version".
-
-  The "Minimal Corresponding Source" for a Combined Work means the
-Corresponding Source for the Combined Work, excluding any source code
-for portions of the Combined Work that, considered in isolation, are
-based on the Application, and not on the Linked Version.
-
-  The "Corresponding Application Code" for a Combined Work means the
-object code and/or source code for the Application, including any data
-and utility programs needed for reproducing the Combined Work from the
-Application, but excluding the System Libraries of the Combined Work.
-
-  1. Exception to Section 3 of the GNU GPL.
-
-  You may convey a covered work under sections 3 and 4 of this License
-without being bound by section 3 of the GNU GPL.
-
-  2. Conveying Modified Versions.
-
-  If you modify a copy of the Library, and, in your modifications, a
-facility refers to a function or data to be supplied by an Application
-that uses the facility (other than as an argument passed when the
-facility is invoked), then you may convey a copy of the modified
-version:
-
-   a) under this License, provided that you make a good faith effort to
-   ensure that, in the event an Application does not supply the
-   function or data, the facility still operates, and performs
-   whatever part of its purpose remains meaningful, or
-
-   b) under the GNU GPL, with none of the additional permissions of
-   this License applicable to that copy.
-
-  3. Object Code Incorporating Material from Library Header Files.
-
-  The object code form of an Application may incorporate material from
-a header file that is part of the Library.  You may convey such object
-code under terms of your choice, provided that, if the incorporated
-material is not limited to numerical parameters, data structure
-layouts and accessors, or small macros, inline functions and templates
-(ten or fewer lines in length), you do both of the following:
-
-   a) Give prominent notice with each copy of the object code that the
-   Library is used in it and that the Library and its use are
-   covered by this License.
-
-   b) Accompany the object code with a copy of the GNU GPL and this license
-   document.
-
-  4. Combined Works.
-
-  You may convey a Combined Work under terms of your choice that,
-taken together, effectively do not restrict modification of the
-portions of the Library contained in the Combined Work and reverse
-engineering for debugging such modifications, if you also do each of
-the following:
-
-   a) Give prominent notice with each copy of the Combined Work that
-   the Library is used in it and that the Library and its use are
-   covered by this License.
-
-   b) Accompany the Combined Work with a copy of the GNU GPL and this license
-   document.
-
-   c) For a Combined Work that displays copyright notices during
-   execution, include the copyright notice for the Library among
-   these notices, as well as a reference directing the user to the
-   copies of the GNU GPL and this license document.
-
-   d) Do one of the following:
-
-       0) Convey the Minimal Corresponding Source under the terms of this
-       License, and the Corresponding Application Code in a form
-       suitable for, and under terms that permit, the user to
-       recombine or relink the Application with a modified version of
-       the Linked Version to produce a modified Combined Work, in the
-       manner specified by section 6 of the GNU GPL for conveying
-       Corresponding Source.
-
-       1) Use a suitable shared library mechanism for linking with the
-       Library.  A suitable mechanism is one that (a) uses at run time
-       a copy of the Library already present on the user's computer
-       system, and (b) will operate properly with a modified version
-       of the Library that is interface-compatible with the Linked
-       Version.
-
-   e) Provide Installation Information, but only if you would otherwise
-   be required to provide such information under section 6 of the
-   GNU GPL, and only to the extent that such information is
-   necessary to install and execute a modified version of the
-   Combined Work produced by recombining or relinking the
-   Application with a modified version of the Linked Version. (If
-   you use option 4d0, the Installation Information must accompany
-   the Minimal Corresponding Source and Corresponding Application
-   Code. If you use option 4d1, you must provide the Installation
-   Information in the manner specified by section 6 of the GNU GPL
-   for conveying Corresponding Source.)
-
-  5. Combined Libraries.
-
-  You may place library facilities that are a work based on the
-Library side by side in a single library together with other library
-facilities that are not Applications and are not covered by this
-License, and convey such a combined library under terms of your
-choice, if you do both of the following:
-
-   a) Accompany the combined library with a copy of the same work based
-   on the Library, uncombined with any other library facilities,
-   conveyed under the terms of this License.
-
-   b) Give prominent notice with the combined library that part of it
-   is a work based on the Library, and explaining where to find the
-   accompanying uncombined form of the same work.
-
-  6. Revised Versions of the GNU Lesser General Public License.
-
-  The Free Software Foundation may publish revised and/or new versions
-of the GNU Lesser General Public License from time to time. Such new
-versions will be similar in spirit to the present version, but may
-differ in detail to address new problems or concerns.
-
-  Each version is given a distinguishing version number. If the
-Library as you received it specifies that a certain numbered version
-of the GNU Lesser General Public License "or any later version"
-applies to it, you have the option of following the terms and
-conditions either of that published version or of any later version
-published by the Free Software Foundation. If the Library as you
-received it does not specify a version number of the GNU Lesser
-General Public License, you may choose any version of the GNU Lesser
-General Public License ever published by the Free Software Foundation.
-
-  If the Library as you received it specifies that a proxy can decide
-whether future versions of the GNU Lesser General Public License shall
-apply, that proxy's public statement of acceptance of any version is
-permanent authorization for you to choose that version for the
-Library.
-</mono>

+ 0 - 7
util/extra-help/licenses/pycairo.trt

@@ -1,7 +0,0 @@
-
-
-<h1>PyCairo</h1>
-
-<mono>pycairo</mono> is licensed under the GNU Lesser General Public License (LGPL) version 3.
-
-A copy of the LGPL v3 may be found <link target="licenses/lgpl-3.0.trt">here</link>.

+ 0 - 8
util/extra-help/licenses/python.trt

@@ -1,8 +0,0 @@
-
-<h1>Python</h1>
-
-The license for Python may be viewed by running the following command:
-<mono>
-    python -c "license()"
-</mono>
-

+ 0 - 8
util/extra-help/mines.trt

@@ -1,8 +0,0 @@
-
-<h1>Mines</h1>
-
-<img src="/usr/share/icons/48/mines.png"></img>
-Implementation of the classic logic game.
-
-Click to reveal, ctrl+click to flag / unflag.
-

+ 0 - 5
util/extra-help/packages.trt

@@ -1,5 +0,0 @@
-
-<h1>Package Manager</h1>
-
-<img src="/usr/share/icons/48/package.png"></img>
-The <i>Package Manager</i> can be used to browse and install available packages.

+ 0 - 14
util/extra-help/painting.trt

@@ -1,14 +0,0 @@
-
-<h1>ToaruPaint</h1>
-
-<img src="/usr/share/icons/48/applications-painting.png"></img>
-Draw things with this simple painting tool.
-
-<h2>Controls</h2>
-
-Select colors using the color picker (Tools > Color).
-
-Change the brush size by scrolling the mouse wheel up and down.
-
-Drag the viewport with the middle mouse button.
-

+ 0 - 9
util/fix-python.sh

@@ -48,12 +48,3 @@ popd
 echo "Installing readline hook..."
 cp util/readline._py $HDD_PATH/usr/python/lib/python3.6/
 
-echo "Installing demos..."
-mkdir -p base/usr/share/python-demos
-cp util/python-demos/*.py base/usr/share/python-demos/
-
-echo "Installing Help Browser files..."
-mkdir -p base/usr/share/help
-mkdir -p base/usr/share/help/licenses
-cp util/extra-help/*.trt base/usr/share/help/
-cp util/extra-help/licenses/*.trt base/usr/share/help/licenses/

+ 0 - 82
util/python-demos/about_applet.py

@@ -1,82 +0,0 @@
-#!/usr/bin/python3
-"""
-Generic "About" applet provider.
-"""
-import sys
-
-import cairo
-
-import yutani
-import text_region
-import toaru_fonts
-
-import yutani_mainloop
-
-
-class AboutAppletWindow(yutani.Window):
-
-    base_width = 350
-    base_height = 250
-
-    text_offset = 110
-
-    def __init__(self, decorator, title, logo, text, icon="star",on_close=None):
-        super(AboutAppletWindow, self).__init__(self.base_width + decorator.width(), self.base_height + decorator.height(), title=title, flags=yutani.WindowFlag.FLAG_DISALLOW_RESIZE, icon=icon, doublebuffer=True)
-        self.move(int((yutani.yutani_ctx._ptr.contents.display_width-self.width)/2),int((yutani.yutani_ctx._ptr.contents.display_height-self.height)/2))
-        self.decorator = decorator
-        if logo.endswith('.png'):
-            logo = logo.replace('.png','.bmp') # Hope that works
-        self.logo = yutani.Sprite.from_file(logo).get_cairo_surface()
-        self.font = toaru_fonts.Font(toaru_fonts.FONT_SANS_SERIF, 13, 0xFF000000)
-        self.tr = text_region.TextRegion(0,0,self.base_width-30,self.base_height-self.text_offset,font=self.font)
-        self.tr.set_alignment(2)
-        self.tr.set_richtext(text)
-        self.on_close = on_close
-        self.draw()
-
-    def draw(self):
-        surface = self.get_cairo_surface()
-
-        WIDTH, HEIGHT = self.width - self.decorator.width(self), self.height - self.decorator.height(self)
-
-        ctx = cairo.Context(surface)
-        ctx.translate(self.decorator.left_width(self), self.decorator.top_height(self))
-        ctx.rectangle(0,0,WIDTH,HEIGHT)
-        ctx.set_source_rgb(204/255,204/255,204/255)
-        ctx.fill()
-
-        ctx.set_source_surface(self.logo,int((WIDTH-self.logo.get_width())/2),10+int((84-self.logo.get_height())/2))
-        ctx.paint()
-
-        self.tr.resize(WIDTH-30,HEIGHT-self.text_offset)
-        self.tr.move(self.decorator.left_width(self) + 15,self.decorator.top_height(self)+self.text_offset)
-        self.tr.draw(self)
-
-        self.decorator.render(self)
-        self.flip()
-
-    def finish_resize(self, msg):
-        """Accept a resize."""
-        self.resize_accept(msg.width, msg.height)
-        self.reinit()
-        self.draw()
-        self.resize_done()
-        self.flip()
-
-    def close_window(self):
-        self.close()
-        if self.on_close:
-            self.on_close()
-
-    def mouse_event(self, msg):
-        if self.decorator.handle_event(msg) == yutani.Decor.EVENT_CLOSE:
-            self.close_window()
-            return
-        x,y = msg.new_x - self.decorator.left_width(self), msg.new_y - self.decorator.top_height(self)
-        w,h = self.width - self.decorator.width(self), self.height - self.decorator.height(self)
-
-    def keyboard_event(self, msg):
-        if msg.event.key == b"q":
-            self.close_window()
-
-

+ 0 - 101
util/python-demos/button.py

@@ -1,101 +0,0 @@
-import math
-
-import cairo
-
-import yutani
-import text_region
-import toaru_fonts
-
-def rounded_rectangle(ctx,x,y,w,h,r):
-    degrees = math.pi / 180
-    ctx.new_sub_path()
-
-    ctx.arc(x + w - r, y + r, r, -90 * degrees, 0 * degrees)
-    ctx.arc(x + w - r, y + h - r, r, 0 * degrees, 90 * degrees)
-    ctx.arc(x + r, y + h - r, r, 90 * degrees, 180 * degrees)
-    ctx.arc(x + r, y + r, r, 180 * degrees, 270 * degrees)
-    ctx.close_path()
-
-def draw_button(ctx,x,y,w,h,hilight):
-    """Theme definition for drawing a button."""
-    ctx.save()
-
-    ctx.set_line_cap(cairo.LINE_CAP_ROUND)
-    ctx.set_line_join(cairo.LINE_JOIN_ROUND)
-
-    if hilight == 2:
-        rounded_rectangle(ctx, 2 + x, 2 + y, w - 4, h - 4, 2.0)
-        ctx.set_source_rgba(134/255,173/255,201/255,1.0)
-        ctx.set_line_width(2)
-        ctx.stroke()
-
-        rounded_rectangle(ctx, 2 + x, 2 + y, w - 4, h - 4, 2.0)
-        ctx.set_source_rgba(202/255,211/255,232/255,1.0)
-        ctx.fill()
-    else:
-        rounded_rectangle(ctx, 2 + x, 2 + y, w - 4, h - 4, 2.0)
-        ctx.set_source_rgba(44/255,71/255,91/255,29/255)
-        ctx.set_line_width(4)
-        ctx.stroke()
-
-        rounded_rectangle(ctx, 2 + x, 2 + y, w - 4, h - 4, 2.0)
-        ctx.set_source_rgba(158/255,169/255,177/255,1.0)
-        ctx.set_line_width(2)
-        ctx.stroke()
-
-        if hilight == 1:
-            pat = cairo.LinearGradient(2+x,2+y,2+x,2+y+h-4)
-            pat.add_color_stop_rgba(0,1,1,1,1)
-            pat.add_color_stop_rgba(1,229/255,229/255,246/255,1)
-            rounded_rectangle(ctx,2+x,2+y,w-4,h-4,2.0)
-            ctx.set_source(pat)
-            ctx.fill()
-
-            pat = cairo.LinearGradient(3+x,3+y,3+x,3+y+h-4)
-            pat.add_color_stop_rgba(0,252/255,252/255,254/255,1)
-            pat.add_color_stop_rgba(1,212/255,223/255,251/255,1)
-            rounded_rectangle(ctx,3+x,3+y,w-5,h-5,2.0)
-            ctx.set_source(pat)
-            ctx.fill()
-
-        else:
-            pat = cairo.LinearGradient(2+x,2+y,2+x,2+y+h-4)
-            pat.add_color_stop_rgba(0,1,1,1,1)
-            pat.add_color_stop_rgba(1,241/255,241/255,244/255,1)
-            rounded_rectangle(ctx,2+x,2+y,w-4,h-4,2.0)
-            ctx.set_source(pat)
-            ctx.fill()
-
-            pat = cairo.LinearGradient(3+x,3+y,3+x,3+y+h-4)
-            pat.add_color_stop_rgba(0,252/255,252/255,254/255,1)
-            pat.add_color_stop_rgba(1,223/255,225/255,230/255,1)
-            rounded_rectangle(ctx,3+x,3+y,w-5,h-5,2.0)
-            ctx.set_source(pat)
-            ctx.fill()
-
-    ctx.restore()
-
-class Button(object):
-
-    def __init__(self, text, callback):
-        self.text = text
-        self.callback = callback
-        self.hilight = 0
-        self.x, self.y, self.width, self.height = 0,0,0,0
-
-    def draw(self, window, ctx, x, y, w, h):
-        self.x, self.y, self.width, self.height = x, y, w, h
-        draw_button(ctx,x,y,w,h,self.hilight)
-
-        x_, y_ = ctx.user_to_device(x,y)
-        tr = text_region.TextRegion(int(x_),int(y_),w,h)
-        tr.set_alignment(2)
-        tr.set_valignment(2)
-        tr.set_text(self.text)
-        tr.draw(window)
-
-    def focus_enter(self):
-        self.hilight = 1
-
-    def focus_leave(self):
-        self.hilight = 0

+ 0 - 284
util/python-demos/calculator.py

@@ -1,284 +0,0 @@
-#!/usr/bin/python3
-"""
-Calculator for ToaruOS
-"""
-import subprocess
-import sys
-
-import cairo
-
-import yutani
-import text_region
-import toaru_fonts
-
-from button import Button
-from menu_bar import MenuBarWidget, MenuEntryAction, MenuEntrySubmenu, MenuEntryDivider, MenuWindow
-from about_applet import AboutAppletWindow
-
-import yutani_mainloop
-
-import ast
-import operator as op
-
-operators = {ast.Add: op.add, ast.Sub: op.sub, ast.Mult: op.mul,
-             ast.Div: op.truediv, ast.Pow: op.pow, ast.BitXor: op.xor,
-             ast.USub: op.neg}
-
-app_name = "Calculator"
-version = "1.0.0"
-_description = f"<b>{app_name} {version}</b>\n© 2017-2018 K. Lange\n\nSimple four-function calculator using Python.\n\n<color 0x0000FF>http://github.com/klange/toaruos</color>"
-
-def eval_expr(expr):
-    """
-    >>> eval_expr('2^6')
-    4
-    >>> eval_expr('2**6')
-    64
-    >>> eval_expr('1 + 2*3**(4^5) / (6 + -7)')
-    -5.0
-    """
-    return eval_(ast.parse(expr, mode='eval').body)
-
-def eval_(node):
-    if isinstance(node, ast.Num): # <number>
-        return node.n
-    elif isinstance(node, ast.BinOp): # <left> <operator> <right>
-        return operators[type(node.op)](eval_(node.left), eval_(node.right))
-    elif isinstance(node, ast.UnaryOp): # <operator> <operand> e.g., -1
-        return operators[type(node.op)](eval_(node.operand))
-    else:
-        raise TypeError("invalid operation")
-
-
-class CalculatorWindow(yutani.Window):
-
-    base_width = 200
-    base_height = 240
-
-    def __init__(self, decorator):
-        super(CalculatorWindow, self).__init__(self.base_width + decorator.width(), self.base_height + decorator.height(), title=app_name, icon="calculator", doublebuffer=True)
-        self.move(100,100)
-        self.decorator = decorator
-
-        def add_string(button):
-            self.add_string(button.text)
-
-        def clear(button):
-            self.clear_text()
-
-        def calculate(button):
-            self.calculate()
-
-        self.buttons = [
-            [Button("C",clear),      None,                   Button("(",add_string), Button(")",add_string)],
-            [Button("7",add_string), Button("8",add_string), Button("9",add_string), Button("/",add_string)],
-            [Button("4",add_string), Button("5",add_string), Button("6",add_string), Button("*",add_string)],
-            [Button("1",add_string), Button("2",add_string), Button("3",add_string), Button("-",add_string)],
-            [Button("0",add_string), Button(".",add_string), Button("=",calculate),  Button("+",add_string)],
-        ]
-
-        def exit_app(action):
-            menus = [x for x in self.menus.values()]
-            for x in menus:
-                x.definitely_close()
-            self.close()
-            sys.exit(0)
-        def about_window(action):
-            AboutAppletWindow(self.decorator,f"About {app_name}","/usr/share/icons/48/calculator.png",_description,"calculator")
-        def help_browser(action):
-            subprocess.Popen(["help-browser.py","calculator.trt"])
-        menus = [
-            ("File", [
-                MenuEntryAction("Exit","exit",exit_app,None),
-            ]),
-            ("Help", [
-                MenuEntryAction("Contents","help",help_browser,None),
-                MenuEntryDivider(),
-                MenuEntryAction(f"About {app_name}","star",about_window,None),
-            ]),
-        ]
-
-        self.menubar = MenuBarWidget(self,menus)
-
-        self.tr = text_region.TextRegion(self.decorator.left_width(self)+5,self.decorator.top_height(self)+self.menubar.height,self.base_width-10,40)
-        self.tr.set_font(toaru_fonts.Font(toaru_fonts.FONT_MONOSPACE,18))
-        self.tr.set_text("")
-        self.tr.set_alignment(1)
-        self.tr.set_valignment(2)
-        self.tr.set_one_line()
-        self.tr.set_ellipsis()
-
-        self.error = False
-
-        self.hover_widget = None
-        self.down_button = None
-
-        self.menus = {}
-        self.hovered_menu = None
-
-
-    def calculate(self):
-        if self.error or len(self.tr.text) == 0:
-            self.tr.set_text("0")
-            self.error = False
-        try:
-            self.tr.set_text(str(eval_expr(self.tr.text)))
-        except Exception as e:
-            error = str(e)
-            if "(" in error:
-                error = error[:error.find("(")-1]
-            self.tr.set_richtext(f"<i><color 0xFF0000>{e.__class__.__name__}</color>: {error}</i>")
-            self.error = True
-        self.draw()
-        self.flip()
-
-    def add_string(self, text):
-        if self.error:
-            self.tr.text = ""
-            self.error = False
-        self.tr.set_text(self.tr.text + text)
-        self.draw()
-        self.flip()
-
-    def clear_text(self):
-        self.error = False
-        self.tr.set_text("")
-        self.draw()
-        self.flip()
-
-    def clear_last(self):
-        if self.error:
-            self.error = False
-            self.tr.set_text("")
-        if len(self.tr.text):
-            self.tr.set_text(self.tr.text[:-1])
-        self.draw()
-        self.flip()
-
-    def draw(self):
-        surface = self.get_cairo_surface()
-
-        WIDTH, HEIGHT = self.width - self.decorator.width(self), self.height - self.decorator.height(self)
-
-        ctx = cairo.Context(surface)
-        ctx.translate(self.decorator.left_width(self), self.decorator.top_height(self))
-        ctx.rectangle(0,0,WIDTH,HEIGHT)
-        ctx.set_source_rgb(204/255,204/255,204/255)
-        ctx.fill()
-
-        ctx.rectangle(0,5+self.menubar.height,WIDTH,self.tr.height-10)
-        ctx.set_source_rgb(1,1,1)
-        ctx.fill()
-        self.tr.move(self.decorator.left_width(self)+5,self.decorator.top_height(self)+self.menubar.height)
-        self.tr.resize(WIDTH-10, self.tr.height)
-        self.tr.draw(self)
-
-        offset_x = 0
-        offset_y = self.tr.height + self.menubar.height
-        button_height = int((HEIGHT - self.tr.height - self.menubar.height) / len(self.buttons))
-        for row in self.buttons:
-            button_width = int(WIDTH / len(row))
-            for button in row:
-                if button:
-                    button.draw(self,ctx,offset_x,offset_y,button_width,button_height)
-                offset_x += button_width
-            offset_x = 0
-            offset_y += button_height
-
-        self.menubar.draw(ctx,0,0,WIDTH)
-        self.decorator.render(self)
-        self.flip()
-
-    def finish_resize(self, msg):
-        """Accept a resize."""
-        if msg.width < 200 or msg.height < 200:
-            self.resize_offer(max(msg.width,200),max(msg.height,200))
-            return
-        self.resize_accept(msg.width, msg.height)
-        self.reinit()
-        self.draw()
-        self.resize_done()
-        self.flip()
-
-    def mouse_event(self, msg):
-        decor_event = d.handle_event(msg)
-        if decor_event == yutani.Decor.EVENT_CLOSE:
-            window.close()
-            sys.exit(0)
-        elif decor_event == yutani.Decor.EVENT_RIGHT:
-            d.show_menu(self, msg)
-        x,y = msg.new_x - self.decorator.left_width(self), msg.new_y - self.decorator.top_height(self)
-        w,h = self.width - self.decorator.width(self), self.height - self.decorator.height(self)
-
-        if x >= 0 and x < w and y >= 0 and y < self.menubar.height:
-            self.menubar.mouse_event(msg, x, y)
-            return
-
-        redraw = False
-        if self.down_button:
-            if msg.command == yutani.MouseEvent.RAISE or msg.command == yutani.MouseEvent.CLICK:
-                if not (msg.buttons & yutani.MouseButton.BUTTON_LEFT):
-                    if x >= self.down_button.x and \
-                        x < self.down_button.x + self.down_button.width and \
-                        y >= self.down_button.y and \
-                        y < self.down_button.y + self.down_button.height:
-                            self.down_button.focus_enter()
-                            self.down_button.callback(self.down_button)
-                            self.down_button = None
-                            redraw = True
-                    else:
-                        self.down_button.focus_leave()
-                        self.down_button = None
-                        redraw = True
-
-        else:
-            if y > self.tr.height + self.menubar.height and y < h and x >= 0 and x < w:
-                row = int((y - self.tr.height - self.menubar.height) / (self.height - self.decorator.height() - self.tr.height - self.menubar.height) * len(self.buttons))
-                col = int(x / (self.width - self.decorator.width(self)) * len(self.buttons[row]))
-                button = self.buttons[row][col]
-                if button != self.hover_widget:
-                    if button:
-                        button.focus_enter()
-                        redraw = True
-                    if self.hover_widget:
-                        self.hover_widget.focus_leave()
-                        redraw = True
-                    self.hover_widget = button
-
-                if msg.command == yutani.MouseEvent.DOWN:
-                    if button:
-                        button.hilight = 2
-                        self.down_button = button
-                        redraw = True
-            else:
-                if self.hover_widget:
-                    self.hover_widget.focus_leave()
-                    redraw = True
-                self.hover_widget = None
-
-        if redraw:
-            self.draw()
-
-    def keyboard_event(self, msg):
-        if msg.event.action != 0x01:
-            return # Ignore anything that isn't a key down.
-        if msg.event.key in b"0123456789.+-/*()":
-            self.add_string(msg.event.key.decode('utf-8'))
-        if msg.event.key == b"\n":
-            self.calculate()
-        if msg.event.key == b"c":
-            self.clear_text()
-        if msg.event.keycode == 8:
-            self.clear_last()
-        if msg.event.key == b"q":
-            self.close()
-            sys.exit(0)
-
-if __name__ == '__main__':
-    yutani.Yutani()
-    d = yutani.Decor()
-
-    window = CalculatorWindow(d)
-    window.draw()
-
-    yutani_mainloop.mainloop()

+ 0 - 310
util/python-demos/clock.py

@@ -1,310 +0,0 @@
-#!/usr/bin/python3
-"""
-Fancy clock.
-"""
-import math
-import os
-import sys
-import time
-
-import cairo
-
-import yutani
-import toaru_fonts
-import fswait
-
-from menu_bar import MenuBarWidget, MenuEntryAction, MenuEntrySubmenu, MenuEntryDivider, MenuWindow
-from about_applet import AboutAppletWindow
-
-import yutani_mainloop
-
-app_name = "Clock"
-version = "1.0.0"
-_description = f"<b>{app_name} {version}</b>\n© 2017-2018 K. Lange\n\nAnalog clock widget.\n\n<color 0x0000FF>http://github.com/klange/toaruos</color>"
-
-class BasicWatchFace(object):
-
-    def __init__(self):
-        self.font = toaru_fonts.get_cairo_face()
-
-    def draw_background(self, ctx, t):
-        ctx.set_line_width(9)
-        ctx.set_source_rgb(0,0,0)
-        ctx.arc(0,0,100 - 10, 0, 2 * math.pi)
-        ctx.stroke_preserve()
-        ctx.set_source_rgb(1,1,1)
-        ctx.fill()
-
-        r2 = 100 - 9
-        ctx.set_source_rgb(0,0,0)
-        for i in range(12*5):
-            theta = 2 * math.pi * (i / (12*5))
-            if i % 5 == 0:
-                ctx.set_line_width(2)
-                r1 = 100 - 20
-            else:
-                ctx.set_line_width(0.5)
-                r1 = 100 - 14
-            ctx.move_to(math.sin(theta) * r1, -r1 * math.cos(theta))
-            ctx.line_to(math.sin(theta) * r2, -r2 * math.cos(theta))
-            ctx.stroke()
-
-    def setup_labels(self, ctx, t):
-        ctx.set_font_face(self.font)
-        ctx.set_font_size(12)
-        ctx.set_source_rgb(0,0,0)
-
-    def draw_labels(self, ctx, t):
-        ctx.save()
-        label = "12"
-        e = ctx.text_extents(label)
-        ctx.move_to(-e[2]/2,-72+e[3])
-        ctx.show_text(label)
-        ctx.fill()
-        label = "3"
-        e = ctx.text_extents(label)
-        ctx.move_to(75-e[2],e[3]/2)
-        ctx.show_text(label)
-        ctx.fill()
-        label = "9"
-        e = ctx.text_extents(label)
-        ctx.move_to(-75,e[3]/2)
-        ctx.show_text(label)
-        ctx.fill()
-        label = "6"
-        e = ctx.text_extents(label)
-        ctx.move_to(-e[2]/2,72)
-        ctx.show_text(label)
-        ctx.fill()
-
-        label = "1"
-        e = ctx.text_extents(label)
-        ctx.move_to(39-e[2],-63+e[3])
-        ctx.show_text(label)
-        ctx.fill()
-        label = "11"
-        e = ctx.text_extents(label)
-        ctx.move_to(-39,-63+e[3])
-        ctx.show_text(label)
-        ctx.fill()
-
-        label = "5"
-        e = ctx.text_extents(label)
-        ctx.move_to(39-e[2],63)
-        ctx.show_text(label)
-        ctx.fill()
-        label = "7"
-        e = ctx.text_extents(label)
-        ctx.move_to(-39,63)
-        ctx.show_text(label)
-        ctx.fill()
-
-        label = "2"
-        e = ctx.text_extents(label)
-        ctx.move_to(63-e[2],-37+e[3])
-        ctx.show_text(label)
-        ctx.fill()
-        label = "10"
-        e = ctx.text_extents(label)
-        ctx.move_to(-63,-37+e[3])
-        ctx.show_text(label)
-        ctx.fill()
-
-        label = "4"
-        e = ctx.text_extents(label)
-        ctx.move_to(63-e[2],37)
-        ctx.show_text(label)
-        ctx.fill()
-        label = "8"
-        e = ctx.text_extents(label)
-        ctx.move_to(-63,37)
-        ctx.show_text(label)
-        ctx.fill()
-        ctx.restore()
-
-    def draw_date(self, ctx, t):
-        ctx.save()
-        ctx.set_font_size(10)
-        label = time.strftime('%B %e',t[0])
-        e = ctx.text_extents(label)
-        ctx.move_to(-e[2]/2,-30)
-        ctx.show_text(label)
-        ctx.fill()
-
-    def draw_line(self, ctx, thickness, color, a, b, r1, r2):
-        theta = (a / b) * 2 * math.pi
-        ctx.set_line_width(thickness)
-        ctx.set_source_rgb(*color)
-        ctx.move_to(math.sin(theta) * r1, -r1 * math.cos(theta))
-        ctx.line_to(math.sin(theta) * r2, -r2 * math.cos(theta))
-        ctx.stroke()
-
-    def tick(self,t):
-        ts = t*t
-        tc = ts*t
-        return (0.5*tc*ts + -8*ts*ts + 20*tc + -19*ts + 7.5*t);
-
-    def draw_hands(self, ctx, t):
-        _,h,m,s = t
-        self.draw_line(ctx,3,(0,0,0),h%12+(m+s/60)/60,12,52,-5)
-        self.draw_line(ctx,2,(0,0,0),m+s/60,60,86,-10)
-
-        _s = int(60+s-1)+self.tick(s%1)
-        self.draw_line(ctx,1,(1,0,0),_s,60,86,-20)
-        self.draw_line(ctx,3,(1,0,0),_s,60,-4,-16)
-
-    def draw(self, ctx, t):
-        self.draw_background(ctx,t)
-        self.setup_labels(ctx,t)
-        self.draw_labels(ctx,t)
-        self.draw_date(ctx,t)
-        self.draw_hands(ctx,t)
-
-class DarkWatchFace(BasicWatchFace):
-    def draw_background(self, ctx, t):
-        ctx.set_line_width(9)
-        ctx.set_source_rgb(1,1,1)
-        ctx.arc(0,0,100 - 10, 0, 2 * math.pi)
-        ctx.stroke_preserve()
-        ctx.set_source_rgb(0,0,0)
-        ctx.fill()
-
-        r2 = 100 - 9
-        ctx.set_source_rgb(1,1,1)
-        for i in range(12*5):
-            theta = 2 * math.pi * (i / (12*5))
-            if i % 5 == 0:
-                ctx.set_line_width(2)
-                r1 = 100 - 20
-            else:
-                ctx.set_line_width(0.5)
-                r1 = 100 - 14
-            ctx.move_to(math.sin(theta) * r1, -r1 * math.cos(theta))
-            ctx.line_to(math.sin(theta) * r2, -r2 * math.cos(theta))
-            ctx.stroke()
-
-    def draw_hands(self, ctx, t):
-        _,h,m,s = t
-        self.draw_line(ctx,3,(1,1,1),h%12+(m+s/60)/60,12,52,-5)
-        self.draw_line(ctx,2,(1,1,1),m+s/60,60,86,-10)
-
-        _s = int(60+s-1)+self.tick(s%1)
-        self.draw_line(ctx,1,(1,0,0),_s,60,86,-20)
-        self.draw_line(ctx,3,(1,0,0),_s,60,-4,-16)
-
-    def setup_labels(self, ctx, t):
-        ctx.set_font_face(self.font)
-        ctx.set_font_size(12)
-        ctx.set_source_rgb(1,1,1)
-
-
-class ClockWindow(yutani.Window):
-
-    base_width = 200
-    base_height = 200
-
-    def __init__(self):
-        super(ClockWindow, self).__init__(self.base_width, self.base_height, title="Clock", icon="clock", doublebuffer=True)
-        self.move(100,100)
-        self.update_shape(yutani.WindowShape.THRESHOLD_CLEAR)
-
-        self.menus = {}
-
-        self.watchfaces = {
-            'Default': BasicWatchFace(),
-            'Dark': DarkWatchFace(),
-        }
-
-        self.watchface = self.watchfaces['Default']
-
-
-    def draw(self):
-        surface = self.get_cairo_surface()
-        ctx = cairo.Context(surface)
-
-        # Clear
-        ctx.set_operator(cairo.OPERATOR_SOURCE)
-        ctx.rectangle(0,0,self.width,self.height)
-        ctx.set_source_rgba(0,0,0,0)
-        ctx.fill()
-
-        ctx.set_operator(cairo.OPERATOR_OVER)
-        ctx.translate(self.width / 2, self.height / 2)
-        ctx.scale(self.width / 200, self.height / 200)
-
-        current_time = time.time()
-        t = time.localtime(int(current_time))
-        s = current_time % 60
-        m = t.tm_min
-        h = t.tm_hour
-
-        self.watchface.draw(ctx,(t,h,m,s))
-
-        self.flip()
-
-    def finish_resize(self, msg):
-        """Accept a resize."""
-        if msg.width != msg.height:
-            s = min(msg.width,msg.height)
-            self.resize_offer(s,s)
-            return
-        self.resize_accept(msg.width, msg.height)
-        self.reinit()
-
-        self.draw()
-        self.resize_done()
-        self.flip()
-
-    def exit(self, data):
-        sys.exit(0)
-
-    def about(self, data=None):
-        AboutAppletWindow(d,f"About {app_name}","/usr/share/icons/48/clock.bmp",_description,"clock")
-
-    def mouse_event(self, msg):
-        # drag start
-        if msg.command == yutani.MouseEvent.DOWN and msg.buttons & yutani.MouseButton.BUTTON_LEFT:
-            self.drag_start()
-
-        if msg.buttons & yutani.MouseButton.BUTTON_RIGHT:
-            if not self.menus:
-                def set_face(x):
-                    self.watchface = self.watchfaces[x]
-                faces = [MenuEntryAction(x,None,set_face,x) for x in self.watchfaces.keys()]
-                menu_entries = [
-                    MenuEntrySubmenu("Watchface",faces,icon='clock'),
-                    MenuEntryAction(f"About {app_name}","star",self.about,None),
-                    MenuEntryDivider(),
-                    MenuEntryAction("Exit","exit",self.exit,None),
-                ]
-                menu = MenuWindow(menu_entries,(self.x+msg.new_x,self.y+msg.new_y),root=self)
-
-    def keyboard_event(self, msg):
-        if msg.event.action != yutani.KeyAction.ACTION_DOWN:
-            return
-        if msg.event.key == b'q':
-            self.exit(None)
-
-
-if __name__ == '__main__':
-    yutani.Yutani()
-    d = yutani.Decor() # Just in case.
-
-    window = ClockWindow()
-    window.draw()
-
-    fds = [yutani.yutani_ctx]
-    while 1:
-        # Poll for events.
-        fd = fswait.fswait(fds,20)
-        if fd == 0:
-            msg = yutani.yutani_ctx.poll()
-            while msg:
-                yutani_mainloop.handle_event(msg)
-                msg = yutani.yutani_ctx.poll(False)
-            window.draw()
-        elif fd == 1:
-            # Tick
-            window.draw()
-
-

+ 0 - 456
util/python-demos/dialog.py

@@ -1,456 +0,0 @@
-#!/usr/bin/python3
-"""
-Simple okay/cancel dialog.
-"""
-import os
-import re
-import stat
-import sys
-import time
-import fnmatch
-
-import cairo
-
-import yutani
-import text_region
-import toaru_fonts
-
-from button import Button
-from icon_cache import get_icon
-
-import yutani_mainloop
-
-_default_text = "This is a dialog. <b>Formatting is available.</b>"
-
-hilight_border_top = (54/255,128/255,205/255)
-hilight_gradient_top = (93/255,163/255,236/255)
-hilight_gradient_bottom = (56/255,137/255,220/55)
-hilight_border_bottom = (47/255,106/255,167/255)
-
-class DialogButtons(object):
-
-    OKAY_CANCEL = 1
-    YES_NO_CANCEL = 2
-
-class DialogWindow(yutani.Window):
-
-    base_width = 500
-    base_height = 150
-
-    text_offset = 40
-
-    okay_label = "Okay"
-    cancel_label = "Cancel"
-
-    def __init__(self, decorator, title, text, icon='help', buttons=DialogButtons.OKAY_CANCEL, callback=None, cancel_callback=None,window=None,cancel_label=True,close_is_cancel=True):
-        super(DialogWindow, self).__init__(self.base_width + decorator.width(), self.base_height + decorator.height(), title=title, icon=icon, doublebuffer=True)
-
-        if window:
-            # Center window
-            self.move(window.x+int((window.width-self.width)/2),window.y+int((window.height-self.height)/2))
-        else:
-            # Center screen
-            self.move(int((yutani.yutani_ctx._ptr.contents.display_width-self.width)/2),int((yutani.yutani_ctx._ptr.contents.display_height-self.height)/2))
-        self.decorator = decorator
-        self.logo = get_icon(icon,48,'help')
-        self.font = toaru_fonts.Font(toaru_fonts.FONT_SANS_SERIF, 13, 0xFF000000)
-        self.tr = text_region.TextRegion(0,0,self.base_width-60,self.base_height-self.text_offset,font=self.font)
-        self.tr.set_richtext(text)
-
-        if cancel_label is not True:
-            self.cancel_label = cancel_label
-
-        self.button_ok = Button(self.okay_label,self.ok_click)
-        self.button_cancel = Button(self.cancel_label,self.cancel_click)
-        self.buttons = [self.button_ok]
-        if self.cancel_label:
-            self.buttons.append(self.button_cancel)
-
-        self.close_is_cancel = close_is_cancel
-
-        self.hover_widget = None
-        self.down_button = None
-
-        self.callback = callback
-        self.cancel_callback = cancel_callback
-        self.draw()
-
-    def ok_click(self, button):
-        self.close()
-        if self.callback:
-            self.callback()
-        return False
-
-    def cancel_click(self, button):
-        self.close()
-        if self.cancel_callback:
-            self.cancel_callback()
-        return False
-
-    def draw(self):
-        surface = self.get_cairo_surface()
-
-        WIDTH, HEIGHT = self.width - self.decorator.width(self), self.height - self.decorator.height(self)
-
-        ctx = cairo.Context(surface)
-        ctx.translate(self.decorator.left_width(self), self.decorator.top_height(self))
-        ctx.rectangle(0,0,WIDTH,HEIGHT)
-        ctx.set_source_rgb(204/255,204/255,204/255)
-        ctx.fill()
-
-        ctx.set_source_surface(self.logo,30,30)
-        ctx.paint()
-
-        self.tr.resize(WIDTH-90,HEIGHT-self.text_offset)
-        self.tr.move(self.decorator.left_width(self) + 90,self.decorator.top_height(self)+self.text_offset)
-        self.tr.draw(self)
-
-        self.button_ok.draw(self,ctx,WIDTH-130,HEIGHT-60,100,30)
-        if self.cancel_label:
-            self.button_cancel.draw(self,ctx,WIDTH-240,HEIGHT-60,100,30)
-
-        self.decorator.render(self)
-        self.flip()
-
-    def finish_resize(self, msg):
-        """Accept a resize."""
-        self.resize_accept(msg.width, msg.height)
-        self.reinit()
-        self.draw()
-        self.resize_done()
-        self.flip()
-
-    def mouse_event(self, msg):
-        decor_event = self.decorator.handle_event(msg)
-        if decor_event == yutani.Decor.EVENT_CLOSE:
-            if self.close_is_cancel:
-                self.cancel_click(None)
-            else:
-                self.ok_click(None)
-            return
-        elif decor_event == yutani.Decor.EVENT_RIGHT:
-            self.decorator.show_menu(self, msg)
-        x,y = msg.new_x - self.decorator.left_width(self), msg.new_y - self.decorator.top_height(self)
-        w,h = self.width - self.decorator.width(self), self.height - self.decorator.height(self)
-
-        redraw = False
-        if self.down_button:
-            if msg.command == yutani.MouseEvent.RAISE or msg.command == yutani.MouseEvent.CLICK:
-                if not (msg.buttons & yutani.MouseButton.BUTTON_LEFT):
-                    if x >= self.down_button.x and \
-                        x < self.down_button.x + self.down_button.width and \
-                        y >= self.down_button.y and \
-                        y < self.down_button.y + self.down_button.height:
-                            self.down_button.focus_enter()
-                            if self.down_button.callback(self.down_button):
-                                redraw = True
-                            self.down_button = None
-                    else:
-                        self.down_button.focus_leave()
-                        self.down_button = None
-                        redraw = True
-
-        else:
-            button = None
-            for b in self.buttons:
-                if x >= b.x and x < b.x + b.width and y >= b.y and y < b.y + b.height:
-                    button = b
-                    break
-            if button != self.hover_widget:
-                if button:
-                    button.focus_enter()
-                    redraw = True
-                if self.hover_widget:
-                    self.hover_widget.focus_leave()
-                    redraw = True
-                self.hover_widget = button
-
-            if msg.command == yutani.MouseEvent.DOWN:
-                if button:
-                    button.hilight = 2
-                    self.down_button = button
-                    redraw = True
-            if not button:
-                if self.hover_widget:
-                    self.hover_widget.focus_leave()
-                    redraw = True
-                self.hover_widget = None
-
-        if redraw:
-            self.draw()
-
-    def keyboard_event(self, msg):
-        if msg.event.action == yutani.KeyAction.ACTION_DOWN:
-            if msg.event.key == b'\n':
-                self.ok_click(None)
-
-
-class File(object):
-
-    def __init__(self, path,name=None):
-        if not name:
-            self.name = os.path.basename(path)
-        else:
-            self.name = name
-        self.path = os.path.normpath(path)
-        self.stat = os.stat(path)
-        self.y = 0
-        self.x = 0
-        self.hilight = False
-        self.tr = text_region.TextRegion(0,0,400,20)
-        self.tr.set_one_line()
-        self.tr.set_ellipsis()
-        self.tr.set_text(self.name)
-
-    def do_action(self, dialog):
-        if self.is_directory:
-            dialog.load_directory(self.path)
-            dialog.redraw_buf()
-            return True
-        else:
-            dialog.path = self.path
-            dialog.ok_click(None)
-            return False
-
-    @property
-    def is_directory(self):
-        return stat.S_ISDIR(self.stat.st_mode)
-
-    @property
-    def is_executable(self):
-        return stat.S_IXUSR & self.stat.st_mode and not self.is_directory
-
-    @property
-    def icon(self):
-        if self.is_directory: return get_icon('folder',16)
-        if self.is_executable: return get_icon('applications-generic',16)
-        return get_icon('file',16) # Need file icon
-
-    @property
-    def sortkey(self):
-        if self.is_directory: return "___" + self.name
-        else: return "zzz" + self.name
-
-
-class OpenFileDialog(DialogWindow):
-
-    base_width = 500
-    base_height = 450
-    okay_label = "Open"
-
-    buf = None
-    path = None
-    icon_width = 16
-    unit_height = 20
-
-    def __init__(self, decorator, title, glob=None, callback=None, cancel_callback=None,window=None):
-        self.buf = None
-        self.path = None
-        if glob:
-            self.matcher = re.compile(fnmatch.translate(glob))
-        else:
-            self.matcher = None
-        self.tr = None
-        self.load_directory(os.getcwd())
-        self.redraw_buf()
-        self.hilighted = None
-        super(OpenFileDialog, self).__init__(decorator,title,"Open...",icon="open",callback=callback,cancel_callback=cancel_callback,window=window)
-        self.tr.set_text(self.directory)
-
-    def ok_click(self, button):
-        self.close()
-        if self.callback:
-            self.callback(self.path)
-        return False
-
-    def load_directory(self, directory):
-        self.directory = os.path.normpath(directory)
-        if self.tr:
-            self.tr.set_text(self.directory)
-        self.files = sorted([File(os.path.join(self.directory,f)) for f in os.listdir(self.directory)],key=lambda x: x.sortkey)
-        if self.matcher:
-            self.files = [x for x in self.files if x.is_directory or self.matcher.match(x.name)]
-        if directory != '/':
-            self.files.insert(0,File(os.path.join(self.directory,'..'),'(Go up)'))
-        self.scroll_y = 0
-
-    def redraw_buf(self,clips=None):
-        if self.buf:
-            self.buf.destroy()
-        w = 450
-        height = self.unit_height
-        self.buf = yutani.GraphicsBuffer(w,len(self.files)*height)
-
-        surface = self.buf.get_cairo_surface()
-        ctx = cairo.Context(surface)
-
-        if clips:
-            for clip in clips:
-                ctx.rectangle(clip.x,clip.y,w,height)
-            ctx.clip()
-
-        ctx.rectangle(0,0,surface.get_width(),surface.get_height())
-        ctx.set_source_rgb(1,1,1)
-        ctx.fill()
-
-        offset_y = 0
-
-        i = 0
-        for f in self.files:
-            f.y = offset_y
-            if not clips or f in clips:
-                tr = f.tr
-                tr.move(26,offset_y+2)
-                if f.hilight:
-                    gradient = cairo.LinearGradient(0,0,0,height-2)
-                    gradient.add_color_stop_rgba(0.0,*hilight_gradient_top,1.0)
-                    gradient.add_color_stop_rgba(1.0,*hilight_gradient_bottom,1.0)
-                    ctx.rectangle(0,offset_y,w,1)
-                    ctx.set_source_rgb(*hilight_border_top)
-                    ctx.fill()
-                    ctx.rectangle(0,offset_y+height-1,w,1)
-                    ctx.set_source_rgb(*hilight_border_bottom)
-                    ctx.fill()
-                    ctx.save()
-                    ctx.translate(0,offset_y+1)
-                    ctx.rectangle(0,0,w,height-2)
-                    ctx.set_source(gradient)
-                    ctx.fill()
-                    ctx.restore()
-                    tr.font.font_color = 0xFFFFFFFF
-                else:
-                    ctx.rectangle(0,offset_y,w,height)
-                    if i % 2:
-                        ctx.set_source_rgb(0.9,0.9,0.9)
-                    else:
-                        ctx.set_source_rgb(1,1,1)
-                    ctx.fill()
-                    tr.font.font_color = 0xFF000000
-                ctx.set_source_surface(f.icon,4,offset_y+2)
-                ctx.paint()
-                tr.draw(self.buf)
-            offset_y += height
-            i += 1
-
-    def draw(self):
-        surface = self.get_cairo_surface()
-
-        WIDTH, HEIGHT = self.width - self.decorator.width(self), self.height - self.decorator.height(self)
-
-        ctx = cairo.Context(surface)
-        ctx.translate(self.decorator.left_width(self), self.decorator.top_height(self))
-        ctx.rectangle(0,0,WIDTH,HEIGHT)
-        ctx.set_source_rgb(204/255,204/255,204/255)
-        ctx.fill()
-
-        #ctx.set_source_surface(self.logo,30,30)
-        #ctx.paint()
-
-        self.tr.resize(WIDTH,30)
-        self.tr.move(self.decorator.left_width(self),self.decorator.top_height(self)+10)
-        self.tr.set_alignment(2)
-        self.tr.draw(self)
-
-        ctx.save()
-        ctx.translate(20, 40)
-        ctx.rectangle(0,0,450,HEIGHT-130)
-        ctx.set_line_width(2)
-        ctx.set_source_rgb(0.7,0.7,0.7)
-        ctx.stroke_preserve()
-        ctx.set_source_rgb(1,1,1)
-        ctx.fill()
-        ctx.rectangle(0,0,450,HEIGHT-130)
-        ctx.clip()
-        text = self.buf.get_cairo_surface()
-        ctx.set_source_surface(text,0,self.scroll_y)
-        ctx.paint()
-        ctx.restore()
-
-        self.button_cancel.draw(self,ctx,WIDTH-130,HEIGHT-60,100,30)
-        self.button_ok.draw(self,ctx,WIDTH-240,HEIGHT-60,100,30)
-
-        self.decorator.render(self)
-        self.flip()
-
-    def scroll(self, amount):
-        w,h = self.width - self.decorator.width(self), self.height - self.decorator.height(self)
-        self.scroll_y += amount
-        if self.scroll_y > 0:
-            self.scroll_y = 0
-        top = min(-(self.buf.height - (h-130)),0)
-        if self.scroll_y < top:
-            self.scroll_y = top
-
-
-    def mouse_event(self, msg):
-        super(OpenFileDialog,self).mouse_event(msg)
-
-        x,y = msg.new_x - self.decorator.left_width(self), msg.new_y - self.decorator.top_height(self)
-        w,h = self.width - self.decorator.width(self), self.height - self.decorator.height(self)
-        if y < 0: return
-        if x < 0 or x >= w: return
-
-        if msg.buttons & yutani.MouseButton.SCROLL_UP:
-            self.scroll(30)
-            self.draw()
-            return
-        elif msg.buttons & yutani.MouseButton.SCROLL_DOWN:
-            self.scroll(-30)
-            self.draw()
-            return
-
-        offset_y = self.scroll_y + 40
-
-        redraw = []
-        hit = False
-
-        if x >= 20 and x < 450+20:
-            for f in self.files:
-                if offset_y > h: break
-                if y >= offset_y and y < offset_y + self.unit_height:
-                    if not f.hilight:
-                        redraw.append(f)
-                        if self.hilighted:
-                            redraw.append(self.hilighted)
-                            self.hilighted.hilight = False
-                        f.hilight = True
-                    self.hilighted = f
-                    hit = True
-                    break
-                offset_y += self.unit_height
-
-        if not hit:
-            if self.hilighted:
-                redraw.append(self.hilighted)
-                self.hilighted.hilight = False
-                self.hilighted = None
-
-        if self.hilighted:
-            if msg.command == yutani.MouseEvent.DOWN:
-                if self.hilighted.do_action(self):
-                    redraw = []
-                    self.redraw_buf()
-                    self.draw()
-
-        if redraw:
-            self.redraw_buf(redraw)
-            self.draw()
-
-
-if __name__ == '__main__':
-    yutani.Yutani()
-    d = yutani.Decor()
-
-    def okay(path):
-        print("You hit Okay!",path)
-        sys.exit(0)
-
-    def cancel():
-        print("You hit Cancel!")
-        sys.exit(0)
-
-    #window = DialogWindow(d,"Okay/Cancel Dialog","A thing happend!",cancel_callback=cancel,callback=okay)
-    window = OpenFileDialog(d,"Open...",glob="*.png",cancel_callback=cancel,callback=okay)
-
-    yutani_mainloop.mainloop()
-

+ 0 - 332
util/python-demos/file_browser.py

@@ -1,332 +0,0 @@
-#!/usr/bin/python3
-"""
-File Browser
-"""
-import os
-import math
-import stat
-import sys
-import subprocess
-
-import cairo
-
-import yutani
-import text_region
-import toaru_fonts
-
-from menu_bar import MenuBarWidget, MenuEntryAction, MenuEntrySubmenu, MenuEntryDivider, MenuWindow
-from icon_cache import get_icon
-from about_applet import AboutAppletWindow
-from input_box import TextInputWindow
-from dialog import DialogWindow
-
-import yutani_mainloop
-
-app_name = "File Browser"
-version = "1.0.0"
-_description = f"<b>{app_name} {version}</b>\n© 2017-2018 K. Lange\n\nFile system navigator.\n\n<color 0x0000FF>http://github.com/klange/toaruos</color>"
-
-class File(object):
-
-    def __init__(self, path, window):
-        self.path = path
-        self.name = os.path.basename(path)
-        self.stat = os.stat(path)
-        self.hilight = False
-        self.window = window
-        self.tr = text_region.TextRegion(0,0,100,20)
-        self.tr.set_alignment(2)
-        self.tr.set_ellipsis()
-        self.tr.set_text(self.name)
-        self.x = 0
-        self.y = 0
-
-    @property
-    def is_directory(self):
-        return stat.S_ISDIR(self.stat.st_mode)
-
-    @property
-    def is_executable(self):
-        return stat.S_IXUSR & self.stat.st_mode and not self.is_directory
-
-    @property
-    def icon(self):
-        if self.is_directory: return get_icon('folder',48)
-        if self.is_executable: return get_icon(self.name,48)
-        return get_icon('file',48) # Need file icon
-
-    def do_action(self):
-        if self.is_directory:
-            self.window.load_directory(self.path)
-            self.window.draw()
-        elif self.is_executable:
-            subprocess.Popen([self.path])
-        elif self.name.endswith('.png'):
-            subprocess.Popen(['painting.py',self.path])
-        elif self.name.endswith('.pdf') and os.path.exists('/usr/bin/pdfviewer.py'):
-            subprocess.Popen(['pdfviewer.py',self.path])
-        elif self.name.endswith('.pdf') and os.path.exists('/usr/bin/pdfviewer'):
-            subprocess.Popen(['pdfviewer',self.path])
-        # Nothing to do.
-
-    @property
-    def sortkey(self):
-        if self.is_directory: return "___" + self.name
-        else: return "zzz" + self.name
-
-
-class FileBrowserWindow(yutani.Window):
-
-    base_width = 400
-    base_height = 300
-
-    def __init__(self, decorator, path):
-        super(FileBrowserWindow, self).__init__(self.base_width + decorator.width(), self.base_height + decorator.height(), title=app_name, icon="folder", doublebuffer=True)
-        self.move(100,100)
-        self.decorator = decorator
-
-        def exit_app(action):
-            menus = [x for x in self.menus.values()]
-            for x in menus:
-                x.definitely_close()
-            self.close()
-            sys.exit(0)
-        def about_window(action):
-            AboutAppletWindow(self.decorator,f"About {app_name}","/usr/share/icons/48/folder.png",_description,"folder")
-        def help_browser(action):
-            subprocess.Popen(["help-browser.py","file_browser.trt"])
-
-        def input_path(action):
-            def input_callback(input_window):
-                text = input_window.tr.text
-                input_window.close()
-                self.load_directory(text)
-            TextInputWindow(self.decorator,"Open directory...","open",text=self.path,callback=input_callback,window=self)
-
-        menus = [
-            ("File", [
-                MenuEntryAction("Exit","exit",exit_app,None),
-            ]),
-            ("Go", [
-                MenuEntryAction("Path...","open",input_path,None),
-                MenuEntryDivider(),
-                MenuEntryAction("Home","home",self.load_directory,os.environ.get("HOME")),
-                MenuEntryAction("File System",None,self.load_directory,"/"),
-                MenuEntryAction("Up","up",self.go_up,None),
-            ]),
-            ("Help", [
-                MenuEntryAction("Contents","help",help_browser,None),
-                MenuEntryDivider(),
-                MenuEntryAction(f"About {app_name}","star",about_window,None),
-            ]),
-        ]
-
-        self.menubar = MenuBarWidget(self,menus)
-
-        self.hover_widget = None
-        self.down_button = None
-
-        self.menus = {}
-        self.hovered_menu = None
-
-        self.buf = None
-        self.load_directory(path)
-        self.hilighted = None
-
-    def go_up(self, action):
-        self.load_directory(os.path.abspath(os.path.join(self.path,'..')))
-        self.draw()
-
-    def load_directory(self, path):
-        if not os.path.exists(path):
-            DialogWindow(self.decorator,app_name,f"The path <mono>{path}</mono> could not be opened. (Not found)",window=self,icon='folder')
-            return
-        if not os.path.isdir(path):
-            DialogWindow(self.decorator,app_name,f"The path <mono>{path}</mono> could not be opened. (Not a directory)",window=self,icon='folder')
-            return
-        path = os.path.normpath(path)
-        self.path = path
-        title = "/" if path == "/" else os.path.basename(path)
-        self.set_title(f"{title} - {app_name}",'folder')
-
-        self.files = sorted([File(os.path.join(path,f), self) for f in os.listdir(path)], key=lambda x: x.sortkey)
-        self.scroll_y = 0
-        self.hilighted = None
-        self.redraw_buf()
-
-    def redraw_buf(self,icons=None):
-        if self.buf:
-            self.buf.destroy()
-        w = self.width - self.decorator.width(self)
-        files_per_row = int(w / 100)
-        self.buf = yutani.GraphicsBuffer(w,math.ceil(len(self.files)/files_per_row)*100)
-
-        surface = self.buf.get_cairo_surface()
-        ctx = cairo.Context(surface)
-
-        if icons:
-            for icon in icons:
-                ctx.rectangle(icon.x,icon.y,100,100)
-            ctx.clip()
-
-
-        ctx.rectangle(0,0,surface.get_width(),surface.get_height())
-        ctx.set_source_rgb(1,1,1)
-        ctx.fill()
-
-        offset_x = 0
-        offset_y = 0
-
-        for f in self.files:
-            if not icons or f in icons:
-                x_, y_ = ctx.user_to_device(0,0)
-                f.tr.move(offset_x,offset_y+60)
-                f.tr.draw(self.buf)
-                ctx.set_source_surface(f.icon,offset_x + 26,offset_y+10)
-                ctx.paint_with_alpha(1.0 if not f.hilight else 0.7)
-            f.x = offset_x
-            f.y = offset_y
-            offset_x += 100
-            if offset_x + 100 > surface.get_width():
-                offset_x = 0
-                offset_y += 100
-
-    def draw(self):
-        surface = self.get_cairo_surface()
-
-        WIDTH, HEIGHT = self.width - self.decorator.width(self), self.height - self.decorator.height(self)
-
-        ctx = cairo.Context(surface)
-        ctx.translate(self.decorator.left_width(self), self.decorator.top_height(self))
-        ctx.rectangle(0,0,WIDTH,HEIGHT)
-        ctx.set_source_rgb(1,1,1)
-        ctx.fill()
-
-        ctx.save()
-        ctx.translate(0,self.menubar.height)
-        text = self.buf.get_cairo_surface()
-        ctx.set_source_surface(text,0,self.scroll_y)
-        ctx.paint()
-        ctx.restore()
-
-        self.menubar.draw(ctx,0,0,WIDTH)
-
-        self.decorator.render(self)
-        self.flip()
-
-    def finish_resize(self, msg):
-        """Accept a resize."""
-        if msg.width < 120 or msg.height < 120:
-            self.resize_offer(max(msg.width,120),max(msg.height,120))
-            return
-        self.resize_accept(msg.width, msg.height)
-        self.reinit()
-        self.redraw_buf()
-        self.draw()
-        self.resize_done()
-        self.flip()
-
-    def scroll(self, amount):
-        w,h = self.width - self.decorator.width(self), self.height - self.decorator.height(self)
-        files_per_row = int(w / 100)
-        rows_total = math.ceil(len(self.files) / files_per_row)
-        rows_visible = int((h - 24) / 100)
-        rows = rows_total - rows_visible
-        if rows < 0: rows = 0
-        self.scroll_y += amount
-        if self.scroll_y > 0:
-            self.scroll_y = 0
-        if self.scroll_y < -100 * rows:
-            self.scroll_y = -100 * rows
-
-    def mouse_event(self, msg):
-        decor_event = d.handle_event(msg)
-        if decor_event == yutani.Decor.EVENT_CLOSE:
-            window.close()
-            sys.exit(0)
-        elif decor_event == yutani.Decor.EVENT_RIGHT:
-            d.show_menu(self, msg)
-        x,y = msg.new_x - self.decorator.left_width(self), msg.new_y - self.decorator.top_height(self)
-        w,h = self.width - self.decorator.width(self), self.height - self.decorator.height(self)
-
-        if x >= 0 and x < w and y >= 0 and y < self.menubar.height:
-            self.menubar.mouse_event(msg, x, y)
-            return
-
-        if x >= 0 and x < w and y >= self.menubar.height and y < h:
-            if msg.buttons & yutani.MouseButton.SCROLL_UP:
-                self.scroll(30)
-                self.draw()
-                return
-            elif msg.buttons & yutani.MouseButton.SCROLL_DOWN:
-                self.scroll(-30)
-                self.draw()
-                return
-
-            if msg.buttons & yutani.MouseButton.BUTTON_RIGHT:
-                if not self.menus:
-                    menu_entries = [
-                        MenuEntryAction("Up","up",self.go_up,None),
-                    ]
-                    menu = MenuWindow(menu_entries,(self.x+msg.new_x,self.y+msg.new_y),root=self)
-                return
-
-        if y < 0: return
-
-        offset_x = 0
-        offset_y = self.scroll_y + self.menubar.height
-
-        redraw = []
-
-        files_per_row = int(w / 100)
-        rows_total = math.ceil(len(self.files) / files_per_row)
-        skip_files = files_per_row * (int(-offset_y / 100))
-        offset_y += int(-offset_y/100) * 100
-
-        hit = False
-        for f in self.files[skip_files:]:
-            if offset_y > h: break
-            if offset_y > -100:
-                if x >= offset_x and x < offset_x + 100 and y >= offset_y and y < offset_y + 100:
-                    if not f.hilight:
-                        redraw.append(f)
-                        if self.hilighted:
-                            redraw.append(self.hilighted)
-                            self.hilighted.hilight = False
-                        f.hilight = True
-                    self.hilighted = f
-                    hit = True
-                    break
-            offset_x += 100
-            if offset_x + 100 > w:
-                offset_x = 0
-                offset_y += 100
-        if not hit:
-            if self.hilighted:
-                redraw.append(self.hilighted)
-                self.hilighted.hilight = False
-                self.hilighted = None
-
-        if self.hilighted:
-            if msg.command == yutani.MouseEvent.DOWN:
-                self.hilighted.do_action()
-
-        if redraw:
-            self.redraw_buf(redraw)
-            self.draw()
-
-    def keyboard_event(self, msg):
-        if msg.event.action != yutani.KeyAction.ACTION_DOWN:
-            return # Ignore anything that isn't a key down.
-        if msg.event.key == b"q":
-            self.close()
-            sys.exit(0)
-
-if __name__ == '__main__':
-    yutani.Yutani()
-    d = yutani.Decor()
-
-    window = FileBrowserWindow(d,os.environ.get('HOME','/') if len(sys.argv) < 2 else sys.argv[1])
-    window.draw()
-
-    yutani_mainloop.mainloop()

+ 0 - 20
util/python-demos/fswait.py

@@ -1,20 +0,0 @@
-import ctypes
-
-_lib = None
-
-if not _lib:
-    _lib = ctypes.CDLL('libc.so')
-    _lib.syscall_fswait.argtypes = [ctypes.c_int,ctypes.POINTER(ctypes.c_int)]
-    _lib.syscall_fswait.restype = ctypes.c_int
-    _lib.syscall_fswait2.argtypes = [ctypes.c_int,ctypes.POINTER(ctypes.c_int),ctypes.c_int]
-    _lib.syscall_fswait2.restype = ctypes.c_int
-
-def fswait(files,timeout=None):
-    fds = (ctypes.c_int * len(files))()
-    for i in range(len(files)):
-        fds[i] = files[i].fileno()
-    if timeout is None:
-        return _lib.syscall_fswait(len(fds),fds)
-    else:
-        return _lib.syscall_fswait2(len(fds),fds,timeout)
-

+ 0 - 508
util/python-demos/help-browser.py

<
@@ -1,508 +0,0 @@
-#!/usr/bin/python3
-"""
-Help Documentation Browser
-"""
-import os
-import sys
-import subprocess
-
-import cairo
-
-import yutani
-import toaru_fonts
-import text_region
-
-from menu_bar import MenuBarWidget, MenuEntryAction, MenuEntrySubmenu, MenuEntryDivider, MenuWindow
-from about_applet import AboutAppletWindow
-from dialog import DialogWindow
-
-import yutani_mainloop
-
-app_name = "Help Browser"
-version = "1.0.0"
-_description = f"<b>{app_name} {version}</b>\n© 2017 Kevin Lange\n\nRich text help document viewer.\n\n<color 0x0000FF>http://github.com/klange/toaruos</color>"
-
-class ScrollableText(object):
-
-    def __init__(self):
-        self.tr = None
-        self.width = 0
-        self.height_ext = 0
-        self.height_int = 0
-        self.text_buffer = None
-        self.background = (1,1,1)
-        self.pad = 10
-
-    def destroy(self):
-        if self.text_buffer:
-            self.text_buffer.destroy()
-
-    def update(self, width):
-
-        needs_resize = False
-
-        if width != self.width:
-            needs_resize = True
-            self.width = width
-
-        self.tr.resize(self.width-self.pad*2, self.tr.line_height)
-        h = self.tr.line_height * len(self.tr.lines) + self.pad*2
-        if h != self.height_int:
-            needs_resize = True
-            self.height_int = h
-
-        if self.height_int - self.pad * 2 > 30000:
-            # Shit...
-            self.height_int = 30000 - self.pad * 2
-
-        self.tr.resize(self.width-self.pad*2, self.height_int-self.pad*2)
-        self.tr.move(self.pad,self.pad)
-
-        if needs_resize or not self.text_buffer:
-            if self.text_buffer:
-                self.text_buffer.destroy()
-            self.text_buffer = yutani.GraphicsBuffer(self.width,self.height_int)
-
-        surface = self.text_buffer.get_cairo_surface()
-        ctx = cairo.Context(surface)
-        ctx.rectangle(0,0,surface.get_width(),surface.get_height())
-        ctx.set_source_rgb(*self.background)
-        ctx.fill()
-
-        self.tr.draw(self.text_buffer)
-
-    def scroll_max(self):
-        if self.height_ext > self.height_int:
-            return 0
-
-        return self.height_int - self.height_ext
-
-
-    def draw(self,ctx,x,y,height,scroll):
-        self.height_ext = height
-        surface = self.text_buffer.get_cairo_surface()
-        ctx.rectangle(x,y,self.width,height)
-        ctx.set_source_surface(surface,x,y-scroll)
-        ctx.fill()
-
-class HelpBrowserWindow(yutani.Window):
-
-    base_width = 800
-    base_height = 600
-