commit a00fb8164fc559f1dd6a3207a39ca4e349c17dee Author: Sanel Zukan Date: Wed Jul 18 18:20:04 2007 +0000 Older ede2 code based on fltk2. diff --git a/AUTHORS b/AUTHORS new file mode 100644 index 0000000..254ab50 --- /dev/null +++ b/AUTHORS @@ -0,0 +1,28 @@ +EDE 1.0 team: +Martin Pekar (original author) +Mikko Lahtenaaki (efltk author) +Dejan Lekic (fixes and improvements) +Alexey Parshin (improvements to efltk) + +Current developers: +Sanel Zukan +Vedran Ljubovic + +Translations: +Otto Nemeth +Bambang Purnomosidi D. P. +Mihail Zaripov + +Patches in 1.x series by: +Michael Sheldon +Anthony Wesley +and others! Thank you guys! :) + +We would like to thank everyone that contributed to this excellent project and to +appologize if we left anyone out. + + +EDE is based on the Fast Light Toolkit (FLTK) by +Bill Spitzak and others. + +For questions, bugs, etc. please mail ONLY current developers. diff --git a/BUGS b/BUGS new file mode 100644 index 0000000..cc5649a --- /dev/null +++ b/BUGS @@ -0,0 +1,5 @@ +Curent bug list you can find at: +http://sourceforge.net/tracker/?atid=457858&group_id=49891&func=browse + +Wow, too long link! If you are lazy to copy-paste it, visit http://ede.sourceforge.net and there should be link +for bug form. diff --git a/COPYING b/COPYING new file mode 100644 index 0000000..a43ea21 --- /dev/null +++ b/COPYING @@ -0,0 +1,339 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 675 Mass Ave, Cambridge, MA 02139, USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, 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 or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +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 give any other recipients of the Program a copy of this License +along with the Program. + +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 Program or any portion +of it, thus forming a work based on the Program, 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) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +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 Program, 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 Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) 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; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, 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 executable. However, as a +special exception, the source code 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. + +If distribution of executable or 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 counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program 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. + + 5. 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 Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program 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 to +this License. + + 7. 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 Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program 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 Program. + +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. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program 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. + + 9. The Free Software Foundation may publish revised and/or new versions +of the 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 Program +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 Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, 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 + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "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 PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. 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 PROGRAM 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 PROGRAM (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 PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + Appendix: How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. 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. + + + Copyright (C) 19yy + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program 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 General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) 19yy name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. diff --git a/ChangeLog b/ChangeLog new file mode 100644 index 0000000..bd420c2 --- /dev/null +++ b/ChangeLog @@ -0,0 +1,212 @@ +1.1 +* general +- Version number is now uniformly handled throught the docs, via configure +* eworkpanel +- Notification Area a.k.a System Tray support - patch by Elleo + fixes +for proper unloading and some KDE support +- Battery Status Monitor with support for ACPI and APM +- Quick Launch Bar (area with programmable icons) - "patch" by dzooli +- Time Format (12h vs. 24h) patch by Elleo +- Numerous layout and redraw issues with panel fixed +- Implemented maximize and restore in taskbar context menu +* edewm +- New code. Too much of things to be noted here. Maybe there should +be a separate changelog for it. +* ekeyconf +- Add support for custom shortcuts - now you can define any command you +want and assign a keyboard shortcut (patch to edewm by AW) +- Fix bug 1329447 - ekeyconf not properly grabbing keyboard (making it +impossible to use already defined shortcuts for something else) +- Some improvements to UI +* etip +- Completely new etip + + +1.0.4 +(NOTE: I would like to thank Google Summer of Code for funding my work on (among else) +EDE 1.0.4. Thanks guys! You rock :) Vedran ) +* general +- improved Russian translations +* econtrol +- re-add ekeyconf (left out by mistake) +* eiconman +- patch by Mike "elleo" - make transparent terminals work +- fix bug with icons getting on top of other windows +* einstaller +- fix bug 949024 "Install new program window smears" +- disable Install button a) when no package is selected b) after installation +* elauncher +- fix compilation on *BSD systems +* etimedate +- fix for systems with no stime() function (*BSD etc.) +* evolume +- disable compilation on systems without ALSA (e.g. non-Linux) +* eworkpanel +- show windows from all virtual desktops - to enable, edit ede.conf +and in section [Panel] add "AllDesktops=true" +- fix compilation on non-Linux systems +- CPU monitor: add support for FreeBSD (previously worked only on Linux and Solaris) +- layout fixes + + +1.0.3 +- fixed silent option for configure script +- fixed "make clean" issue +* locales: +- enable building translations +- fix several translation-related problems (by Nemeth Otto) +- add Hungarian (hu) language (by Nemeth Otto) +- fix for efinder locale installation +* eiconman: +- fix problem with dragging icons +* ecolorconf: +- fix crash and other problems with fonts +- reorganize colors +* edewm: +- disable killing eiconman/eworkpanel using hotkeys +- fixed border redraw when window itself change width or height +- fixed focus issue (again) +- fixed OpenOffice redraw problem +* emenueditor: +- disable editing subdirs +* ehelpbook: +- removed + + + +1.0.2 +* new build system +* netscape and opera replaced with mozilla everywhere +* startede: +- fix: xscreensaver wasn't started +* edewm: +- fixed artefacts on window's borders when window is resized +- dialog windows should now act as dialog windows (no resizing or + animation of resizing) +- dialogs have same titlebar height as other windows +- don't show minimize button in titlebar for dialogs +- better checks is window resizable +- several fixes into Set Size widget +- fix bug with titlebar buttons difficult to click +- configurable keyboard shortcuts +* eworkpanel: +- make applets and menu title configurable +- new panel applet - Show Desktop +- tooltips are showed without clicking on panel itself +- fixed crash with network monitor +- fix bug: panel doesn't autohide when a menu is open +- allow workspace names to be localized +- fix wrong icon filenames in main menu +- a better icon for submenus in the main menu +* taskbar applet: +- fix a bug where window will minimize instead of coming to front +- draw active taskbar button in lighter color +* eiconman: +- fix locale related problems in icon properties +* elauncher: +- new program and url launching framework +* evolume: +- add volume control applet to standard distribution +- replaced evolume icon in panel +* emenueditor: +- fix: invisible entries created with some locales +* keyboard chooser applet: +- get list of keymaps from X, instead of hardcoded +- display descriptive names +- don't show everything at once +- keep a list of recently used keyboards +* ewmconf: +- fix titlebar resizing to zero when changing theme +* ehelpbook: +- scrollbars are now visible +- removed (too much broken) +* etip: +- make etip modal +- don't always show the same tip + + +1.0.1.1 +* fixed desktop crashing when choosing wallpaper (sometimes will chrash due + bug in efltk library) +* fixed logout icon showing +* fixed einstaller icon showing +* complitelly fixed and revised control panel +* etip strings revised +* fixed desktop links in makefile + +1.0.1 +* many unstabile programs from EDE package are removed, + so now only ede-core (old name) is provide as standard distribution +* small fixes with workpanel and run-dialog on it +* compiling and installation scripts improved +* added in configure script debug options +* fixed EDE's X exit, but on some distributions not work well (SuSE 8.1) +* fixed icons showing on Control Panel, ehelpbook, etc. +* fixed screensaver showing in preview window +* small menu decorations :) +* added in main distribution EFinder, and that will become standard part +* now you can with double click start programs from run-dialog on workpanel +* and many, many stability fixes + +1.0beta +* nice EDE library complement what is in FLTK missing +* a lot of changes in ede-core (new icons and support for them thanks Edelib) +* fixed a lot of bugs +* new applications like epdfreader +* heavy changes in filemanager (basics works fine, archive viewing and extracting + works fine, archive creating ok, ftp works but still + a lot to do) +* locale support, still have to create some .po-s +* eprintconf, eprint utilities to manage printers (CUPS needed) +* huge amount of work + +0.6 +* erun separated - keybinding, cause alt+f12 use window manager +* efinder - works, basis implemented keybinding +* bugs fixes +* ede-exec script that support prefixes, see erun +* efstabedit works +* ecdplayer - cddb support(basic) +* window manager is based on icewm code +* new config utilities +* eiconmanager changes +* ehelpbook changes - it is useable with simple html, for help enought. +* configure scripts + +0.5 +* separated icon staff as eiconmanager +* new apps(still devel) - efilemanager, ehelpbook, efstabedit(init staff) +* design changes, icons - hopefully until 1.0 it will be stabilized ... +* font choosing... +* color changing somewhat buggy(not core dump of course) (It is bug in EDE or in latest fltk, something changed ... that is a question) + +0.4 +**************** +* Cd player rewrite +* I add better icons because my draw skills are not very well, still need something but what +* window manager - design changes +* eworkpanel - design changes +* all apps new use dynamic linking, so you can use also theme plugins + ~~~~~~~ +* you can use default X keyboard +* you can jpeg images on desktop (for now using xsetbg(xloadimage package)) +* dialogs changes +* programs name change + +0.3 +**************** +* panel shows tasks +* icons on desktop +* design changes +* begin from code reorganization +* color setting dialog - still todo +* icon on panel that run eqmixer, ... + +0.2 +*************** +* better color settings, still not perfect, some small things + +0.1 +*************** +* initial release + diff --git a/INSTALL b/INSTALL new file mode 100644 index 0000000..5c0c792 --- /dev/null +++ b/INSTALL @@ -0,0 +1,228 @@ +NOTE: Please see README.prealpha + +Basic Installation +================== + + These are generic installation instructions. + + The `configure' shell script attempts to guess correct values for +various system-dependent variables used during compilation. It uses +those values to create a `Makefile' in each directory of the package. +It may also create one or more `.h' files containing system-dependent +definitions. Finally, it creates a shell script `config.status' that +you can run in the future to recreate the current configuration, and a +file `config.log' containing compiler output (useful mainly for +debugging `configure'). + + It can also use an optional file (typically called `config.cache' +and enabled with `--cache-file=config.cache' or simply `-C') that saves +the results of its tests to speed up reconfiguring. (Caching is +disabled by default to prevent problems with accidental use of stale +cache files.) + + If you need to do unusual things to compile the package, please try +to figure out how `configure' could check whether to do them, and mail +diffs or instructions to the address given in the `README' so they can +be considered for the next release. If you are using the cache, and at +some point `config.cache' contains results you don't want to keep, you +may remove or edit it. + + The file `configure.ac' (or `configure.in') is used to create +`configure' by a program called `autoconf'. You only need +`configure.ac' if you want to change it or regenerate `configure' using +a newer version of `autoconf'. + +The simplest way to compile this package is: + + 1. `cd' to the directory containing the package's source code and type + `./configure' to configure the package for your system. If you're + using `csh' on an old version of System V, you might need to type + `sh ./configure' instead to prevent `csh' from trying to execute + `configure' itself. + + Running `configure' takes awhile. While running, it prints some + messages telling which features it is checking for. + + 2. Type `make' to compile the package. + + 3. Optionally, type `make check' to run any self-tests that come with + the package. + + 4. Type `make install' to install the programs and any data files and + documentation. + + 5. You can remove the program binaries and object files from the + source code directory by typing `make clean'. To also remove the + files that `configure' created (so you can compile the package for + a different kind of computer), type `make distclean'. There is + also a `make maintainer-clean' target, but that is intended mainly + for the package's developers. If you use it, you may have to get + all sorts of other programs in order to regenerate files that came + with the distribution. + +Compilers and Options +===================== + + Some systems require unusual options for compilation or linking that +the `configure' script does not know about. Run `./configure --help' +for details on some of the pertinent environment variables. + + You can give `configure' initial values for variables by setting +them in the environment. You can do that on the command line like this: + + ./configure CC=c89 CFLAGS=-O2 LIBS=-lposix + + *Note Environment Variables::, for more details. + +Compiling For Multiple Architectures +==================================== + + You can compile the package for more than one kind of computer at the +same time, by placing the object files for each architecture in their +own directory. To do this, you must use a version of `make' that +supports the `VPATH' variable, such as GNU `make'. `cd' to the +directory where you want the object files and executables to go and run +the `configure' script. `configure' automatically checks for the +source code in the directory that `configure' is in and in `..'. + + If you have to use a `make' that does not support the `VPATH' +variable, you have to compile the package for one architecture at a time +in the source code directory. After you have installed the package for +one architecture, use `make distclean' before reconfiguring for another +architecture. + +Installation Names +================== + + By default, `make install' will install the package's files in +`/usr/local/bin', `/usr/local/man', etc. You can specify an +installation prefix other than `/usr/local' by giving `configure' the +option `--prefix=PATH'. + + You can specify separate installation prefixes for +architecture-specific files and architecture-independent files. If you +give `configure' the option `--exec-prefix=PATH', the package will use +PATH as the prefix for installing programs and libraries. +Documentation and other data files will still use the regular prefix. + + In addition, if you use an unusual directory layout you can give +options like `--bindir=PATH' to specify different values for particular +kinds of files. Run `configure --help' for a list of the directories +you can set and what kinds of files go in them. + + If the package supports it, you can cause programs to be installed +with an extra prefix or suffix on their names by giving `configure' the +option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. + +Optional Features +================= + + Some packages pay attention to `--enable-FEATURE' options to +`configure', where FEATURE indicates an optional part of the package. +They may also pay attention to `--with-PACKAGE' options, where PACKAGE +is something like `gnu-as' or `x' (for the X Window System). The +`README' should mention any `--enable-' and `--with-' options that the +package recognizes. + + For packages that use the X Window System, `configure' can usually +find the X include and library files automatically, but if it doesn't, +you can use the `configure' options `--x-includes=DIR' and +`--x-libraries=DIR' to specify their locations. + +Specifying the System Type +========================== + + There may be some features `configure' cannot figure out +automatically, but needs to determine by the type of host the package +will run on. Usually `configure' can figure that out, but if it prints +a message saying it cannot guess the host type, give it the +`--build=TYPE' option. TYPE can either be a short name for the system +type, such as `sun4', or a canonical name which has the form: + + CPU-COMPANY-SYSTEM + +where SYSTEM can have one of these forms: + + OS + KERNEL-OS + + See the file `config.sub' for the possible values of each field. If +`config.sub' isn't included in this package, then this package doesn't +need to know the host type. + + If you are _building_ compiler tools for cross-compiling, you should +use the `--target=TYPE' option to select the type of system they will +produce code for. + + If you want to _use_ a cross compiler, that generates code for a +platform different from the build platform, you should specify the host +platform (i.e., that on which the generated programs will eventually be +run) with `--host=TYPE'. In this case, you should also specify the +build platform with `--build=TYPE', because, in this case, it may not +be possible to guess the build platform (it sometimes involves +compiling and running simple test programs, and this can't be done if +the compiler is a cross compiler). + +Sharing Defaults +================ + + If you want to set default values for `configure' scripts to share, +you can create a site shell script called `config.site' that gives +default values for variables like `CC', `cache_file', and `prefix'. +`configure' looks for `PREFIX/share/config.site' if it exists, then +`PREFIX/etc/config.site' if it exists. Or, you can set the +`CONFIG_SITE' environment variable to the location of the site script. +A warning: not all `configure' scripts look for a site script. + +Environment Variables +===================== + + Variables not defined in a site shell script can be set in the +environment passed to configure. However, some packages may run +configure again during the build, and the customized values of these +variables may be lost. In order to avoid this problem, you should set +them in the `configure' command line, using `VAR=value'. For example: + + ./configure CC=/usr/local2/bin/gcc + +will cause the specified gcc to be used as the C compiler (unless it is +overridden in the site shell script). + +`configure' Invocation +====================== + + `configure' recognizes the following options to control how it +operates. + +`--help' +`-h' + Print a summary of the options to `configure', and exit. + +`--version' +`-V' + Print the version of Autoconf used to generate the `configure' + script, and exit. + +`--cache-file=FILE' + Enable the cache: use and save the results of the tests in FILE, + traditionally `config.cache'. FILE defaults to `/dev/null' to + disable caching. + +`--config-cache' +`-C' + Alias for `--cache-file=config.cache'. + +`--quiet' +`--silent' +`-q' + Do not print messages saying which checks are being made. To + suppress all normal output, redirect it to `/dev/null' (any error + messages will still be shown). + +`--srcdir=DIR' + Look for the package's source code in directory DIR. Usually + `configure' can determine that directory automatically. + +`configure' also accepts some other, not widely useful, options. Run +`configure --help' for more details. + diff --git a/Jamfile b/Jamfile new file mode 100644 index 0000000..51a77dc --- /dev/null +++ b/Jamfile @@ -0,0 +1,39 @@ +# +# $Id$ +# +# Part of Equinox Desktop Environment (EDE). +# Copyright (c) 2000-2007 EDE Authors. +# +# This program is licenced under terms of the +# GNU General Public Licence version 2 or newer. +# See COPYING for details. + +SubDir TOP ; + +# We must first build edelib +#SubInclude TOP $(EDELIBDIR) ; + +# Then the rest +SubInclude TOP eworkpanel ; +#SubInclude TOP edialog ; +#SubInclude TOP eimage ; +#SubInclude TOP ecolorconf ; +#SubInclude TOP efinder ; +#SubInclude TOP econtrol ; +#SubInclude TOP ecalc ; +#SubInclude TOP edisplayconf ; +#SubInclude TOP eiconsconf ; +#SubInclude TOP einstaller ; +#SubInclude TOP ekeyconf ; +#SubInclude TOP elauncher ; +#SubInclude TOP emenueditor ; +#SubInclude TOP epanelconf ; +#SubInclude TOP etimedate ; +#SubInclude TOP etip ; +#SubInclude TOP evolume ; +#SubInclude TOP ewmconf ; + +# These can't be compiled for now + +#SubInclude TOP efiler ; +#SubInclude TOP eiconman ; diff --git a/Jamrules b/Jamrules new file mode 100644 index 0000000..8f9ec66 --- /dev/null +++ b/Jamrules @@ -0,0 +1,125 @@ +# +# $Id$ +# +# Part of Equinox Desktop Environment (EDE). +# Copyright (c) 2000-2007 EDE Authors. +# +# This program is licenced under terms of the +# GNU General Public Licence version 2 or newer. +# See COPYING for details. + +XGETTEXT ?= xgettext ; +MSGFMT ?= msgfmt ; + +FLAGS ?= -Wall -g3 -D_DEBUG -I$(TOP) ; +STDLIB ?= -lstdc++ ; + +FLTKLIB ?= -L/usr/local/lib -lfltk2 ; +FLTKIMAGES ?= -L/usr/local/lib -lfltk2_images ; + +# backward +EFLTKLIB ?= -L/usr/local/lib -lefltk ; +EFLTKIMAGES ?= -L/usr/local/lib -lefltk_images ; + +X11LIBS ?= -L/usr/X11R6/lib -lX11 -lXi -lXinerama -lXft -lpthread -lm -lXext ; +IMGLIBS ?= -lpng -ljpeg -lz ; + +EDELIB_NAME = libedelib ; +EDELIB = -ledelib ; +EDELIBDIR = edelib2 ; + +# this is used by jam +CCFLAGS = $(FLAGS) ; +C++FLAGS = $(FLAGS) ; +OPTIM = ; + +# at least we differ for FDirName +rule FFileName +{ + return [ FDirName $(<) ] ; +} + +rule MakeLibrary +{ + Library $(<) : $(>) ; +} + +# internal used by MakeProgram and MakeEfltkProgram +rule InternalMakeProgram +{ + local eldir ; + local target ; + + eldir = [ FDirName $(TOP) $(EDELIBDIR) ] ; + + # this will make happy original jam and ftjam + # since constructing it's grist from source file + # it will make it unique and prevent colision same directory name + target = $(1:G=$(SOURCE_GRIST)) ; + + # check if we got additional flags + if $(3) + { + SUBDIRC++FLAGS += $(3) ; + SUBDIRCCFLAGS += $(3) ; + } + + LINKLIBS on $(target) = -L$(eldir) $(EDELIB) $(4) $(IMGLIBS) $(5) $(X11LIBS) $(6) $(STDLIB) ; + Main $(target) : $(2) ; +} + +# This should be used to build ede2 apps. +# MakeProgram : : : ; +rule MakeProgram +{ + InternalMakeProgram $(1) : $(2) : $(3) : $(FLTKIMAGES) : $(FLTKLIB) : $(4) ; +} + +# This is for efltk (aka. previous code) compilation +# so it can be tested with whole package. +# It should be used only until efltk programs are translited +# to fltk. +# MakeEfltkProgram : : ; +rule MakeEfltkProgram +{ + InternalMakeProgram $(1) : $(2) : $(3) : $(EFLTKIMAGES) : $(EFLTKLIB) ; +} + +# ExtractStrings : ; +rule ExtractStrings +{ + local strfile = "messages.pot" ; + local path = $(SEARCH_SOURCE) ; + local locale_dir = [ FDirName $(path) $(<) ] ; + local target = [ FFileName $(locale_dir) $(strfile) ] ; + local source = $(>:R=$(path)) ; + + if $(XGETTEXT) + { + MkDir $(locale_dir) ; + for i in $(source) + { + Depends $(target) : $(i) ; + } + + XGettext $(target) : $(source) ; + Depends $(target) : $(locale_dir) ; + Depends all : $(target) ; + Clean clean : $(target) ; + } +} + +actions XGettext +{ + $(XGETTEXT) -k'_' $(2) -o $(1) ; +} + +# MakeTranslation : file1.po file2.po... ; +# TODO: +rule MakeTranslation +{ +} + +actions MakeTranslation1 +{ +} diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..0e21e57 --- /dev/null +++ b/Makefile @@ -0,0 +1,103 @@ +# +# $Id$ +# +# Part of Equinox Desktop Environment (EDE). +# Copyright (c) 2000-2006 EDE Authors. +# +# This program is licenced under terms of the +# GNU General Public Licence version 2 or newer. +# See COPYING for details. + +# main file for making + +include makeinclude + +DIRS = common\ + ecolorconf\ + econtrol\ + efinder\ + eiconman\ + eiconsconf\ + einstaller\ + ekeyconf\ + elauncher\ + emenueditor\ + epanelconf\ + erun\ + esvrconf\ + etimedate\ + etip\ + ewmconf\ + eworkpanel\ + edisplayconf\ + edewm\ + datas\ + datas/programs-links\ + datas/desktop-links\ + datas/icons-16\ + datas/icons-48\ + datas/schemes\ + docs/ede $(EVOLUME) + +all: makeinclude + for dir in $(DIRS); do\ + echo "Going to $$dir...";\ + (cd $$dir; $(MAKE) $(MFLAGS)) || exit;\ + done + @@echo "Now please run 'make install' as root" + +# each submakefile should implement install and clean + +.PHONY: clean + +install: makeinclude + for dir in $(DIRS); do\ + echo "Installing from $$dir...";\ + (cd $$dir; $(MAKE) $(MFLAGS) install) || exit;\ + done + +uninstall: makeinclude + for dir in $(DIRS); do\ + echo "Uninstalling $$dir...";\ + (cd $$dir; $(MAKE) $(MFLAGS) uninstall) || exit;\ + done + +clean: makeinclude + for dir in $(DIRS); do\ + echo "Cleaning $$dir...";\ + (cd $$dir; $(MAKE) $(MFLAGS) clean) || exit;\ + done + +depend: makeinclude + for dir in $(DIRS); do\ + echo "Creating dependencies in $$dir...";\ + (cd $$dir; $(MAKEDEPEND) -- $(CXXFLAGS) *.cpp) || exit;\ + done + + +# for maintainers +define make-archive + NAME=`awk '/PACKAGE_TARNAME/ {print $$3}' $1 | sed -e 's/\"//g'`; \ + VERS=`awk '/PACKAGE_VERSION/ {print $$3}' $1 | sed -e 's/\"//g'`; \ + ARCH=$$NAME-$$VERS.tar.bz2; \ + if [ -e $$ARCH ]; then \ + echo "Removing previous package..."; \ + rm $$ARCH; \ + fi; \ + tar -cjpvf $$ARCH --exclude $$ARCH . +endef + +# cvs made some files executable +define fix-chmod + echo "Fixing permissions..."; \ + find . -name "*.*" -exec chmod -x {} \;; \ + chmod +x l10n-prepare.pl; \ + chmod -x AUTHORS BUGS COPYING ChangeLog INSTALL NEWS +endef + +archive: clean + rm -Rf `find . -name "CVS"` + autoconf + rm -Rf autom4te.cache + $(call fix-chmod) + $(call make-archive, edeconf.h) diff --git a/NEWS b/NEWS new file mode 100644 index 0000000..c7ab92a --- /dev/null +++ b/NEWS @@ -0,0 +1 @@ +See ChangeLog \ No newline at end of file diff --git a/README.alpha b/README.alpha new file mode 100644 index 0000000..18bf349 --- /dev/null +++ b/README.alpha @@ -0,0 +1,101 @@ +README for EDE 2.0 pre-alpha +============================ + +($Id$) + +Please read this document before using or contributing to EDE 2.0 source code +before or during 2.0alpha release. + + +Build requirements +------------------ + +EDE 2.0 is using fltk2 toolkit which is not officially released yet. Lately +fltk2 has been pretty stable, so you should be able to use any reasonably +fresh SVN snapshot from www.fltk.org. Nevertheless, we will (soon) keep our own "fork" +called fltk-copy which is basically the last SVN snapshot that EDE is known +to work with. If there are any patches required for proper EDE functioning, +you should find them in fltk-copy tree. Further instructions will be in +fltk-copy/README.ede + +Make sure you have efltk installed, because some packages still requires it. + +Also you will need Jam utility. Jam is make replacement and removes a lot of it's +limitations. Current source can be built either via jam or make, but note that make +builds will be soon removed. + +Jam can be downloaded from our repository. + + +Compiling +--------- + +At the moment, certain modules in EDE do not compile! In order to build and install +EDE do the following: + +1. run ./prepare + +2. (old method, soon will be removed) + ./configure [OPTIONS] (we suggest using --enable-debug) + cd edelib2; make; cd .. + + Then go into directories of individual modules and compile them. Type + cd $MODULE; make; make install; cd .. + +3. (new method, default) + ./configure [OPTIONS] (we suggest using --enable-debug) + jam + + Installation is not finished yet. + + +Stuff that doesn't compile +-------------------------- + +- edewm +- eiconman +- eworkpanel +We are in the process of rewriting these modules from scratch. Please use edewm, +eiconman and eworkpanel from EDE 1.x (it should work without major problems). + +- efinder +It will be ported to fltk2 as soon as we finish efiler (see below) cause we +would like to use same widgets for displaying file list. + +- emenueditor +It will either be completely rewritten or removed, because EDE 2 will use XDG menus +(FreeDesktop.org). + + +New modules in EDE 2.0 +---------------------- + +- edialog +Command line utility for displaying dialogs (useful for scripting). It is very +UNFINISHED. + +- efiler +Small file manager. Currently you can only view files but not copy/rename/delete +etc. + +- eimage +Small image viewer. It should be fully usable but still some bugs present. + + +Contributors wanted +------------------- + +We would very appreciate help from contributors willing to take any of following +tasks: + + - Complete edialog and become its maintainer + - Port efinder to fltk2/edelib2 and become its maintainer + - Write new enotepad using editor from fltk/test (I believe this is easier than +porting old enotepad to fltk2/edelib2) and become its maintainer + - Propose new designs for econtrol and eworkpanel (that are realistic to implement +with fltk, ofcourse :) + - Find any old ede application, port to fltk2/edelib2 and become its maintainer + - Find useful fltk2 apps on www.fltk.org and see if they can be ede-ified + +Also, EDE code is sparkled with comments starting with TODO and FIXME - please see +what of that you can do. EDE coding standards and EDE HIG documents are being prepared. diff --git a/README.patches b/README.patches new file mode 100644 index 0000000..8ff9305 --- /dev/null +++ b/README.patches @@ -0,0 +1,34 @@ +Quick and dirty document for patchers +------------------------------------- + +Before sending any type of code patches, make sure to +check a few things: + +Tabs +---- +Althought we currently does not require specific coding style (aren't we liberate :) +we are very sensitive on tabs. So _use_ them. This will enable not only to us, but +to others, easier switching between screen resolutions etc. (many modern editors allow +setting tab sizes). Also it is much easier to convert tabs to spaces, than otherwise +(if we change opinion to tabs and switch to spaces only). Boring know, but keep it in mind. + +eFLTK/FLTK knowledge +-------------------- +This is one of the most important things. Make sure you have at least basic understainding of +eFLTK/FLTK, especially for draw() and handle(int) functions. They are very sensitive which +means every move/resize/etc. will call these functions (aka. do not use heavy calculations +inside, reading/writing files etc.) + +Memory +------ +What you allocate, make sure to deallocate too. Some things should not be deallocated +explicitly like some eFLTK/FLTK widgets, but for this, check above. + + +After you read above, applied on code, and decided to send us, please test your code before +sending. Test on everything. Test on power loss, bad food, cold coffee... And, of course +test on speed. If it looks nice, but slow as hell, big as big's mamas house, recosider to +remove these glitches, or if that is not possible, note us like "I want that feature, +have a patch, but it is slooooowww". We will came up with something. + +End, for now... diff --git a/build/Translation.jam b/build/Translation.jam new file mode 100644 index 0000000..60a9384 --- /dev/null +++ b/build/Translation.jam @@ -0,0 +1,62 @@ +# +# $Id$ +# +# Part of Equinox Desktop Environment (EDE). +# Copyright (c) 2000-2007 EDE Authors. +# +# This program is licensed under terms of the +# GNU General Public License version 2 or newer. +# See COPYING for details. + +DEFAULT_POT = "messages.pot" ; + +# ExtractStrings [dir-where] : [source] : [output-file] ; +# Scans [source] file(s) for translatable strings (usually marked as _("foo")) +# and store result in [output-file] in [dir-where] directory. If [dir-where] +# does not exists, it will be created. +# [output-file] can be omitted; in that case DEFAULT_POT will be used. +rule ExtractStrings +{ + local strfile ; + if $(3) { + strfile = $(3) ; + } else { + strfile = $(DEFAULT_POT) ; + } + + local path = $(SEARCH_SOURCE) ; + local locale_dir = [ FDirName $(path) $(<) ] ; + local target = [ FFileName $(locale_dir) $(strfile) ] ; + local source = $(>:R=$(path)) ; + + if $(XGETTEXT) { + MkDir $(locale_dir) ; + for i in $(source) { + Depends $(target) : $(i) ; + } + + XGettext $(target) : $(source) ; + Depends $(target) : $(locale_dir) ; + Depends translation : $(target) ; + Depends all : $(target) ; + Clean clean : $(target) ; + } +} + +actions XGettext +{ + $(XGETTEXT) -k'_' $(2) -o $(1) ; +} + +# TODO: +# MakeTranslation : file1.po file2.po... ; +rule MakeTranslation +{ +} + +actions MakeTranslation1 +{ +} + +NotFile translation ; +Always translation ; diff --git a/configure.in b/configure.in new file mode 100644 index 0000000..072ab2a --- /dev/null +++ b/configure.in @@ -0,0 +1,111 @@ +dnl +dnl $Id$ +dnl +dnl Part of Equinox Desktop Environment (EDE). +dnl Copyright (c) 2000-2007 EDE Authors. +dnl +dnl This program is licenced under terms of the +dnl GNU General Public Licence version 2 or newer. +dnl See COPYING for details. + +dnl If edeconf.h.in missing, parse this file with autoheader +dnl or run './prepare'. + +AC_PREREQ(2.16) +AC_INIT(EDE, 2.0.0 alpha, [karijes@users.sourceforge.net]) +AC_DEFINE(VERSION, 200, [Short version number]) + +dnl dummy real file from source, so older autoconf versions +dnl does not require creating EDE file in source root +AC_CONFIG_SRCDIR(COPYING) + +AC_CONFIG_HEADER(edeconf.h:edeconf.h.in) + +dnl $PACKAGE_VERSION is filled from AC_INIT +EDE_VERSION=$PACKAGE_VERSION + +if test "$prefix" = NONE; then + INSTALL_DIR="/usr/local" +else + INSTALL_DIR="$prefix" +fi +AC_DEFINE_UNQUOTED(PREFIX, "$INSTALL_DIR", [Default installation place. Overwrite if you like.]) + +SOURCE_DIR="`pwd`" +OPTIMFLAGS="-O2" +DEBUGFLAGS="" + +AC_PROG_CXX +AC_PROG_CPP +AC_PATH_PROG(MSGFMT, msgfmt) +AC_PATH_PROG(XGETTEXT, xgettext) +AC_PATH_PROG(DOXYGEN, doxygen) +dnl sh/gdb is used by elauncher +AC_PATH_PROG(GDB, gdb) +AC_PATH_PROG(SH, sh) + +EDE_PROG_JAM() + +dnl basic headers +AC_HEADER_STDC +dnl TODO: it would be nice if we could pass parameter +dnl for custom STL implementation (via STDLIB var), and +dnl test be linked against it +EDE_CHECK_STL() + +AC_CHECK_HEADER(dirent.h, AC_DEFINE(HAVE_DIRENT_H, 1, [Define to 1 if you have dirent.h])) +AC_CHECK_HEADER(ndir.h, AC_DEFINE(HAVE_NDIR_H, 1, [Define to 1 if you have ndir.h])) +AC_CHECK_HEADER(sys/dir.h, AC_DEFINE(HAVE_SYS_DIR_H, 1, [Define to 1 if you have sys/dir.h])) +AC_CHECK_HEADER(sys/ndir.h, AC_DEFINE(HAVE_SYS_NDIR_H, 1, [Define to 1 if you have sys/ndir.h])) + +dnl functions and headers used by pty.h +AC_CHECK_FUNCS(grantpt, AC_DEFINE(HAVE_GRANTPT, 1, [Define to 1 if you have grantpt() in stdlib.h])) +AC_CHECK_FUNCS(ptsname, AC_DEFINE(HAVE_PTSNAME, 1, [Define to 1 if you have ptsname() in stdlib.h])) +AC_CHECK_FUNCS(unlockpt, AC_DEFINE(HAVE_PTSNAME, 1, [Define to 1 if you have unlockpt() in stdlib.h])) +AC_CHECK_FUNCS(_getpty, AC_DEFINE(HAVE__GETPTY, 1, [Define to 1 if you have _getpty()])) +AC_CHECK_HEADER(pty.h, AC_DEFINE(HAVE_PTY_H, 1, [Define to 1 if you have pty.h])) +AC_CHECK_HEADER(libutil.h, AC_DEFINE(HAVE_LIBUTIL_H, 1, [Define to 1 if you have libutil.h])) +AC_CHECK_HEADER(util.h, AC_DEFINE(HAVE_UTIL_H, 1, [Define to 1 if you have util.h])) + +EDE_CHECK_TIME_FUNCS() + +EDE_CHECK_X11() + +dnl --enable-debug and --enable-profile options +EDE_DEVELOPMENT() + +dnl --enable-shape option +EDE_X11_SHAPE() + +dnl set FLTKFLAGS, FLTKLIBS +EDE_CHECK_FLTK() +dnl set EFLTKFLAGS, EFLTKLIBS +EDE_CHECK_EFLTK() + +EDE_CHECK_LIBMAGIC() + +dnl sound stuff +EDE_CHECK_ALSA() +dnl --enable-sound option +dnl set SOUNDFLAGS, SOUNDLIBS +EDE_SOUND() + +EDE_INIT_JAM() +AC_SUBST(SOURCE_DIR) +AC_SUBST(OPTIMFLAGS) +AC_SUBST(DEBUGFLAGS) +AC_SUBST(FLTKFLAGS) +AC_SUBST(FLTKLIBS) +AC_SUBST(EFLTKFLAGS) +AC_SUBST(EFLTKLIBS) +AC_SUBST(SOUNDFLAGS) +AC_SUBST(SOUNDLIBS) +AC_SUBST(MAKE_EVOLUME) +AC_SUBST(INSTALL_DIR) +AC_SUBST(XGETTEXT) +AC_SUBST(MSGFMT) +AC_SUBST(DOXYGEN) + +AC_OUTPUT([ + Jamconfig +]) diff --git a/datas/Makefile b/datas/Makefile new file mode 100644 index 0000000..dd88b1b --- /dev/null +++ b/datas/Makefile @@ -0,0 +1,20 @@ +include ../makeinclude + +Data = ede.conf wmanager.conf mime.conf efltk.conf mimetypes.conf +DIR = $(datadir)/ede/.ede + +install: + $(MKINSTALLDIRS) $(DIR) + $(INSTALL_DATA) ede.conf $(DIR) + $(INSTALL_DATA) wmanager.conf $(DIR) + $(INSTALL_DATA) mime.conf $(DIR) + $(INSTALL_DATA) efltk.conf $(DIR) + $(INSTALL_DATA) mimetypes.conf $(DIR) + $(MKINSTALLDIRS) $(bindir) + $(INSTALL_PROGRAM) startede $(bindir) + +uninstall: + $(RM) -r $(DIR) + $(RM) $(bindir)/startede + +clean: diff --git a/datas/desktop-links/Internet.desktop b/datas/desktop-links/Internet.desktop new file mode 100644 index 0000000..0dd9b35 --- /dev/null +++ b/datas/desktop-links/Internet.desktop @@ -0,0 +1,10 @@ +# EFLTK Configuration - Version 2,003000 + +[Desktop Entry] + Icon=kppp.png + X=20 + Y=210 + Name=Connect to Internet + Exec=epppdialer + Name[sk]=Pripojenie do Internetu + diff --git a/datas/desktop-links/Makefile b/datas/desktop-links/Makefile new file mode 100644 index 0000000..be8b908 --- /dev/null +++ b/datas/desktop-links/Makefile @@ -0,0 +1,15 @@ +include ../../makeinclude + +desktopdir = $(datadir)/ede/.ede/desktop + +DESKTOPLINKS = \ + Terminal.desktop + +install: + $(MKINSTALLDIRS) $(desktopdir) + $(INSTALL_DATA) $(DESKTOPLINKS) $(desktopdir) + +uninstall: + $(RM) -r $(desktopdir) + +clean: diff --git a/datas/desktop-links/Terminal.desktop b/datas/desktop-links/Terminal.desktop new file mode 100644 index 0000000..1aee626 --- /dev/null +++ b/datas/desktop-links/Terminal.desktop @@ -0,0 +1,10 @@ +# EFLTK Configuration - Version 2,003000 + +[Desktop Entry] + Icon=konsole.png + X=20 + Y=130 + Name=Terminal + Exec=xterm + Name[sk]=Terminál + diff --git a/datas/ede.conf b/datas/ede.conf new file mode 100644 index 0000000..4858c16 --- /dev/null +++ b/datas/ede.conf @@ -0,0 +1,63 @@ +# EFLTK Configuration - Version 2,000300 + +[Keyboard] + Layout=en + Repeat=1 + ClickVolume=50 + RecentKeyboards=us + +[IconManager] + Label Fontsize=10 + Label Maxwidth=55 + Gridspacing=10 + Label Foreground=7 + Label Background=2037550592 + OneClickExec=0 + +[Panel] + Volume Control=evolume + Time and date=etimedate + AutoHide=0 + Workspaces=true + RunBrowser=true + CPUMonitor=true + SoundMixer=true + VariableWidthTaskbar=false + ShowUsernameOnMenu=true + ShowDesktop=true + +[Desktop] + Wallpaper= + Color=RGB(76,108,178) + Opacity=205 + Use=0 + +[Workspaces] + Count=4 + (null)=9@9 + +[Web] + Browser=mozilla + +[Terminal] + Terminal=xterm + +[System] + UseSudo=false + +[Mouse] + Accel=2 + Thresh=4 + +[Bell] + Volume=50 + Pitch=440 + Duration=200 + +[Screen] + Delay=15 + Pattern=2 + CheckBlank=1 + RadioBlank=1 + RadioPattern=0 + diff --git a/datas/efltk.conf b/datas/efltk.conf new file mode 100644 index 0000000..afb3faf --- /dev/null +++ b/datas/efltk.conf @@ -0,0 +1,23 @@ +# EFLTK Configuration - Version 2,000300 + + +[Images] + State Effects=1 + +[Menus] + Effects=0 + Delay=0 + Subwindow Effect=0 + Effect Type=0 + Speed=1 + +[Tooltips] + Effects=0 + Effect Type=0 + Enabled=1 + Delay=1 + +[MDI] + Animate=0 + Opaque=0 + diff --git a/datas/icons-16/3floppy_mount.png b/datas/icons-16/3floppy_mount.png new file mode 100644 index 0000000..e2ecbe6 Binary files /dev/null and b/datas/icons-16/3floppy_mount.png differ diff --git a/datas/icons-16/3floppy_unmount.png b/datas/icons-16/3floppy_unmount.png new file mode 100644 index 0000000..14d339d Binary files /dev/null and b/datas/icons-16/3floppy_unmount.png differ diff --git a/datas/icons-16/Makefile b/datas/icons-16/Makefile new file mode 100644 index 0000000..5af6f92 --- /dev/null +++ b/datas/icons-16/Makefile @@ -0,0 +1,223 @@ +include ../../makeinclude + +iconsdir = $(datadir)/ede/icons + +icons16dir = $(iconsdir)/16x16 + +ICONS16 = \ + about.png \ + access.png \ + access2.png \ + applix.png \ + archos_mount.png \ + archos_unmount.png \ + back.png \ + back2.png \ + back3.png \ + binary.png \ + blockdevice.png \ + bookmark_add.png \ + bookmark_add2.png \ + bookmark_folder.png \ + bookmark_folder2.png \ + bookmark.png \ + bookmark_toolbar.png \ + bookmark_toolbar2.png \ + bookmark2.png \ + cancel.png \ + cd_mount.png \ + cd-record.png \ + cdrom_mount.png \ + cdrom_unmount.png \ + cdtrack.png \ + cd_unmount.png \ + colorset.png \ + configure.png \ + core.png \ + deb.png \ + decrypted.png \ + desktop.png \ + document.png \ + down.png \ + econtrol.png \ + editcopy.png \ + editcut.png \ + editdelete.png \ + editpaste.png \ + edit.png \ + editshred.png \ + edittrash.png \ + efinder.png \ + ehelpbook.png \ + emenueditor.png \ + empty_ascii.png \ + empty2.png \ + encrypted.png \ + exec.png \ + exit.png \ + file_broken.png \ + fileclose.png \ + filefind.png \ + file_locked.png \ + filenew.png \ + fileopen.png \ + fileprint.png \ + filesave.png \ + find.png \ + folder_green.png \ + folder_home.png \ + folder_image.png \ + folder_mail.png \ + folder_man.png \ + folder_new.png \ + folder_open.png \ + folder_orange.png \ + folder.png \ + folder_red.png \ + folder_sound.png \ + folder_tar.png \ + folder_video.png \ + folder_violet.png \ + folder_yellow.png \ + font_bitmap.png \ + font.png \ + font_truetype.png \ + font_type1.png \ + forward.png \ + forward2.png \ + forward3.png \ + frameprint.png \ + gimp.png \ + gimp2.png \ + gnome-apps.png \ + gohome.png \ + go.png \ + go2.png \ + history_clear.png \ + history.png \ + html.png \ + chardevice.png \ + ica.png \ + image.png \ + info.png \ + java_src.png \ + kcontrol.png \ + kde1.png \ + kde2.png \ + kde3.png \ + kde4.png \ + kde5.png \ + kde6.png \ + kdisknav.png \ + key_enter.png \ + kfm_home.png \ + khelpcenter.png \ + klipper.png \ + klpq.png \ + kmail.png \ + kmultiple.png \ + konqueror.png \ + konqueror2.png \ + konqueror3.png \ + konsole.png \ + konsole2.png \ + konsole3.png \ + kvirc.png \ + licq.png \ + lime.png \ + linuxconf.png \ + lockoverlay.png \ + lock.png \ + log.png \ + logout.png \ + mail_generic.png \ + make.png \ + midi.png \ + mime_empty.png \ + misc.png \ + moc_src.png \ + mozilla-mail.png \ + mozilla-m.png \ + mozilla.png \ + nedit.png \ + netscape.png \ + network.png \ + noatun.png \ + noatun2.png \ + no.png \ + openterm.png \ + opera.png \ + package_application.png \ + package_multimedia.png \ + pdf-document.png \ + quicktime.png \ + real_doc.png \ + reload.png \ + remove.png \ + resource.png \ + rpm.png \ + run.png \ + scanner.png \ + services.png \ + shell1.png \ + socket.png \ + soffice.png \ + sound.png \ + source.png \ + spreadsheet.png \ + stop.png \ + synaptic.png \ + tar.png \ + tex.png \ + tgz.png \ + trashcan_empty.png \ + trashcan_full.png \ + trash.png \ + tux.png \ + txt.png \ + unknown.png \ + unlock.png \ + up.png \ + video.png \ + view_bottom.png \ + view_detailed.png \ + view_choose.png \ + view_icon.png \ + view_left_right.png \ + viewmag.png \ + viewmag-.png \ + viewmag+.png \ + view_multicolumn.png \ + view_remove.png \ + view_right.png \ + view_sidetree.png \ + view_text.png \ + view_top_bottom.png \ + view_tree.png \ + vnc.png \ + widget_doc.png \ + window_fullscreen.png \ + window_list.png \ + window_new.png \ + window_nofullscreen.png \ + wizard.png \ + www.png \ + xmms_classic.png \ + xmms.png \ + zip_mount.png \ + zip.png \ + zip_unmount.png \ + 3floppy_mount.png \ + 3floppy_unmount.png + +install: + $(MKINSTALLDIRS) $(icons16dir);\ + for f in $(ICONS16); do\ + echo "Installing $(icons16dir)/$$f";\ + $(INSTALL_DATA) $$f $(icons16dir);\ + done + +uninstall: + $(RM) -r $(icons16dir) + +clean: diff --git a/datas/icons-16/about.png b/datas/icons-16/about.png new file mode 100644 index 0000000..3a419c5 Binary files /dev/null and b/datas/icons-16/about.png differ diff --git a/datas/icons-16/access.png b/datas/icons-16/access.png new file mode 100644 index 0000000..93d1e61 Binary files /dev/null and b/datas/icons-16/access.png differ diff --git a/datas/icons-16/access2.png b/datas/icons-16/access2.png new file mode 100644 index 0000000..ebdc3b0 Binary files /dev/null and b/datas/icons-16/access2.png differ diff --git a/datas/icons-16/applix.png b/datas/icons-16/applix.png new file mode 100644 index 0000000..d102eee Binary files /dev/null and b/datas/icons-16/applix.png differ diff --git a/datas/icons-16/archos_mount.png b/datas/icons-16/archos_mount.png new file mode 100644 index 0000000..348e797 Binary files /dev/null and b/datas/icons-16/archos_mount.png differ diff --git a/datas/icons-16/archos_unmount.png b/datas/icons-16/archos_unmount.png new file mode 100644 index 0000000..cac9b09 Binary files /dev/null and b/datas/icons-16/archos_unmount.png differ diff --git a/datas/icons-16/back.png b/datas/icons-16/back.png new file mode 100644 index 0000000..52fa887 Binary files /dev/null and b/datas/icons-16/back.png differ diff --git a/datas/icons-16/back2.png b/datas/icons-16/back2.png new file mode 100644 index 0000000..d023b6d Binary files /dev/null and b/datas/icons-16/back2.png differ diff --git a/datas/icons-16/back3.png b/datas/icons-16/back3.png new file mode 100644 index 0000000..fe508dd Binary files /dev/null and b/datas/icons-16/back3.png differ diff --git a/datas/icons-16/binary.png b/datas/icons-16/binary.png new file mode 100644 index 0000000..aa53b15 Binary files /dev/null and b/datas/icons-16/binary.png differ diff --git a/datas/icons-16/blockdevice.png b/datas/icons-16/blockdevice.png new file mode 100644 index 0000000..b9c57ed Binary files /dev/null and b/datas/icons-16/blockdevice.png differ diff --git a/datas/icons-16/bookmark.png b/datas/icons-16/bookmark.png new file mode 100644 index 0000000..5e76158 Binary files /dev/null and b/datas/icons-16/bookmark.png differ diff --git a/datas/icons-16/bookmark2.png b/datas/icons-16/bookmark2.png new file mode 100644 index 0000000..95ed2c7 Binary files /dev/null and b/datas/icons-16/bookmark2.png differ diff --git a/datas/icons-16/bookmark_add.png b/datas/icons-16/bookmark_add.png new file mode 100644 index 0000000..bdb8911 Binary files /dev/null and b/datas/icons-16/bookmark_add.png differ diff --git a/datas/icons-16/bookmark_add2.png b/datas/icons-16/bookmark_add2.png new file mode 100644 index 0000000..1c1a1ce Binary files /dev/null and b/datas/icons-16/bookmark_add2.png differ diff --git a/datas/icons-16/bookmark_folder.png b/datas/icons-16/bookmark_folder.png new file mode 100644 index 0000000..327e478 Binary files /dev/null and b/datas/icons-16/bookmark_folder.png differ diff --git a/datas/icons-16/bookmark_folder2.png b/datas/icons-16/bookmark_folder2.png new file mode 100644 index 0000000..20e932d Binary files /dev/null and b/datas/icons-16/bookmark_folder2.png differ diff --git a/datas/icons-16/bookmark_toolbar.png b/datas/icons-16/bookmark_toolbar.png new file mode 100644 index 0000000..2ae6123 Binary files /dev/null and b/datas/icons-16/bookmark_toolbar.png differ diff --git a/datas/icons-16/bookmark_toolbar2.png b/datas/icons-16/bookmark_toolbar2.png new file mode 100644 index 0000000..65f029e Binary files /dev/null and b/datas/icons-16/bookmark_toolbar2.png differ diff --git a/datas/icons-16/cancel.png b/datas/icons-16/cancel.png new file mode 100644 index 0000000..1cabc6e Binary files /dev/null and b/datas/icons-16/cancel.png differ diff --git a/datas/icons-16/cd-record.png b/datas/icons-16/cd-record.png new file mode 100644 index 0000000..a7e5464 Binary files /dev/null and b/datas/icons-16/cd-record.png differ diff --git a/datas/icons-16/cd_mount.png b/datas/icons-16/cd_mount.png new file mode 100644 index 0000000..c7ec935 Binary files /dev/null and b/datas/icons-16/cd_mount.png differ diff --git a/datas/icons-16/cd_unmount.png b/datas/icons-16/cd_unmount.png new file mode 100644 index 0000000..04a75a8 Binary files /dev/null and b/datas/icons-16/cd_unmount.png differ diff --git a/datas/icons-16/cdrom_mount.png b/datas/icons-16/cdrom_mount.png new file mode 100644 index 0000000..c7ec935 Binary files /dev/null and b/datas/icons-16/cdrom_mount.png differ diff --git a/datas/icons-16/cdrom_unmount.png b/datas/icons-16/cdrom_unmount.png new file mode 100644 index 0000000..04a75a8 Binary files /dev/null and b/datas/icons-16/cdrom_unmount.png differ diff --git a/datas/icons-16/cdtrack.png b/datas/icons-16/cdtrack.png new file mode 100644 index 0000000..a40dd8c Binary files /dev/null and b/datas/icons-16/cdtrack.png differ diff --git a/datas/icons-16/chardevice.png b/datas/icons-16/chardevice.png new file mode 100644 index 0000000..8cc4141 Binary files /dev/null and b/datas/icons-16/chardevice.png differ diff --git a/datas/icons-16/colorset.png b/datas/icons-16/colorset.png new file mode 100644 index 0000000..1c2b54f Binary files /dev/null and b/datas/icons-16/colorset.png differ diff --git a/datas/icons-16/configure.png b/datas/icons-16/configure.png new file mode 100644 index 0000000..0c95c52 Binary files /dev/null and b/datas/icons-16/configure.png differ diff --git a/datas/icons-16/core.png b/datas/icons-16/core.png new file mode 100644 index 0000000..6d70f68 Binary files /dev/null and b/datas/icons-16/core.png differ diff --git a/datas/icons-16/deb.png b/datas/icons-16/deb.png new file mode 100644 index 0000000..1478278 Binary files /dev/null and b/datas/icons-16/deb.png differ diff --git a/datas/icons-16/decrypted.png b/datas/icons-16/decrypted.png new file mode 100644 index 0000000..a52d790 Binary files /dev/null and b/datas/icons-16/decrypted.png differ diff --git a/datas/icons-16/desktop.png b/datas/icons-16/desktop.png new file mode 100644 index 0000000..03533c6 Binary files /dev/null and b/datas/icons-16/desktop.png differ diff --git a/datas/icons-16/document.png b/datas/icons-16/document.png new file mode 100644 index 0000000..d90688f Binary files /dev/null and b/datas/icons-16/document.png differ diff --git a/datas/icons-16/down.png b/datas/icons-16/down.png new file mode 100644 index 0000000..28729d7 Binary files /dev/null and b/datas/icons-16/down.png differ diff --git a/datas/icons-16/e.png b/datas/icons-16/e.png new file mode 100644 index 0000000..6baec5f Binary files /dev/null and b/datas/icons-16/e.png differ diff --git a/datas/icons-16/econtrol.png b/datas/icons-16/econtrol.png new file mode 100644 index 0000000..9d6316f Binary files /dev/null and b/datas/icons-16/econtrol.png differ diff --git a/datas/icons-16/edit.png b/datas/icons-16/edit.png new file mode 100644 index 0000000..98713ac Binary files /dev/null and b/datas/icons-16/edit.png differ diff --git a/datas/icons-16/editcopy.png b/datas/icons-16/editcopy.png new file mode 100644 index 0000000..c600e99 Binary files /dev/null and b/datas/icons-16/editcopy.png differ diff --git a/datas/icons-16/editcut.png b/datas/icons-16/editcut.png new file mode 100644 index 0000000..21c3673 Binary files /dev/null and b/datas/icons-16/editcut.png differ diff --git a/datas/icons-16/editdelete.png b/datas/icons-16/editdelete.png new file mode 100644 index 0000000..e94aa33 Binary files /dev/null and b/datas/icons-16/editdelete.png differ diff --git a/datas/icons-16/editpaste.png b/datas/icons-16/editpaste.png new file mode 100644 index 0000000..f6a1db8 Binary files /dev/null and b/datas/icons-16/editpaste.png differ diff --git a/datas/icons-16/editshred.png b/datas/icons-16/editshred.png new file mode 100644 index 0000000..8d65bf9 Binary files /dev/null and b/datas/icons-16/editshred.png differ diff --git a/datas/icons-16/edittrash.png b/datas/icons-16/edittrash.png new file mode 100644 index 0000000..32e3d1e Binary files /dev/null and b/datas/icons-16/edittrash.png differ diff --git a/datas/icons-16/efinder.png b/datas/icons-16/efinder.png new file mode 100644 index 0000000..f2b60da Binary files /dev/null and b/datas/icons-16/efinder.png differ diff --git a/datas/icons-16/ehelpbook.png b/datas/icons-16/ehelpbook.png new file mode 100644 index 0000000..d242b4b Binary files /dev/null and b/datas/icons-16/ehelpbook.png differ diff --git a/datas/icons-16/emenueditor.png b/datas/icons-16/emenueditor.png new file mode 100644 index 0000000..b121605 Binary files /dev/null and b/datas/icons-16/emenueditor.png differ diff --git a/datas/icons-16/empty2.png b/datas/icons-16/empty2.png new file mode 100644 index 0000000..3634de2 Binary files /dev/null and b/datas/icons-16/empty2.png differ diff --git a/datas/icons-16/empty_ascii.png b/datas/icons-16/empty_ascii.png new file mode 100644 index 0000000..4039a2e Binary files /dev/null and b/datas/icons-16/empty_ascii.png differ diff --git a/datas/icons-16/encrypted.png b/datas/icons-16/encrypted.png new file mode 100644 index 0000000..03480e3 Binary files /dev/null and b/datas/icons-16/encrypted.png differ diff --git a/datas/icons-16/exec.png b/datas/icons-16/exec.png new file mode 100644 index 0000000..2206448 Binary files /dev/null and b/datas/icons-16/exec.png differ diff --git a/datas/icons-16/exit.png b/datas/icons-16/exit.png new file mode 100644 index 0000000..3ce5300 Binary files /dev/null and b/datas/icons-16/exit.png differ diff --git a/datas/icons-16/file_broken.png b/datas/icons-16/file_broken.png new file mode 100644 index 0000000..5ccf29a Binary files /dev/null and b/datas/icons-16/file_broken.png differ diff --git a/datas/icons-16/file_locked.png b/datas/icons-16/file_locked.png new file mode 100644 index 0000000..c3b07a8 Binary files /dev/null and b/datas/icons-16/file_locked.png differ diff --git a/datas/icons-16/fileclose.png b/datas/icons-16/fileclose.png new file mode 100644 index 0000000..ffdc6a9 Binary files /dev/null and b/datas/icons-16/fileclose.png differ diff --git a/datas/icons-16/filefind.png b/datas/icons-16/filefind.png new file mode 100644 index 0000000..eb656d1 Binary files /dev/null and b/datas/icons-16/filefind.png differ diff --git a/datas/icons-16/filenew.png b/datas/icons-16/filenew.png new file mode 100644 index 0000000..3434c3d Binary files /dev/null and b/datas/icons-16/filenew.png differ diff --git a/datas/icons-16/fileopen.png b/datas/icons-16/fileopen.png new file mode 100644 index 0000000..2d27efc Binary files /dev/null and b/datas/icons-16/fileopen.png differ diff --git a/datas/icons-16/fileprint.png b/datas/icons-16/fileprint.png new file mode 100644 index 0000000..d01bc39 Binary files /dev/null and b/datas/icons-16/fileprint.png differ diff --git a/datas/icons-16/filesave.png b/datas/icons-16/filesave.png new file mode 100644 index 0000000..14d339d Binary files /dev/null and b/datas/icons-16/filesave.png differ diff --git a/datas/icons-16/find.png b/datas/icons-16/find.png new file mode 100644 index 0000000..92ae8f3 Binary files /dev/null and b/datas/icons-16/find.png differ diff --git a/datas/icons-16/folder.png b/datas/icons-16/folder.png new file mode 100644 index 0000000..b7aa966 Binary files /dev/null and b/datas/icons-16/folder.png differ diff --git a/datas/icons-16/folder_green.png b/datas/icons-16/folder_green.png new file mode 100644 index 0000000..2174e48 Binary files /dev/null and b/datas/icons-16/folder_green.png differ diff --git a/datas/icons-16/folder_home.png b/datas/icons-16/folder_home.png new file mode 100644 index 0000000..d04204d Binary files /dev/null and b/datas/icons-16/folder_home.png differ diff --git a/datas/icons-16/folder_image.png b/datas/icons-16/folder_image.png new file mode 100644 index 0000000..00f16ef Binary files /dev/null and b/datas/icons-16/folder_image.png differ diff --git a/datas/icons-16/folder_mail.png b/datas/icons-16/folder_mail.png new file mode 100644 index 0000000..d97b6ca Binary files /dev/null and b/datas/icons-16/folder_mail.png differ diff --git a/datas/icons-16/folder_man.png b/datas/icons-16/folder_man.png new file mode 100644 index 0000000..97b3f4a Binary files /dev/null and b/datas/icons-16/folder_man.png differ diff --git a/datas/icons-16/folder_new.png b/datas/icons-16/folder_new.png new file mode 100644 index 0000000..130e35e Binary files /dev/null and b/datas/icons-16/folder_new.png differ diff --git a/datas/icons-16/folder_open.png b/datas/icons-16/folder_open.png new file mode 100644 index 0000000..c56ebb7 Binary files /dev/null and b/datas/icons-16/folder_open.png differ diff --git a/datas/icons-16/folder_orange.png b/datas/icons-16/folder_orange.png new file mode 100644 index 0000000..f91aeb4 Binary files /dev/null and b/datas/icons-16/folder_orange.png differ diff --git a/datas/icons-16/folder_red.png b/datas/icons-16/folder_red.png new file mode 100644 index 0000000..2ab1bd7 Binary files /dev/null and b/datas/icons-16/folder_red.png differ diff --git a/datas/icons-16/folder_sound.png b/datas/icons-16/folder_sound.png new file mode 100644 index 0000000..5f92b30 Binary files /dev/null and b/datas/icons-16/folder_sound.png differ diff --git a/datas/icons-16/folder_tar.png b/datas/icons-16/folder_tar.png new file mode 100644 index 0000000..534541f Binary files /dev/null and b/datas/icons-16/folder_tar.png differ diff --git a/datas/icons-16/folder_video.png b/datas/icons-16/folder_video.png new file mode 100644 index 0000000..fc3f91b Binary files /dev/null and b/datas/icons-16/folder_video.png differ diff --git a/datas/icons-16/folder_violet.png b/datas/icons-16/folder_violet.png new file mode 100644 index 0000000..a321a05 Binary files /dev/null and b/datas/icons-16/folder_violet.png differ diff --git a/datas/icons-16/folder_yellow.png b/datas/icons-16/folder_yellow.png new file mode 100644 index 0000000..7cf7fcb Binary files /dev/null and b/datas/icons-16/folder_yellow.png differ diff --git a/datas/icons-16/font.png b/datas/icons-16/font.png new file mode 100644 index 0000000..8357506 Binary files /dev/null and b/datas/icons-16/font.png differ diff --git a/datas/icons-16/font_bitmap.png b/datas/icons-16/font_bitmap.png new file mode 100644 index 0000000..1d8a9e3 Binary files /dev/null and b/datas/icons-16/font_bitmap.png differ diff --git a/datas/icons-16/font_truetype.png b/datas/icons-16/font_truetype.png new file mode 100644 index 0000000..7b5cf98 Binary files /dev/null and b/datas/icons-16/font_truetype.png differ diff --git a/datas/icons-16/font_type1.png b/datas/icons-16/font_type1.png new file mode 100644 index 0000000..d859d99 Binary files /dev/null and b/datas/icons-16/font_type1.png differ diff --git a/datas/icons-16/forward.png b/datas/icons-16/forward.png new file mode 100644 index 0000000..e9cbecd Binary files /dev/null and b/datas/icons-16/forward.png differ diff --git a/datas/icons-16/forward2.png b/datas/icons-16/forward2.png new file mode 100644 index 0000000..563532d Binary files /dev/null and b/datas/icons-16/forward2.png differ diff --git a/datas/icons-16/forward3.png b/datas/icons-16/forward3.png new file mode 100644 index 0000000..82a0a9e Binary files /dev/null and b/datas/icons-16/forward3.png differ diff --git a/datas/icons-16/frameprint.png b/datas/icons-16/frameprint.png new file mode 100644 index 0000000..d6214f3 Binary files /dev/null and b/datas/icons-16/frameprint.png differ diff --git a/datas/icons-16/gimp.png b/datas/icons-16/gimp.png new file mode 100644 index 0000000..94bf46b Binary files /dev/null and b/datas/icons-16/gimp.png differ diff --git a/datas/icons-16/gimp2.png b/datas/icons-16/gimp2.png new file mode 100644 index 0000000..8e53460 Binary files /dev/null and b/datas/icons-16/gimp2.png differ diff --git a/datas/icons-16/gnome-apps.png b/datas/icons-16/gnome-apps.png new file mode 100644 index 0000000..1edc238 Binary files /dev/null and b/datas/icons-16/gnome-apps.png differ diff --git a/datas/icons-16/go.png b/datas/icons-16/go.png new file mode 100644 index 0000000..08bb180 Binary files /dev/null and b/datas/icons-16/go.png differ diff --git a/datas/icons-16/go2.png b/datas/icons-16/go2.png new file mode 100644 index 0000000..62dafa6 Binary files /dev/null and b/datas/icons-16/go2.png differ diff --git a/datas/icons-16/gohome.png b/datas/icons-16/gohome.png new file mode 100644 index 0000000..d04204d Binary files /dev/null and b/datas/icons-16/gohome.png differ diff --git a/datas/icons-16/history.png b/datas/icons-16/history.png new file mode 100644 index 0000000..a38aa7a Binary files /dev/null and b/datas/icons-16/history.png differ diff --git a/datas/icons-16/history_clear.png b/datas/icons-16/history_clear.png new file mode 100644 index 0000000..fb8fdda Binary files /dev/null and b/datas/icons-16/history_clear.png differ diff --git a/datas/icons-16/html.png b/datas/icons-16/html.png new file mode 100644 index 0000000..d4f5428 Binary files /dev/null and b/datas/icons-16/html.png differ diff --git a/datas/icons-16/ica.png b/datas/icons-16/ica.png new file mode 100644 index 0000000..2556dc9 Binary files /dev/null and b/datas/icons-16/ica.png differ diff --git a/datas/icons-16/image.png b/datas/icons-16/image.png new file mode 100644 index 0000000..0ff15f1 Binary files /dev/null and b/datas/icons-16/image.png differ diff --git a/datas/icons-16/info.png b/datas/icons-16/info.png new file mode 100644 index 0000000..ac9ee8e Binary files /dev/null and b/datas/icons-16/info.png differ diff --git a/datas/icons-16/java_src.png b/datas/icons-16/java_src.png new file mode 100644 index 0000000..cc0eb94 Binary files /dev/null and b/datas/icons-16/java_src.png differ diff --git a/datas/icons-16/kcontrol.png b/datas/icons-16/kcontrol.png new file mode 100644 index 0000000..57b820f Binary files /dev/null and b/datas/icons-16/kcontrol.png differ diff --git a/datas/icons-16/kde1.png b/datas/icons-16/kde1.png new file mode 100644 index 0000000..90516ee Binary files /dev/null and b/datas/icons-16/kde1.png differ diff --git a/datas/icons-16/kde2.png b/datas/icons-16/kde2.png new file mode 100644 index 0000000..7fa154d Binary files /dev/null and b/datas/icons-16/kde2.png differ diff --git a/datas/icons-16/kde3.png b/datas/icons-16/kde3.png new file mode 100644 index 0000000..fd120ad Binary files /dev/null and b/datas/icons-16/kde3.png differ diff --git a/datas/icons-16/kde4.png b/datas/icons-16/kde4.png new file mode 100644 index 0000000..1d33b5d Binary files /dev/null and b/datas/icons-16/kde4.png differ diff --git a/datas/icons-16/kde5.png b/datas/icons-16/kde5.png new file mode 100644 index 0000000..8caed0a Binary files /dev/null and b/datas/icons-16/kde5.png differ diff --git a/datas/icons-16/kde6.png b/datas/icons-16/kde6.png new file mode 100644 index 0000000..cb2f43a Binary files /dev/null and b/datas/icons-16/kde6.png differ diff --git a/datas/icons-16/kdisknav.png b/datas/icons-16/kdisknav.png new file mode 100644 index 0000000..3ba8a14 Binary files /dev/null and b/datas/icons-16/kdisknav.png differ diff --git a/datas/icons-16/key_enter.png b/datas/icons-16/key_enter.png new file mode 100644 index 0000000..cc4ead9 Binary files /dev/null and b/datas/icons-16/key_enter.png differ diff --git a/datas/icons-16/kfm_home.png b/datas/icons-16/kfm_home.png new file mode 100644 index 0000000..d04204d Binary files /dev/null and b/datas/icons-16/kfm_home.png differ diff --git a/datas/icons-16/khelpcenter.png b/datas/icons-16/khelpcenter.png new file mode 100644 index 0000000..a529354 Binary files /dev/null and b/datas/icons-16/khelpcenter.png differ diff --git a/datas/icons-16/klipper.png b/datas/icons-16/klipper.png new file mode 100644 index 0000000..e3f1ea0 Binary files /dev/null and b/datas/icons-16/klipper.png differ diff --git a/datas/icons-16/klpq.png b/datas/icons-16/klpq.png new file mode 100644 index 0000000..bf65a63 Binary files /dev/null and b/datas/icons-16/klpq.png differ diff --git a/datas/icons-16/kmail.png b/datas/icons-16/kmail.png new file mode 100644 index 0000000..e2219ca Binary files /dev/null and b/datas/icons-16/kmail.png differ diff --git a/datas/icons-16/kmultiple.png b/datas/icons-16/kmultiple.png new file mode 100644 index 0000000..7f57f24 Binary files /dev/null and b/datas/icons-16/kmultiple.png differ diff --git a/datas/icons-16/konqueror.png b/datas/icons-16/konqueror.png new file mode 100644 index 0000000..dd5add2 Binary files /dev/null and b/datas/icons-16/konqueror.png differ diff --git a/datas/icons-16/konqueror2.png b/datas/icons-16/konqueror2.png new file mode 100644 index 0000000..331487c Binary files /dev/null and b/datas/icons-16/konqueror2.png differ diff --git a/datas/icons-16/konqueror3.png b/datas/icons-16/konqueror3.png new file mode 100644 index 0000000..7904fb7 Binary files /dev/null and b/datas/icons-16/konqueror3.png differ diff --git a/datas/icons-16/konsole.png b/datas/icons-16/konsole.png new file mode 100644 index 0000000..9216eed Binary files /dev/null and b/datas/icons-16/konsole.png differ diff --git a/datas/icons-16/konsole2.png b/datas/icons-16/konsole2.png new file mode 100644 index 0000000..1954bc1 Binary files /dev/null and b/datas/icons-16/konsole2.png differ diff --git a/datas/icons-16/konsole3.png b/datas/icons-16/konsole3.png new file mode 100644 index 0000000..5cb1649 Binary files /dev/null and b/datas/icons-16/konsole3.png differ diff --git a/datas/icons-16/kvirc.png b/datas/icons-16/kvirc.png new file mode 100644 index 0000000..a710376 Binary files /dev/null and b/datas/icons-16/kvirc.png differ diff --git a/datas/icons-16/licq.png b/datas/icons-16/licq.png new file mode 100644 index 0000000..00a6540 Binary files /dev/null and b/datas/icons-16/licq.png differ diff --git a/datas/icons-16/lime.png b/datas/icons-16/lime.png new file mode 100644 index 0000000..f1d2f05 Binary files /dev/null and b/datas/icons-16/lime.png differ diff --git a/datas/icons-16/linuxconf.png b/datas/icons-16/linuxconf.png new file mode 100644 index 0000000..a923eae Binary files /dev/null and b/datas/icons-16/linuxconf.png differ diff --git a/datas/icons-16/lock.png b/datas/icons-16/lock.png new file mode 100644 index 0000000..d46a7aa Binary files /dev/null and b/datas/icons-16/lock.png differ diff --git a/datas/icons-16/lockoverlay.png b/datas/icons-16/lockoverlay.png new file mode 100644 index 0000000..8a0fca6 Binary files /dev/null and b/datas/icons-16/lockoverlay.png differ diff --git a/datas/icons-16/log.png b/datas/icons-16/log.png new file mode 100644 index 0000000..36d3117 Binary files /dev/null and b/datas/icons-16/log.png differ diff --git a/datas/icons-16/logout.png b/datas/icons-16/logout.png new file mode 100644 index 0000000..66860c0 Binary files /dev/null and b/datas/icons-16/logout.png differ diff --git a/datas/icons-16/mail_generic.png b/datas/icons-16/mail_generic.png new file mode 100644 index 0000000..faf6bd9 Binary files /dev/null and b/datas/icons-16/mail_generic.png differ diff --git a/datas/icons-16/make.png b/datas/icons-16/make.png new file mode 100644 index 0000000..84fa1d3 Binary files /dev/null and b/datas/icons-16/make.png differ diff --git a/datas/icons-16/midi.png b/datas/icons-16/midi.png new file mode 100644 index 0000000..b0f11f5 Binary files /dev/null and b/datas/icons-16/midi.png differ diff --git a/datas/icons-16/mime_empty.png b/datas/icons-16/mime_empty.png new file mode 100644 index 0000000..4039a2e Binary files /dev/null and b/datas/icons-16/mime_empty.png differ diff --git a/datas/icons-16/misc.png b/datas/icons-16/misc.png new file mode 100644 index 0000000..2206448 Binary files /dev/null and b/datas/icons-16/misc.png differ diff --git a/datas/icons-16/moc_src.png b/datas/icons-16/moc_src.png new file mode 100644 index 0000000..7911a0d Binary files /dev/null and b/datas/icons-16/moc_src.png differ diff --git a/datas/icons-16/mozilla-m.png b/datas/icons-16/mozilla-m.png new file mode 100644 index 0000000..046f179 Binary files /dev/null and b/datas/icons-16/mozilla-m.png differ diff --git a/datas/icons-16/mozilla-mail.png b/datas/icons-16/mozilla-mail.png new file mode 100644 index 0000000..412a94d Binary files /dev/null and b/datas/icons-16/mozilla-mail.png differ diff --git a/datas/icons-16/mozilla.png b/datas/icons-16/mozilla.png new file mode 100644 index 0000000..f120165 Binary files /dev/null and b/datas/icons-16/mozilla.png differ diff --git a/datas/icons-16/nedit.png b/datas/icons-16/nedit.png new file mode 100644 index 0000000..dca0c69 Binary files /dev/null and b/datas/icons-16/nedit.png differ diff --git a/datas/icons-16/netscape.png b/datas/icons-16/netscape.png new file mode 100644 index 0000000..bb04724 Binary files /dev/null and b/datas/icons-16/netscape.png differ diff --git a/datas/icons-16/network.png b/datas/icons-16/network.png new file mode 100644 index 0000000..dd5add2 Binary files /dev/null and b/datas/icons-16/network.png differ diff --git a/datas/icons-16/no.png b/datas/icons-16/no.png new file mode 100644 index 0000000..1cabc6e Binary files /dev/null and b/datas/icons-16/no.png differ diff --git a/datas/icons-16/noatun.png b/datas/icons-16/noatun.png new file mode 100644 index 0000000..20fa9ac Binary files /dev/null and b/datas/icons-16/noatun.png differ diff --git a/datas/icons-16/noatun2.png b/datas/icons-16/noatun2.png new file mode 100644 index 0000000..1d06341 Binary files /dev/null and b/datas/icons-16/noatun2.png differ diff --git a/datas/icons-16/openterm.png b/datas/icons-16/openterm.png new file mode 100644 index 0000000..9216eed Binary files /dev/null and b/datas/icons-16/openterm.png differ diff --git a/datas/icons-16/opera.png b/datas/icons-16/opera.png new file mode 100644 index 0000000..4694c2b Binary files /dev/null and b/datas/icons-16/opera.png differ diff --git a/datas/icons-16/package_application.png b/datas/icons-16/package_application.png new file mode 100644 index 0000000..929f664 Binary files /dev/null and b/datas/icons-16/package_application.png differ diff --git a/datas/icons-16/package_multimedia.png b/datas/icons-16/package_multimedia.png new file mode 100644 index 0000000..a4c8486 Binary files /dev/null and b/datas/icons-16/package_multimedia.png differ diff --git a/datas/icons-16/pdf-document.png b/datas/icons-16/pdf-document.png new file mode 100644 index 0000000..c83e300 Binary files /dev/null and b/datas/icons-16/pdf-document.png differ diff --git a/datas/icons-16/quicktime.png b/datas/icons-16/quicktime.png new file mode 100644 index 0000000..76b379a Binary files /dev/null and b/datas/icons-16/quicktime.png differ diff --git a/datas/icons-16/real_doc.png b/datas/icons-16/real_doc.png new file mode 100644 index 0000000..7e0be8e Binary files /dev/null and b/datas/icons-16/real_doc.png differ diff --git a/datas/icons-16/reload.png b/datas/icons-16/reload.png new file mode 100644 index 0000000..7c632f0 Binary files /dev/null and b/datas/icons-16/reload.png differ diff --git a/datas/icons-16/remove.png b/datas/icons-16/remove.png new file mode 100644 index 0000000..e188886 Binary files /dev/null and b/datas/icons-16/remove.png differ diff --git a/datas/icons-16/resource.png b/datas/icons-16/resource.png new file mode 100644 index 0000000..5d82ac3 Binary files /dev/null and b/datas/icons-16/resource.png differ diff --git a/datas/icons-16/rpm.png b/datas/icons-16/rpm.png new file mode 100644 index 0000000..becf832 Binary files /dev/null and b/datas/icons-16/rpm.png differ diff --git a/datas/icons-16/run.png b/datas/icons-16/run.png new file mode 100644 index 0000000..2206448 Binary files /dev/null and b/datas/icons-16/run.png differ diff --git a/datas/icons-16/scanner.png b/datas/icons-16/scanner.png new file mode 100644 index 0000000..f3371ad Binary files /dev/null and b/datas/icons-16/scanner.png differ diff --git a/datas/icons-16/services.png b/datas/icons-16/services.png new file mode 100644 index 0000000..2206448 Binary files /dev/null and b/datas/icons-16/services.png differ diff --git a/datas/icons-16/shell1.png b/datas/icons-16/shell1.png new file mode 100644 index 0000000..b66a6d1 Binary files /dev/null and b/datas/icons-16/shell1.png differ diff --git a/datas/icons-16/socket.png b/datas/icons-16/socket.png new file mode 100644 index 0000000..7ad8e66 Binary files /dev/null and b/datas/icons-16/socket.png differ diff --git a/datas/icons-16/soffice.png b/datas/icons-16/soffice.png new file mode 100644 index 0000000..284f3af Binary files /dev/null and b/datas/icons-16/soffice.png differ diff --git a/datas/icons-16/sound.png b/datas/icons-16/sound.png new file mode 100644 index 0000000..d59ddc5 Binary files /dev/null and b/datas/icons-16/sound.png differ diff --git a/datas/icons-16/source.png b/datas/icons-16/source.png new file mode 100644 index 0000000..43464f1 Binary files /dev/null and b/datas/icons-16/source.png differ diff --git a/datas/icons-16/spreadsheet.png b/datas/icons-16/spreadsheet.png new file mode 100644 index 0000000..ee760b3 Binary files /dev/null and b/datas/icons-16/spreadsheet.png differ diff --git a/datas/icons-16/stop.png b/datas/icons-16/stop.png new file mode 100644 index 0000000..1cabc6e Binary files /dev/null and b/datas/icons-16/stop.png differ diff --git a/datas/icons-16/synaptic.png b/datas/icons-16/synaptic.png new file mode 100644 index 0000000..b6ae62c Binary files /dev/null and b/datas/icons-16/synaptic.png differ diff --git a/datas/icons-16/tar.png b/datas/icons-16/tar.png new file mode 100644 index 0000000..888eb8e Binary files /dev/null and b/datas/icons-16/tar.png differ diff --git a/datas/icons-16/tex.png b/datas/icons-16/tex.png new file mode 100644 index 0000000..3c9c9a3 Binary files /dev/null and b/datas/icons-16/tex.png differ diff --git a/datas/icons-16/tgz.png b/datas/icons-16/tgz.png new file mode 100644 index 0000000..a186cf1 Binary files /dev/null and b/datas/icons-16/tgz.png differ diff --git a/datas/icons-16/trash.png b/datas/icons-16/trash.png new file mode 100644 index 0000000..5a8da1a Binary files /dev/null and b/datas/icons-16/trash.png differ diff --git a/datas/icons-16/trashcan_empty.png b/datas/icons-16/trashcan_empty.png new file mode 100644 index 0000000..32e3d1e Binary files /dev/null and b/datas/icons-16/trashcan_empty.png differ diff --git a/datas/icons-16/trashcan_full.png b/datas/icons-16/trashcan_full.png new file mode 100644 index 0000000..285e113 Binary files /dev/null and b/datas/icons-16/trashcan_full.png differ diff --git a/datas/icons-16/tux.png b/datas/icons-16/tux.png new file mode 100644 index 0000000..4b7d971 Binary files /dev/null and b/datas/icons-16/tux.png differ diff --git a/datas/icons-16/txt.png b/datas/icons-16/txt.png new file mode 100644 index 0000000..5bd83b7 Binary files /dev/null and b/datas/icons-16/txt.png differ diff --git a/datas/icons-16/unknown.png b/datas/icons-16/unknown.png new file mode 100644 index 0000000..4039a2e Binary files /dev/null and b/datas/icons-16/unknown.png differ diff --git a/datas/icons-16/unlock.png b/datas/icons-16/unlock.png new file mode 100644 index 0000000..a52d790 Binary files /dev/null and b/datas/icons-16/unlock.png differ diff --git a/datas/icons-16/up.png b/datas/icons-16/up.png new file mode 100644 index 0000000..4eca75c Binary files /dev/null and b/datas/icons-16/up.png differ diff --git a/datas/icons-16/video.png b/datas/icons-16/video.png new file mode 100644 index 0000000..c743e2a Binary files /dev/null and b/datas/icons-16/video.png differ diff --git a/datas/icons-16/view_bottom.png b/datas/icons-16/view_bottom.png new file mode 100644 index 0000000..edc7937 Binary files /dev/null and b/datas/icons-16/view_bottom.png differ diff --git a/datas/icons-16/view_choose.png b/datas/icons-16/view_choose.png new file mode 100644 index 0000000..31ca8de Binary files /dev/null and b/datas/icons-16/view_choose.png differ diff --git a/datas/icons-16/view_detailed.png b/datas/icons-16/view_detailed.png new file mode 100644 index 0000000..5665c74 Binary files /dev/null and b/datas/icons-16/view_detailed.png differ diff --git a/datas/icons-16/view_icon.png b/datas/icons-16/view_icon.png new file mode 100644 index 0000000..fe65dae Binary files /dev/null and b/datas/icons-16/view_icon.png differ diff --git a/datas/icons-16/view_left_right.png b/datas/icons-16/view_left_right.png new file mode 100644 index 0000000..b6ff729 Binary files /dev/null and b/datas/icons-16/view_left_right.png differ diff --git a/datas/icons-16/view_multicolumn.png b/datas/icons-16/view_multicolumn.png new file mode 100644 index 0000000..3fbd908 Binary files /dev/null and b/datas/icons-16/view_multicolumn.png differ diff --git a/datas/icons-16/view_remove.png b/datas/icons-16/view_remove.png new file mode 100644 index 0000000..0780355 Binary files /dev/null and b/datas/icons-16/view_remove.png differ diff --git a/datas/icons-16/view_right.png b/datas/icons-16/view_right.png new file mode 100644 index 0000000..c190958 Binary files /dev/null and b/datas/icons-16/view_right.png differ diff --git a/datas/icons-16/view_sidetree.png b/datas/icons-16/view_sidetree.png new file mode 100644 index 0000000..2e3727f Binary files /dev/null and b/datas/icons-16/view_sidetree.png differ diff --git a/datas/icons-16/view_text.png b/datas/icons-16/view_text.png new file mode 100644 index 0000000..6ed1c59 Binary files /dev/null and b/datas/icons-16/view_text.png differ diff --git a/datas/icons-16/view_top_bottom.png b/datas/icons-16/view_top_bottom.png new file mode 100644 index 0000000..ddbdaa8 Binary files /dev/null and b/datas/icons-16/view_top_bottom.png differ diff --git a/datas/icons-16/view_tree.png b/datas/icons-16/view_tree.png new file mode 100644 index 0000000..573582a Binary files /dev/null and b/datas/icons-16/view_tree.png differ diff --git a/datas/icons-16/viewmag+.png b/datas/icons-16/viewmag+.png new file mode 100644 index 0000000..ea5dc69 Binary files /dev/null and b/datas/icons-16/viewmag+.png differ diff --git a/datas/icons-16/viewmag-.png b/datas/icons-16/viewmag-.png new file mode 100644 index 0000000..83c8a56 Binary files /dev/null and b/datas/icons-16/viewmag-.png differ diff --git a/datas/icons-16/viewmag.png b/datas/icons-16/viewmag.png new file mode 100644 index 0000000..f5333fb Binary files /dev/null and b/datas/icons-16/viewmag.png differ diff --git a/datas/icons-16/vnc.png b/datas/icons-16/vnc.png new file mode 100644 index 0000000..4c4e7e4 Binary files /dev/null and b/datas/icons-16/vnc.png differ diff --git a/datas/icons-16/widget_doc.png b/datas/icons-16/widget_doc.png new file mode 100644 index 0000000..878a6aa Binary files /dev/null and b/datas/icons-16/widget_doc.png differ diff --git a/datas/icons-16/window_fullscreen.png b/datas/icons-16/window_fullscreen.png new file mode 100644 index 0000000..d035bfb Binary files /dev/null and b/datas/icons-16/window_fullscreen.png differ diff --git a/datas/icons-16/window_list.png b/datas/icons-16/window_list.png new file mode 100644 index 0000000..c6c88f2 Binary files /dev/null and b/datas/icons-16/window_list.png differ diff --git a/datas/icons-16/window_new.png b/datas/icons-16/window_new.png new file mode 100644 index 0000000..06cf3d1 Binary files /dev/null and b/datas/icons-16/window_new.png differ diff --git a/datas/icons-16/window_nofullscreen.png b/datas/icons-16/window_nofullscreen.png new file mode 100644 index 0000000..98063b3 Binary files /dev/null and b/datas/icons-16/window_nofullscreen.png differ diff --git a/datas/icons-16/wizard.png b/datas/icons-16/wizard.png new file mode 100644 index 0000000..3107990 Binary files /dev/null and b/datas/icons-16/wizard.png differ diff --git a/datas/icons-16/www.png b/datas/icons-16/www.png new file mode 100644 index 0000000..602a58f Binary files /dev/null and b/datas/icons-16/www.png differ diff --git a/datas/icons-16/xmms.png b/datas/icons-16/xmms.png new file mode 100644 index 0000000..f48b7de Binary files /dev/null and b/datas/icons-16/xmms.png differ diff --git a/datas/icons-16/xmms_classic.png b/datas/icons-16/xmms_classic.png new file mode 100644 index 0000000..148d2fa Binary files /dev/null and b/datas/icons-16/xmms_classic.png differ diff --git a/datas/icons-16/zip.png b/datas/icons-16/zip.png new file mode 100644 index 0000000..d67f3d4 Binary files /dev/null and b/datas/icons-16/zip.png differ diff --git a/datas/icons-16/zip_mount.png b/datas/icons-16/zip_mount.png new file mode 100644 index 0000000..bb23c85 Binary files /dev/null and b/datas/icons-16/zip_mount.png differ diff --git a/datas/icons-16/zip_unmount.png b/datas/icons-16/zip_unmount.png new file mode 100644 index 0000000..1f059f4 Binary files /dev/null and b/datas/icons-16/zip_unmount.png differ diff --git a/datas/icons-48/3floppy_mount.png b/datas/icons-48/3floppy_mount.png new file mode 100644 index 0000000..651d2ad Binary files /dev/null and b/datas/icons-48/3floppy_mount.png differ diff --git a/datas/icons-48/3floppy_unmount.png b/datas/icons-48/3floppy_unmount.png new file mode 100644 index 0000000..52050e6 Binary files /dev/null and b/datas/icons-48/3floppy_unmount.png differ diff --git a/datas/icons-48/Makefile b/datas/icons-48/Makefile new file mode 100644 index 0000000..b2f48eb --- /dev/null +++ b/datas/icons-48/Makefile @@ -0,0 +1,209 @@ +include ../../makeinclude + +iconsdir = $(datadir)/ede/icons + +icons48dir = $(iconsdir)/48x48 + +ICONS48 = \ + access.png \ + access2.png \ + applix.png \ + archos_mount.png \ + archos_unmount.png \ + ascii.png \ + binary.png \ + blockdevice.png \ + cd_audio.png \ + cd.png \ + cdrom_mount.png \ + cdrom_unmount.png \ + cdr.png \ + cdtrack.png \ + cd_video.png \ + cdwriter_mount.png \ + cdwriter_unmount.png \ + colorscm.png \ + core.png \ + core2.png \ + deb.png \ + desktop.png \ + document.png \ + document2.png \ + dvd_mount.png \ + dvd_unmount.png \ + encrypted.png \ + exec.png \ + file_broken.png \ + file_locked.png \ + folder_cool.png \ + folder_gray.png \ + folder_green.png \ + folder_gz.png \ + folder_home.png \ + folder_home1.png \ + folder_html.png \ + folder_image.png \ + folder_locked.png \ + folder_mail.png \ + folder_man.png \ + folder_orange.png \ + folder.png \ + folder_red.png \ + folder_rpm.png \ + folder_sound.png \ + folder_tar.png \ + folder_video.png \ + folder_violet.png \ + folder_yelow.png \ + folder2_html.png \ + folder2_html2.png \ + folder2_sound.png \ + folder2_video.png \ + font.png \ + fonts_bitmap.png \ + font_truetype.png \ + font_type1.png \ + freeBSD_hdd_mount.png \ + freeBSD_hdd_unmount.png \ + ftp.png \ + gimp.png \ + gimp2.png \ + gnome-apps.png \ + go.png \ + go2.png \ + handheld.png \ + hdd_mount.png \ + hdd_unmount.png \ + html.png \ + html2.png \ + chardevice.png \ + ica.png \ + image.png \ + info.png \ + kcalc.png \ + kcontrol.png \ + kdevelop1.png \ + kdisknav.png \ + kfm_home.png \ + khelpcenter.png \ + klpq.png \ + kmail.png \ + kmenu.png \ + kmultiple.png \ + knode.png \ + konqueror.png \ + konqueror2a.png \ + konqueror2.png \ + konsole.png \ + konsole2.png \ + konsole3.png \ + kppp.png \ + kvirc.png \ + licq.png \ + lime.png \ + link.png \ + linux-classic_hdd_mount.png \ + linux-classic_hdd_unmount.png \ + linuxconf.png \ + linux_hdd_mount.png \ + linux_hdd_unmount.png \ + lockoverlay.png \ + log.png \ + mac_hdd_mount.png \ + mac_hdd_unmount.png \ + make.png \ + make2.png \ + message.png \ + midi.png \ + mime_html.png \ + mime.png \ + mime_soffice.png \ + mime_sound.png \ + mime_track.png \ + mime_txt.png \ + misc_doc.png \ + mouse.png \ + mozilla-mail.png \ + mozilla-m.png \ + mozilla.png \ + mshdd_mount.png \ + mshdd_unmount.png \ + nedit.png \ + netscape_doc.png \ + netscape.png \ + network_local.png \ + network.png \ + noatun.png \ + noatun2.png \ + opera.png \ + package_multimedia.png \ + pdf.png \ + php.png \ + postscript.png \ + postscript2.png \ + printer.png \ + quicktime.png \ + real_doc.png \ + recycled.png \ + resource.png \ + rpm.png \ + scanner.png \ + shellscript.png \ + socket.png \ + soffice.png \ + sound.png \ + source_c.png \ + source_cpp.png \ + source_f.png \ + source_h.png \ + source_java.png \ + source_l.png \ + source_moc.png \ + source_o.png \ + source_pl.png \ + source.png \ + source_p.png \ + source_s.png \ + source_y.png \ + spreadsheet.png \ + synaptic.png \ + tar.png \ + template_source.png \ + tex.png \ + tgz.png \ + trashcan_empty.png \ + trashcan_full.png \ + tux.png \ + txt.png \ + unknown.png \ + unknown2.png \ + vcalendar.png \ + vcard.png \ + video.png \ + vmware.png \ + vnc.png \ + widget_doc.png \ + window_list.png \ + wmaker_apps.png \ + wordprocessing.png \ + www.png \ + xmms_classic.png \ + xmms2.png \ + zip_mount.png \ + zip.png \ + zip_unmount.png \ + 3floppy_mount.png \ + 3floppy_unmount.png + + +install: + $(MKINSTALLDIRS) $(icons48dir);\ + for f in $(ICONS48); do\ + echo "Installing $(icons48dir)/$$f";\ + $(INSTALL_DATA) $$f $(icons48dir);\ + done + +uninstall: + $(RM) -r $(icons48dir) + +clean: diff --git a/datas/icons-48/access.png b/datas/icons-48/access.png new file mode 100644 index 0000000..a5ded2c Binary files /dev/null and b/datas/icons-48/access.png differ diff --git a/datas/icons-48/access2.png b/datas/icons-48/access2.png new file mode 100644 index 0000000..439c2a7 Binary files /dev/null and b/datas/icons-48/access2.png differ diff --git a/datas/icons-48/applix.png b/datas/icons-48/applix.png new file mode 100644 index 0000000..3b3d670 Binary files /dev/null and b/datas/icons-48/applix.png differ diff --git a/datas/icons-48/archos_mount.png b/datas/icons-48/archos_mount.png new file mode 100644 index 0000000..4d86517 Binary files /dev/null and b/datas/icons-48/archos_mount.png differ diff --git a/datas/icons-48/archos_unmount.png b/datas/icons-48/archos_unmount.png new file mode 100644 index 0000000..ac55d15 Binary files /dev/null and b/datas/icons-48/archos_unmount.png differ diff --git a/datas/icons-48/ascii.png b/datas/icons-48/ascii.png new file mode 100644 index 0000000..5d06c67 Binary files /dev/null and b/datas/icons-48/ascii.png differ diff --git a/datas/icons-48/binary.png b/datas/icons-48/binary.png new file mode 100644 index 0000000..6ee4696 Binary files /dev/null and b/datas/icons-48/binary.png differ diff --git a/datas/icons-48/blockdevice.png b/datas/icons-48/blockdevice.png new file mode 100644 index 0000000..33a3cda Binary files /dev/null and b/datas/icons-48/blockdevice.png differ diff --git a/datas/icons-48/cd.png b/datas/icons-48/cd.png new file mode 100644 index 0000000..d18e640 Binary files /dev/null and b/datas/icons-48/cd.png differ diff --git a/datas/icons-48/cd_audio.png b/datas/icons-48/cd_audio.png new file mode 100644 index 0000000..6929f2e Binary files /dev/null and b/datas/icons-48/cd_audio.png differ diff --git a/datas/icons-48/cd_video.png b/datas/icons-48/cd_video.png new file mode 100644 index 0000000..e2f348d Binary files /dev/null and b/datas/icons-48/cd_video.png differ diff --git a/datas/icons-48/cdr.png b/datas/icons-48/cdr.png new file mode 100644 index 0000000..3a0210d Binary files /dev/null and b/datas/icons-48/cdr.png differ diff --git a/datas/icons-48/cdrom_mount.png b/datas/icons-48/cdrom_mount.png new file mode 100644 index 0000000..42b1ae6 Binary files /dev/null and b/datas/icons-48/cdrom_mount.png differ diff --git a/datas/icons-48/cdrom_unmount.png b/datas/icons-48/cdrom_unmount.png new file mode 100644 index 0000000..d86a85f Binary files /dev/null and b/datas/icons-48/cdrom_unmount.png differ diff --git a/datas/icons-48/cdtrack.png b/datas/icons-48/cdtrack.png new file mode 100644 index 0000000..ed1a458 Binary files /dev/null and b/datas/icons-48/cdtrack.png differ diff --git a/datas/icons-48/cdwriter_mount.png b/datas/icons-48/cdwriter_mount.png new file mode 100644 index 0000000..51a5054 Binary files /dev/null and b/datas/icons-48/cdwriter_mount.png differ diff --git a/datas/icons-48/cdwriter_unmount.png b/datas/icons-48/cdwriter_unmount.png new file mode 100644 index 0000000..d5dfe46 Binary files /dev/null and b/datas/icons-48/cdwriter_unmount.png differ diff --git a/datas/icons-48/chardevice.png b/datas/icons-48/chardevice.png new file mode 100644 index 0000000..342d335 Binary files /dev/null and b/datas/icons-48/chardevice.png differ diff --git a/datas/icons-48/colorscm.png b/datas/icons-48/colorscm.png new file mode 100644 index 0000000..cf97d8c Binary files /dev/null and b/datas/icons-48/colorscm.png differ diff --git a/datas/icons-48/core.png b/datas/icons-48/core.png new file mode 100644 index 0000000..b1b5964 Binary files /dev/null and b/datas/icons-48/core.png differ diff --git a/datas/icons-48/core2.png b/datas/icons-48/core2.png new file mode 100644 index 0000000..137d407 Binary files /dev/null and b/datas/icons-48/core2.png differ diff --git a/datas/icons-48/deb.png b/datas/icons-48/deb.png new file mode 100644 index 0000000..4ed57ca Binary files /dev/null and b/datas/icons-48/deb.png differ diff --git a/datas/icons-48/desktop.png b/datas/icons-48/desktop.png new file mode 100644 index 0000000..078b406 Binary files /dev/null and b/datas/icons-48/desktop.png differ diff --git a/datas/icons-48/document.png b/datas/icons-48/document.png new file mode 100644 index 0000000..9f771c9 Binary files /dev/null and b/datas/icons-48/document.png differ diff --git a/datas/icons-48/document2.png b/datas/icons-48/document2.png new file mode 100644 index 0000000..39f6428 Binary files /dev/null and b/datas/icons-48/document2.png differ diff --git a/datas/icons-48/dvd_mount.png b/datas/icons-48/dvd_mount.png new file mode 100644 index 0000000..2da5608 Binary files /dev/null and b/datas/icons-48/dvd_mount.png differ diff --git a/datas/icons-48/dvd_unmount.png b/datas/icons-48/dvd_unmount.png new file mode 100644 index 0000000..56a7489 Binary files /dev/null and b/datas/icons-48/dvd_unmount.png differ diff --git a/datas/icons-48/encrypted.png b/datas/icons-48/encrypted.png new file mode 100644 index 0000000..cdf085b Binary files /dev/null and b/datas/icons-48/encrypted.png differ diff --git a/datas/icons-48/exec.png b/datas/icons-48/exec.png new file mode 100644 index 0000000..0dce612 Binary files /dev/null and b/datas/icons-48/exec.png differ diff --git a/datas/icons-48/file_broken.png b/datas/icons-48/file_broken.png new file mode 100644 index 0000000..8c7432a Binary files /dev/null and b/datas/icons-48/file_broken.png differ diff --git a/datas/icons-48/file_locked.png b/datas/icons-48/file_locked.png new file mode 100644 index 0000000..ee2b703 Binary files /dev/null and b/datas/icons-48/file_locked.png differ diff --git a/datas/icons-48/folder.png b/datas/icons-48/folder.png new file mode 100644 index 0000000..9b356df Binary files /dev/null and b/datas/icons-48/folder.png differ diff --git a/datas/icons-48/folder2_html.png b/datas/icons-48/folder2_html.png new file mode 100644 index 0000000..f260b3a Binary files /dev/null and b/datas/icons-48/folder2_html.png differ diff --git a/datas/icons-48/folder2_html2.png b/datas/icons-48/folder2_html2.png new file mode 100644 index 0000000..fdbc98d Binary files /dev/null and b/datas/icons-48/folder2_html2.png differ diff --git a/datas/icons-48/folder2_sound.png b/datas/icons-48/folder2_sound.png new file mode 100644 index 0000000..a96c1b1 Binary files /dev/null and b/datas/icons-48/folder2_sound.png differ diff --git a/datas/icons-48/folder2_video.png b/datas/icons-48/folder2_video.png new file mode 100644 index 0000000..5e73b65 Binary files /dev/null and b/datas/icons-48/folder2_video.png differ diff --git a/datas/icons-48/folder_cool.png b/datas/icons-48/folder_cool.png new file mode 100644 index 0000000..a2771d4 Binary files /dev/null and b/datas/icons-48/folder_cool.png differ diff --git a/datas/icons-48/folder_gray.png b/datas/icons-48/folder_gray.png new file mode 100644 index 0000000..526f570 Binary files /dev/null and b/datas/icons-48/folder_gray.png differ diff --git a/datas/icons-48/folder_green.png b/datas/icons-48/folder_green.png new file mode 100644 index 0000000..ff085c5 Binary files /dev/null and b/datas/icons-48/folder_green.png differ diff --git a/datas/icons-48/folder_gz.png b/datas/icons-48/folder_gz.png new file mode 100644 index 0000000..e0f5f2f Binary files /dev/null and b/datas/icons-48/folder_gz.png differ diff --git a/datas/icons-48/folder_home.png b/datas/icons-48/folder_home.png new file mode 100644 index 0000000..d804b70 Binary files /dev/null and b/datas/icons-48/folder_home.png differ diff --git a/datas/icons-48/folder_home1.png b/datas/icons-48/folder_home1.png new file mode 100644 index 0000000..0c9411e Binary files /dev/null and b/datas/icons-48/folder_home1.png differ diff --git a/datas/icons-48/folder_html.png b/datas/icons-48/folder_html.png new file mode 100644 index 0000000..37565e0 Binary files /dev/null and b/datas/icons-48/folder_html.png differ diff --git a/datas/icons-48/folder_image.png b/datas/icons-48/folder_image.png new file mode 100644 index 0000000..f0d8b56 Binary files /dev/null and b/datas/icons-48/folder_image.png differ diff --git a/datas/icons-48/folder_locked.png b/datas/icons-48/folder_locked.png new file mode 100644 index 0000000..6a6db9b Binary files /dev/null and b/datas/icons-48/folder_locked.png differ diff --git a/datas/icons-48/folder_mail.png b/datas/icons-48/folder_mail.png new file mode 100644 index 0000000..6929287 Binary files /dev/null and b/datas/icons-48/folder_mail.png differ diff --git a/datas/icons-48/folder_man.png b/datas/icons-48/folder_man.png new file mode 100644 index 0000000..e631467 Binary files /dev/null and b/datas/icons-48/folder_man.png differ diff --git a/datas/icons-48/folder_orange.png b/datas/icons-48/folder_orange.png new file mode 100644 index 0000000..952ec3c Binary files /dev/null and b/datas/icons-48/folder_orange.png differ diff --git a/datas/icons-48/folder_red.png b/datas/icons-48/folder_red.png new file mode 100644 index 0000000..b66ae31 Binary files /dev/null and b/datas/icons-48/folder_red.png differ diff --git a/datas/icons-48/folder_rpm.png b/datas/icons-48/folder_rpm.png new file mode 100644 index 0000000..b1b041e Binary files /dev/null and b/datas/icons-48/folder_rpm.png differ diff --git a/datas/icons-48/folder_sound.png b/datas/icons-48/folder_sound.png new file mode 100644 index 0000000..13422f8 Binary files /dev/null and b/datas/icons-48/folder_sound.png differ diff --git a/datas/icons-48/folder_tar.png b/datas/icons-48/folder_tar.png new file mode 100644 index 0000000..173359d Binary files /dev/null and b/datas/icons-48/folder_tar.png differ diff --git a/datas/icons-48/folder_video.png b/datas/icons-48/folder_video.png new file mode 100644 index 0000000..d9af274 Binary files /dev/null and b/datas/icons-48/folder_video.png differ diff --git a/datas/icons-48/folder_violet.png b/datas/icons-48/folder_violet.png new file mode 100644 index 0000000..95087d6 Binary files /dev/null and b/datas/icons-48/folder_violet.png differ diff --git a/datas/icons-48/folder_yelow.png b/datas/icons-48/folder_yelow.png new file mode 100644 index 0000000..15b0cdd Binary files /dev/null and b/datas/icons-48/folder_yelow.png differ diff --git a/datas/icons-48/font.png b/datas/icons-48/font.png new file mode 100644 index 0000000..b54d089 Binary files /dev/null and b/datas/icons-48/font.png differ diff --git a/datas/icons-48/font_truetype.png b/datas/icons-48/font_truetype.png new file mode 100644 index 0000000..db138de Binary files /dev/null and b/datas/icons-48/font_truetype.png differ diff --git a/datas/icons-48/font_type1.png b/datas/icons-48/font_type1.png new file mode 100644 index 0000000..d542f49 Binary files /dev/null and b/datas/icons-48/font_type1.png differ diff --git a/datas/icons-48/fonts_bitmap.png b/datas/icons-48/fonts_bitmap.png new file mode 100644 index 0000000..5da71da Binary files /dev/null and b/datas/icons-48/fonts_bitmap.png differ diff --git a/datas/icons-48/freeBSD_hdd_mount.png b/datas/icons-48/freeBSD_hdd_mount.png new file mode 100644 index 0000000..23310e4 Binary files /dev/null and b/datas/icons-48/freeBSD_hdd_mount.png differ diff --git a/datas/icons-48/freeBSD_hdd_unmount.png b/datas/icons-48/freeBSD_hdd_unmount.png new file mode 100644 index 0000000..d12fcbd Binary files /dev/null and b/datas/icons-48/freeBSD_hdd_unmount.png differ diff --git a/datas/icons-48/ftp.png b/datas/icons-48/ftp.png new file mode 100644 index 0000000..34159c0 Binary files /dev/null and b/datas/icons-48/ftp.png differ diff --git a/datas/icons-48/gimp.png b/datas/icons-48/gimp.png new file mode 100644 index 0000000..a9316c6 Binary files /dev/null and b/datas/icons-48/gimp.png differ diff --git a/datas/icons-48/gimp2.png b/datas/icons-48/gimp2.png new file mode 100644 index 0000000..06ff087 Binary files /dev/null and b/datas/icons-48/gimp2.png differ diff --git a/datas/icons-48/gnome-apps.png b/datas/icons-48/gnome-apps.png new file mode 100644 index 0000000..3f717d0 Binary files /dev/null and b/datas/icons-48/gnome-apps.png differ diff --git a/datas/icons-48/go.png b/datas/icons-48/go.png new file mode 100644 index 0000000..36f8ce0 Binary files /dev/null and b/datas/icons-48/go.png differ diff --git a/datas/icons-48/go2.png b/datas/icons-48/go2.png new file mode 100644 index 0000000..96ed0fd Binary files /dev/null and b/datas/icons-48/go2.png differ diff --git a/datas/icons-48/handheld.png b/datas/icons-48/handheld.png new file mode 100644 index 0000000..10cc239 Binary files /dev/null and b/datas/icons-48/handheld.png differ diff --git a/datas/icons-48/hdd_mount.png b/datas/icons-48/hdd_mount.png new file mode 100644 index 0000000..283dc34 Binary files /dev/null and b/datas/icons-48/hdd_mount.png differ diff --git a/datas/icons-48/hdd_unmount.png b/datas/icons-48/hdd_unmount.png new file mode 100644 index 0000000..f9e1990 Binary files /dev/null and b/datas/icons-48/hdd_unmount.png differ diff --git a/datas/icons-48/html.png b/datas/icons-48/html.png new file mode 100644 index 0000000..2864553 Binary files /dev/null and b/datas/icons-48/html.png differ diff --git a/datas/icons-48/html2.png b/datas/icons-48/html2.png new file mode 100644 index 0000000..afefd0c Binary files /dev/null and b/datas/icons-48/html2.png differ diff --git a/datas/icons-48/ica.png b/datas/icons-48/ica.png new file mode 100644 index 0000000..300b73f Binary files /dev/null and b/datas/icons-48/ica.png differ diff --git a/datas/icons-48/image.png b/datas/icons-48/image.png new file mode 100644 index 0000000..08db56a Binary files /dev/null and b/datas/icons-48/image.png differ diff --git a/datas/icons-48/info.png b/datas/icons-48/info.png new file mode 100644 index 0000000..faad79e Binary files /dev/null and b/datas/icons-48/info.png differ diff --git a/datas/icons-48/kcalc.png b/datas/icons-48/kcalc.png new file mode 100644 index 0000000..b7f198d Binary files /dev/null and b/datas/icons-48/kcalc.png differ diff --git a/datas/icons-48/kcontrol.png b/datas/icons-48/kcontrol.png new file mode 100644 index 0000000..53b6cab Binary files /dev/null and b/datas/icons-48/kcontrol.png differ diff --git a/datas/icons-48/kdevelop1.png b/datas/icons-48/kdevelop1.png new file mode 100644 index 0000000..95c2e68 Binary files /dev/null and b/datas/icons-48/kdevelop1.png differ diff --git a/datas/icons-48/kdisknav.png b/datas/icons-48/kdisknav.png new file mode 100644 index 0000000..fbc259e Binary files /dev/null and b/datas/icons-48/kdisknav.png differ diff --git a/datas/icons-48/kfm_home.png b/datas/icons-48/kfm_home.png new file mode 100644 index 0000000..65aa59f Binary files /dev/null and b/datas/icons-48/kfm_home.png differ diff --git a/datas/icons-48/khelpcenter.png b/datas/icons-48/khelpcenter.png new file mode 100644 index 0000000..585fe6d Binary files /dev/null and b/datas/icons-48/khelpcenter.png differ diff --git a/datas/icons-48/klpq.png b/datas/icons-48/klpq.png new file mode 100644 index 0000000..6e87288 Binary files /dev/null and b/datas/icons-48/klpq.png differ diff --git a/datas/icons-48/kmail.png b/datas/icons-48/kmail.png new file mode 100644 index 0000000..deee685 Binary files /dev/null and b/datas/icons-48/kmail.png differ diff --git a/datas/icons-48/kmenu.png b/datas/icons-48/kmenu.png new file mode 100644 index 0000000..36f8ce0 Binary files /dev/null and b/datas/icons-48/kmenu.png differ diff --git a/datas/icons-48/kmultiple.png b/datas/icons-48/kmultiple.png new file mode 100644 index 0000000..24627c6 Binary files /dev/null and b/datas/icons-48/kmultiple.png differ diff --git a/datas/icons-48/knode.png b/datas/icons-48/knode.png new file mode 100644 index 0000000..7748b7e Binary files /dev/null and b/datas/icons-48/knode.png differ diff --git a/datas/icons-48/konqueror.png b/datas/icons-48/konqueror.png new file mode 100644 index 0000000..4e9cd53 Binary files /dev/null and b/datas/icons-48/konqueror.png differ diff --git a/datas/icons-48/konqueror2.png b/datas/icons-48/konqueror2.png new file mode 100644 index 0000000..d719baa Binary files /dev/null and b/datas/icons-48/konqueror2.png differ diff --git a/datas/icons-48/konqueror2a.png b/datas/icons-48/konqueror2a.png new file mode 100644 index 0000000..b2cd026 Binary files /dev/null and b/datas/icons-48/konqueror2a.png differ diff --git a/datas/icons-48/konqueror3 b/datas/icons-48/konqueror3 new file mode 100644 index 0000000..bcaa9f8 Binary files /dev/null and b/datas/icons-48/konqueror3 differ diff --git a/datas/icons-48/konsole.png b/datas/icons-48/konsole.png new file mode 100644 index 0000000..25a3c96 Binary files /dev/null and b/datas/icons-48/konsole.png differ diff --git a/datas/icons-48/konsole2.png b/datas/icons-48/konsole2.png new file mode 100644 index 0000000..2c587ef Binary files /dev/null and b/datas/icons-48/konsole2.png differ diff --git a/datas/icons-48/konsole3.png b/datas/icons-48/konsole3.png new file mode 100644 index 0000000..fcab209 Binary files /dev/null and b/datas/icons-48/konsole3.png differ diff --git a/datas/icons-48/kppp.png b/datas/icons-48/kppp.png new file mode 100644 index 0000000..7ab7a98 Binary files /dev/null and b/datas/icons-48/kppp.png differ diff --git a/datas/icons-48/kvirc.png b/datas/icons-48/kvirc.png new file mode 100644 index 0000000..7823680 Binary files /dev/null and b/datas/icons-48/kvirc.png differ diff --git a/datas/icons-48/licq.png b/datas/icons-48/licq.png new file mode 100644 index 0000000..0594f71 Binary files /dev/null and b/datas/icons-48/licq.png differ diff --git a/datas/icons-48/lime.png b/datas/icons-48/lime.png new file mode 100644 index 0000000..a491a52 Binary files /dev/null and b/datas/icons-48/lime.png differ diff --git a/datas/icons-48/link.png b/datas/icons-48/link.png new file mode 100644 index 0000000..9ad8a8c Binary files /dev/null and b/datas/icons-48/link.png differ diff --git a/datas/icons-48/linux-classic_hdd_mount.png b/datas/icons-48/linux-classic_hdd_mount.png new file mode 100644 index 0000000..d64111f Binary files /dev/null and b/datas/icons-48/linux-classic_hdd_mount.png differ diff --git a/datas/icons-48/linux-classic_hdd_unmount.png b/datas/icons-48/linux-classic_hdd_unmount.png new file mode 100644 index 0000000..585f03c Binary files /dev/null and b/datas/icons-48/linux-classic_hdd_unmount.png differ diff --git a/datas/icons-48/linux_hdd_mount.png b/datas/icons-48/linux_hdd_mount.png new file mode 100644 index 0000000..8dc8691 Binary files /dev/null and b/datas/icons-48/linux_hdd_mount.png differ diff --git a/datas/icons-48/linux_hdd_unmount.png b/datas/icons-48/linux_hdd_unmount.png new file mode 100644 index 0000000..c9a4d2f Binary files /dev/null and b/datas/icons-48/linux_hdd_unmount.png differ diff --git a/datas/icons-48/linuxconf.png b/datas/icons-48/linuxconf.png new file mode 100644 index 0000000..0fe6769 Binary files /dev/null and b/datas/icons-48/linuxconf.png differ diff --git a/datas/icons-48/lockoverlay.png b/datas/icons-48/lockoverlay.png new file mode 100644 index 0000000..982e3ce Binary files /dev/null and b/datas/icons-48/lockoverlay.png differ diff --git a/datas/icons-48/log.png b/datas/icons-48/log.png new file mode 100644 index 0000000..ce1f230 Binary files /dev/null and b/datas/icons-48/log.png differ diff --git a/datas/icons-48/mac_hdd_mount.png b/datas/icons-48/mac_hdd_mount.png new file mode 100644 index 0000000..0ffde84 Binary files /dev/null and b/datas/icons-48/mac_hdd_mount.png differ diff --git a/datas/icons-48/mac_hdd_unmount.png b/datas/icons-48/mac_hdd_unmount.png new file mode 100644 index 0000000..ea1b6be Binary files /dev/null and b/datas/icons-48/mac_hdd_unmount.png differ diff --git a/datas/icons-48/make.png b/datas/icons-48/make.png new file mode 100644 index 0000000..c6831e1 Binary files /dev/null and b/datas/icons-48/make.png differ diff --git a/datas/icons-48/make2.png b/datas/icons-48/make2.png new file mode 100644 index 0000000..e81262e Binary files /dev/null and b/datas/icons-48/make2.png differ diff --git a/datas/icons-48/message.png b/datas/icons-48/message.png new file mode 100644 index 0000000..7134452 Binary files /dev/null and b/datas/icons-48/message.png differ diff --git a/datas/icons-48/midi.png b/datas/icons-48/midi.png new file mode 100644 index 0000000..3f38c72 Binary files /dev/null and b/datas/icons-48/midi.png differ diff --git a/datas/icons-48/mime.png b/datas/icons-48/mime.png new file mode 100644 index 0000000..205de9f Binary files /dev/null and b/datas/icons-48/mime.png differ diff --git a/datas/icons-48/mime_html.png b/datas/icons-48/mime_html.png new file mode 100644 index 0000000..f962dbe Binary files /dev/null and b/datas/icons-48/mime_html.png differ diff --git a/datas/icons-48/mime_soffice.png b/datas/icons-48/mime_soffice.png new file mode 100644 index 0000000..5f45bc9 Binary files /dev/null and b/datas/icons-48/mime_soffice.png differ diff --git a/datas/icons-48/mime_sound.png b/datas/icons-48/mime_sound.png new file mode 100644 index 0000000..01d9b10 Binary files /dev/null and b/datas/icons-48/mime_sound.png differ diff --git a/datas/icons-48/mime_track.png b/datas/icons-48/mime_track.png new file mode 100644 index 0000000..9232982 Binary files /dev/null and b/datas/icons-48/mime_track.png differ diff --git a/datas/icons-48/mime_txt.png b/datas/icons-48/mime_txt.png new file mode 100644 index 0000000..26b2624 Binary files /dev/null and b/datas/icons-48/mime_txt.png differ diff --git a/datas/icons-48/misc_doc.png b/datas/icons-48/misc_doc.png new file mode 100644 index 0000000..3bdeda1 Binary files /dev/null and b/datas/icons-48/misc_doc.png differ diff --git a/datas/icons-48/mouse.png b/datas/icons-48/mouse.png new file mode 100644 index 0000000..45d900d Binary files /dev/null and b/datas/icons-48/mouse.png differ diff --git a/datas/icons-48/mozilla-m.png b/datas/icons-48/mozilla-m.png new file mode 100644 index 0000000..f6a2f57 Binary files /dev/null and b/datas/icons-48/mozilla-m.png differ diff --git a/datas/icons-48/mozilla-mail.png b/datas/icons-48/mozilla-mail.png new file mode 100644 index 0000000..978575a Binary files /dev/null and b/datas/icons-48/mozilla-mail.png differ diff --git a/datas/icons-48/mozilla.png b/datas/icons-48/mozilla.png new file mode 100644 index 0000000..63d6c8d Binary files /dev/null and b/datas/icons-48/mozilla.png differ diff --git a/datas/icons-48/mshdd_mount.png b/datas/icons-48/mshdd_mount.png new file mode 100644 index 0000000..4d81fad Binary files /dev/null and b/datas/icons-48/mshdd_mount.png differ diff --git a/datas/icons-48/mshdd_unmount.png b/datas/icons-48/mshdd_unmount.png new file mode 100644 index 0000000..861e43c Binary files /dev/null and b/datas/icons-48/mshdd_unmount.png differ diff --git a/datas/icons-48/nedit.png b/datas/icons-48/nedit.png new file mode 100644 index 0000000..a617541 Binary files /dev/null and b/datas/icons-48/nedit.png differ diff --git a/datas/icons-48/netscape.png b/datas/icons-48/netscape.png new file mode 100644 index 0000000..da8e891 Binary files /dev/null and b/datas/icons-48/netscape.png differ diff --git a/datas/icons-48/netscape_doc.png b/datas/icons-48/netscape_doc.png new file mode 100644 index 0000000..fa66e35 Binary files /dev/null and b/datas/icons-48/netscape_doc.png differ diff --git a/datas/icons-48/network.png b/datas/icons-48/network.png new file mode 100644 index 0000000..47aff2a Binary files /dev/null and b/datas/icons-48/network.png differ diff --git a/datas/icons-48/network_local.png b/datas/icons-48/network_local.png new file mode 100644 index 0000000..47aff2a Binary files /dev/null and b/datas/icons-48/network_local.png differ diff --git a/datas/icons-48/noatun.png b/datas/icons-48/noatun.png new file mode 100644 index 0000000..2fd8d63 Binary files /dev/null and b/datas/icons-48/noatun.png differ diff --git a/datas/icons-48/noatun2.png b/datas/icons-48/noatun2.png new file mode 100644 index 0000000..819b2d9 Binary files /dev/null and b/datas/icons-48/noatun2.png differ diff --git a/datas/icons-48/opera.png b/datas/icons-48/opera.png new file mode 100644 index 0000000..f092f4e Binary files /dev/null and b/datas/icons-48/opera.png differ diff --git a/datas/icons-48/package_multimedia.png b/datas/icons-48/package_multimedia.png new file mode 100644 index 0000000..981fc59 Binary files /dev/null and b/datas/icons-48/package_multimedia.png differ diff --git a/datas/icons-48/pdf.png b/datas/icons-48/pdf.png new file mode 100644 index 0000000..2949f9d Binary files /dev/null and b/datas/icons-48/pdf.png differ diff --git a/datas/icons-48/php.png b/datas/icons-48/php.png new file mode 100644 index 0000000..58ebaab Binary files /dev/null and b/datas/icons-48/php.png differ diff --git a/datas/icons-48/postscript.png b/datas/icons-48/postscript.png new file mode 100644 index 0000000..4d0e1d0 Binary files /dev/null and b/datas/icons-48/postscript.png differ diff --git a/datas/icons-48/postscript2.png b/datas/icons-48/postscript2.png new file mode 100644 index 0000000..8d29e43 Binary files /dev/null and b/datas/icons-48/postscript2.png differ diff --git a/datas/icons-48/printer.png b/datas/icons-48/printer.png new file mode 100644 index 0000000..6e87288 Binary files /dev/null and b/datas/icons-48/printer.png differ diff --git a/datas/icons-48/quicktime.png b/datas/icons-48/quicktime.png new file mode 100644 index 0000000..8e2f94a Binary files /dev/null and b/datas/icons-48/quicktime.png differ diff --git a/datas/icons-48/real_doc.png b/datas/icons-48/real_doc.png new file mode 100644 index 0000000..581077d Binary files /dev/null and b/datas/icons-48/real_doc.png differ diff --git a/datas/icons-48/recycled.png b/datas/icons-48/recycled.png new file mode 100644 index 0000000..91d8cab Binary files /dev/null and b/datas/icons-48/recycled.png differ diff --git a/datas/icons-48/resource.png b/datas/icons-48/resource.png new file mode 100644 index 0000000..9f1e603 Binary files /dev/null and b/datas/icons-48/resource.png differ diff --git a/datas/icons-48/rpm.png b/datas/icons-48/rpm.png new file mode 100644 index 0000000..70620f0 Binary files /dev/null and b/datas/icons-48/rpm.png differ diff --git a/datas/icons-48/scanner.png b/datas/icons-48/scanner.png new file mode 100644 index 0000000..58bae0e Binary files /dev/null and b/datas/icons-48/scanner.png differ diff --git a/datas/icons-48/shellscript.png b/datas/icons-48/shellscript.png new file mode 100644 index 0000000..17d8c9c Binary files /dev/null and b/datas/icons-48/shellscript.png differ diff --git a/datas/icons-48/socket.png b/datas/icons-48/socket.png new file mode 100644 index 0000000..1507aab Binary files /dev/null and b/datas/icons-48/socket.png differ diff --git a/datas/icons-48/soffice.png b/datas/icons-48/soffice.png new file mode 100644 index 0000000..1f9eeb5 Binary files /dev/null and b/datas/icons-48/soffice.png differ diff --git a/datas/icons-48/sound.png b/datas/icons-48/sound.png new file mode 100644 index 0000000..5f3f6e2 Binary files /dev/null and b/datas/icons-48/sound.png differ diff --git a/datas/icons-48/source.png b/datas/icons-48/source.png new file mode 100644 index 0000000..ef1fe74 Binary files /dev/null and b/datas/icons-48/source.png differ diff --git a/datas/icons-48/source_c.png b/datas/icons-48/source_c.png new file mode 100644 index 0000000..ad8947b Binary files /dev/null and b/datas/icons-48/source_c.png differ diff --git a/datas/icons-48/source_cpp.png b/datas/icons-48/source_cpp.png new file mode 100644 index 0000000..2031b46 Binary files /dev/null and b/datas/icons-48/source_cpp.png differ diff --git a/datas/icons-48/source_f.png b/datas/icons-48/source_f.png new file mode 100644 index 0000000..e52fc80 Binary files /dev/null and b/datas/icons-48/source_f.png differ diff --git a/datas/icons-48/source_h.png b/datas/icons-48/source_h.png new file mode 100644 index 0000000..041e6bc Binary files /dev/null and b/datas/icons-48/source_h.png differ diff --git a/datas/icons-48/source_java.png b/datas/icons-48/source_java.png new file mode 100644 index 0000000..150890f Binary files /dev/null and b/datas/icons-48/source_java.png differ diff --git a/datas/icons-48/source_l.png b/datas/icons-48/source_l.png new file mode 100644 index 0000000..ef5cf8c Binary files /dev/null and b/datas/icons-48/source_l.png differ diff --git a/datas/icons-48/source_moc.png b/datas/icons-48/source_moc.png new file mode 100644 index 0000000..9a941b9 Binary files /dev/null and b/datas/icons-48/source_moc.png differ diff --git a/datas/icons-48/source_o.png b/datas/icons-48/source_o.png new file mode 100644 index 0000000..4610fd4 Binary files /dev/null and b/datas/icons-48/source_o.png differ diff --git a/datas/icons-48/source_p.png b/datas/icons-48/source_p.png new file mode 100644 index 0000000..00bf673 Binary files /dev/null and b/datas/icons-48/source_p.png differ diff --git a/datas/icons-48/source_pl.png b/datas/icons-48/source_pl.png new file mode 100644 index 0000000..50d219f Binary files /dev/null and b/datas/icons-48/source_pl.png differ diff --git a/datas/icons-48/source_s.png b/datas/icons-48/source_s.png new file mode 100644 index 0000000..1c3594d Binary files /dev/null and b/datas/icons-48/source_s.png differ diff --git a/datas/icons-48/source_y.png b/datas/icons-48/source_y.png new file mode 100644 index 0000000..94b723f Binary files /dev/null and b/datas/icons-48/source_y.png differ diff --git a/datas/icons-48/spreadsheet.png b/datas/icons-48/spreadsheet.png new file mode 100644 index 0000000..3ad874e Binary files /dev/null and b/datas/icons-48/spreadsheet.png differ diff --git a/datas/icons-48/synaptic.png b/datas/icons-48/synaptic.png new file mode 100644 index 0000000..c3c52a1 Binary files /dev/null and b/datas/icons-48/synaptic.png differ diff --git a/datas/icons-48/tar.png b/datas/icons-48/tar.png new file mode 100644 index 0000000..847ddf0 Binary files /dev/null and b/datas/icons-48/tar.png differ diff --git a/datas/icons-48/template_source.png b/datas/icons-48/template_source.png new file mode 100644 index 0000000..961d1d9 Binary files /dev/null and b/datas/icons-48/template_source.png differ diff --git a/datas/icons-48/tex.png b/datas/icons-48/tex.png new file mode 100644 index 0000000..fc1f636 Binary files /dev/null and b/datas/icons-48/tex.png differ diff --git a/datas/icons-48/tgz.png b/datas/icons-48/tgz.png new file mode 100644 index 0000000..c849249 Binary files /dev/null and b/datas/icons-48/tgz.png differ diff --git a/datas/icons-48/trashcan_empty.png b/datas/icons-48/trashcan_empty.png new file mode 100644 index 0000000..0351fbb Binary files /dev/null and b/datas/icons-48/trashcan_empty.png differ diff --git a/datas/icons-48/trashcan_full.png b/datas/icons-48/trashcan_full.png new file mode 100644 index 0000000..ae0d45a Binary files /dev/null and b/datas/icons-48/trashcan_full.png differ diff --git a/datas/icons-48/tux.png b/datas/icons-48/tux.png new file mode 100644 index 0000000..e80acb6 Binary files /dev/null and b/datas/icons-48/tux.png differ diff --git a/datas/icons-48/txt.png b/datas/icons-48/txt.png new file mode 100644 index 0000000..e9bbaf0 Binary files /dev/null and b/datas/icons-48/txt.png differ diff --git a/datas/icons-48/unknown.png b/datas/icons-48/unknown.png new file mode 100644 index 0000000..205de9f Binary files /dev/null and b/datas/icons-48/unknown.png differ diff --git a/datas/icons-48/unknown2.png b/datas/icons-48/unknown2.png new file mode 100644 index 0000000..84b511f Binary files /dev/null and b/datas/icons-48/unknown2.png differ diff --git a/datas/icons-48/vcalendar.png b/datas/icons-48/vcalendar.png new file mode 100644 index 0000000..437d79e Binary files /dev/null and b/datas/icons-48/vcalendar.png differ diff --git a/datas/icons-48/vcard.png b/datas/icons-48/vcard.png new file mode 100644 index 0000000..3ae1d26 Binary files /dev/null and b/datas/icons-48/vcard.png differ diff --git a/datas/icons-48/video.png b/datas/icons-48/video.png new file mode 100644 index 0000000..6cf75fb Binary files /dev/null and b/datas/icons-48/video.png differ diff --git a/datas/icons-48/vmware.png b/datas/icons-48/vmware.png new file mode 100644 index 0000000..0b599c0 Binary files /dev/null and b/datas/icons-48/vmware.png differ diff --git a/datas/icons-48/vnc.png b/datas/icons-48/vnc.png new file mode 100644 index 0000000..67dc984 Binary files /dev/null and b/datas/icons-48/vnc.png differ diff --git a/datas/icons-48/widget_doc.png b/datas/icons-48/widget_doc.png new file mode 100644 index 0000000..5b46d55 Binary files /dev/null and b/datas/icons-48/widget_doc.png differ diff --git a/datas/icons-48/window_list.png b/datas/icons-48/window_list.png new file mode 100644 index 0000000..99dbb95 Binary files /dev/null and b/datas/icons-48/window_list.png differ diff --git a/datas/icons-48/wmaker_apps.png b/datas/icons-48/wmaker_apps.png new file mode 100644 index 0000000..8fe962c Binary files /dev/null and b/datas/icons-48/wmaker_apps.png differ diff --git a/datas/icons-48/wordprocessing.png b/datas/icons-48/wordprocessing.png new file mode 100644 index 0000000..9f771c9 Binary files /dev/null and b/datas/icons-48/wordprocessing.png differ diff --git a/datas/icons-48/www.png b/datas/icons-48/www.png new file mode 100644 index 0000000..73b276e Binary files /dev/null and b/datas/icons-48/www.png differ diff --git a/datas/icons-48/xmms2.png b/datas/icons-48/xmms2.png new file mode 100644 index 0000000..4a51e38 Binary files /dev/null and b/datas/icons-48/xmms2.png differ diff --git a/datas/icons-48/xmms_classic.png b/datas/icons-48/xmms_classic.png new file mode 100644 index 0000000..69e20d4 Binary files /dev/null and b/datas/icons-48/xmms_classic.png differ diff --git a/datas/icons-48/zip.png b/datas/icons-48/zip.png new file mode 100644 index 0000000..2ab61da Binary files /dev/null and b/datas/icons-48/zip.png differ diff --git a/datas/icons-48/zip_mount.png b/datas/icons-48/zip_mount.png new file mode 100644 index 0000000..d994ad0 Binary files /dev/null and b/datas/icons-48/zip_mount.png differ diff --git a/datas/icons-48/zip_unmount.png b/datas/icons-48/zip_unmount.png new file mode 100644 index 0000000..180c858 Binary files /dev/null and b/datas/icons-48/zip_unmount.png differ diff --git a/datas/mime.conf b/datas/mime.conf new file mode 100644 index 0000000..916c26e --- /dev/null +++ b/datas/mime.conf @@ -0,0 +1,101 @@ +# EFLTK Configuration - Version 2.000300 + +[.rpm] + Name=RPM Package + Exec=einstaller + +[.deb] + Name=DEB Package + Exec=einstaller + +[.tgz] + Name=TGZ Package + Exec=einstaller + +[.fl] + Name=Fast Light user inferface designer file + Exec=efluid + +[.fld] + Name=Fast Light user inferface designer file + Exec=efluid + +[.html] + Name=Internet WWW page + Exec=mozilla + +[.htm] + Name=Internet WWW page + Exec=mozilla + +[.mp3] + Name=Music file compressed with MP3 method + Exec=xmms + +[.bz2] + Exec= + Name=Archive file, type bz2 + +[.tar] + Exec= + Name=Archive file, type tar + +[.C] + Exec=enotepad + Name=C++ language file + +[.cpp] + Exec=enotepad + Name=C++ language file + +[.c] + Exec=enotepad + Name=C language file + +[.h] + Exec=enotepad + Name=C/C++ Include file + +[.H] + Exec=enotepad + +[.jpg] + Exec=eimgviewer + Name=Jpg image + +[.jpeg] + Exec=eimgviewer + Name=Jpeg image + +[.png] + Exec=eimgviewer + Name=Png Image file + +[.gif] + Exec=eimgviewer + Name=Gif Image file + +[.xpm] + Exec=eimgviewer + Name=Xpm image file + +[.sdw] + Name=Staroffice document + Exec=ooffice + +[.cxx] + Name=C++ language file + Exec=enotepad + +[.txt] + Name=Text file + Exec=enotepad + +[.pdf] + Name=PDF file + Exec=epdfreader + +[.m3u] + Name=M3u Playlist + Exec=alsaplayer -i ede_interface + diff --git a/datas/mimetypes.conf b/datas/mimetypes.conf new file mode 100644 index 0000000..fad8e3c --- /dev/null +++ b/datas/mimetypes.conf @@ -0,0 +1,87 @@ +# EDE mimetypes description +# +# Format: +# id|description|handler program|icon|wildcard for filename (extension)|wildcard for file command output|classic mime type +# +# - id - short string; to setup subtypes, just use slash (/) as separator in ID +# - description - what is shown in gui +# - handler program - filename will be appended, specify any needed parameters for opening - THIS WILL BE MOVED INTO SEPARATE FILE (for handling multiple programs etc.) +# - icon - just name, don't give extension or path +# - extension - will be used only if multiple types have same file command match. You don't need to give asterisk (*) i.e. .png. If there are multiple extensions, separate them with slash (/). Actually, "extension" can be any part of filename, but I can't think of use for this +# - file output - relevant part of output from `file -bLnNp $filename` +# - classic mime type - what is used for interchange i.e. text/plain - may be used for matching if other methods fail +# +# This is how mimetype resolving is supposed to work: if there is exactly one match for `file` +# output, this is what we use. If there are multiple, the largest match is used. If there are +# no results or several results with same size we look at extension, then at classic mime type +# (using -i parameter to `file`). +# +bitmap|Picture (Unknown)|eimage|image||| +bitmap/bmp|Picture (BMP)|eimage|image|.bmp|PC bitmap data|image/bmp +bitmap/gif|Picture (GIF)|eimage|image|.gif|GIF image data|image/gif +bitmap/jpeg|Picture (JPEG)|eimage|image|.jpg/.jpeg|JPEG image data|image/png +bitmap/png|Picture (PNG)|eimage|image|.png|PNG image data|image/png +bitmap/psd|Picture (Adobe PhotoShop)||image|.psd|Adobe Photoshop Image|image/x-photoshop +text|Plain text|enotepad|txt|.txt/|text|text/plain +#text/unicode|Plain text|enotepad|txt|.txt|Unicode * text|text/plain # we need wildcard support in file output :( +text/c|C code|enotepad|source_c|.c/.h|C program text|text/x-c +text/config|Program configuration|enotepad|ascii|.conf/rc|text|text/plain +text/config/xml|Program configuration (XML)|enotepad|ascii|.conf/rc|XML document text|text/xml +text/cpp|C++ code|enotepad|source_cpp|.cpp/.cxx/.h|C++ program text|text/x-c++ +text/cpp/lame|Plain text|enotepad|txt||C++ program text|text/plain +text/desktop|Shortcut|elauncher|exec|.desktop/.directory|text|text/plain +text/diff|File difference|fldiff|kmultiple|.diff/.patch|'diff' output text| +text/html|Web page (HTML)|konqueror|html|.html/.htm|HTML document text|text/html +text/html/lame|Web page (HTML)|konqueror|html|.html/.htm|text|text/html # for pages that dont have the proper headers, and are so detected as simple ascii text +text/java|Java code|enotepad|source_java|.java|Perl5 module source text|text/x-java # misdetection in find +text/php|PHP code|enotepad|source_php|.php/.php3|PHP script text|text/plain +text/po|Program translation resource|kbabel|ascii|.po|PO (gettext message catalogue) text|text/x-po +text/readme|Read this first!|enotepad|txt2|README|text|text/plain +text/script|Program (shell script)|elauncher|empty|.sh|script text|application/x-shellscript +text/script/perl|Program (Perl script)|elauncher|empty|.pl|perl script text|application/x-perl +text/xml|XML text|enotepad|txt|.xml/|XML document text|text/xml +office|Office document|ooffice2.0|document||Document| +office/db|Database|ooffice2.0|empty||| # find icon for database! +office/db/sqlite|Database (SQLite)|ooffice2.0|empty|.db|SQLite database| +office/ms|Microsoft Office document|ooffice2.0|document||Microsoft Office Document| +office/odf|Open Document Format (ODF) document|ooffice2.0|document|| +office/pdf|PDF document|xpdf|pdf|.pdf|PDF document|application/pdf +office/spread|Spreadsheet|ooffice2.0|spreadsheet||| +office/spread/ods|Spreadsheet (OpenOffice.org 2.0)|ooffice2.0|spreadsheet|.ods|Zip archive data| +office/spread/sxc|Spreadsheet (OpenOffice.org 1.x)|ooffice2.0|spreadsheet|.sxc|Zip archive data| +office/spread/xls|Spreadsheet (MS Excel)|ooffice2.0|spreadsheet|.xls|Microsoft Office Document|application/msexcel +office/word|Word document|ooffice2.0|wordprocessing||| +office/word/doc|Word document (MS Word)|ooffice2.0|wordprocessing|.doc|Microsoft Office Document|application/msword +office/word/odt|Word document (OpenOffice.org 2.0)|ooffice2.0|wordprocessing|.odt|Zip archive data| +office/word/sxw|Word document (OpenOffice.org 1.x)|ooffice2.0|wordprocessing|.sxw|Zip archive data| +empty|Empty file|enotepad|mimetypes/misc||empty| +archive|Archive||tar||archive| # Consider using the term "Compressed file(s)" +archive/bz2|Archive (BZ2)||tar|.bz2|bzip2 compressed data|application/x-gzip +archive/gz|Archive (GZ)||tar|.gz|gzip compressed data|application/x-gzip +archive/rar|Archive (RAR)||tar|.rar|RAR archive data|application/x-rar +archive/tar|Archive (TAR)||tar|.tar|tar archive|application/x-tar +archive/targz|Archive (TAR.GZ)||tar|.tar.gz|gzip compressed data|application/x-gzip +archive/tarbz2|Archive (TAR.BZ2)||tar|.tar.bz2|bzip2 compressed data|application/x-bzip2 +archive/zip|Archive (ZIP)||tar|.zip|Zip archive data|application/x-zip +install|Program installation|efiler|tgz||| +install/makefile|Program instalation (source)|einstaller|make||make commands text|text/x-makefile +install/rpm|Program installation (RPM)|einstaller|rpm|.rpm|RPM|application/x-rpm +program|Program|elauncher|empty||| +program/elf|Program|elauncher|empty||ELF 32-bit LSB executable|application/x-executable +program/elf/o|Program part||mimetypes/misc||ELF 32-bit LSB relocatable|application/x-object +program/jar|Java program|java -jar|empty|.jar|Zip archive data|application/x-zip +program/java-class|Java program|java|empty|.class|compiled Java class data| +program/swf|Macromedia Flash program|mozilla-firefox|empty|.swf|Macromedia Flash data| +video|Video|mplayer|video||video| +video/qt|Video (QuickTime)|mplayer|video|.mov|Apple QuickTime movie|video/quicktime +video/xvid|Video (XviD)|mplayer|video|.avi|video: XviD|video/x-msvideo +audio|Audio|xmms|sound||audio| +audio/mp3|Audio (MP3)|xmms|sound|.mp3|MPEG ADTS, layer III|audio/mpeg +audio/ogg|Audio (OGG)|xmms|sound|.ogg|Ogg data, Vorbis audio|application/ogg +image|Filesystem image||binary|.img|filesystem data| +image/ext2|Filesystem image (ext2)||binary|.img|ext2 filesystem data| +image/boot|Boot floppy image||3floppy_unmount|.img|x86 boot sector| +vector|Drawing (unknown)|inkscape|vectorgfx||| +vector/svg|Drawing (SVG)|inkscape|vectorgfx|.svg|XML document text| # hope they fix file to detect this properly +font|Font||font||font| +font/ttf|Font (TrueType)||font_truetype|.ttf|TrueType font data| diff --git a/datas/programs-links/Applications.directory b/datas/programs-links/Applications.directory new file mode 100644 index 0000000..0ca121e --- /dev/null +++ b/datas/programs-links/Applications.directory @@ -0,0 +1,66 @@ +[Desktop Entry] +Name=Applications +Name[sl]=Programi +Name[bg]=Ďđčëîćĺíč˙ +Name[ca]=Aplicacions +Name[cs]=Aplikace +Name[da]=Applikationer +Name[de]=Anwendungen +Name[el]=ĹöáńěďăÝň +Name[es]=Aplicaciones +Name[et]=Rakendused +Name[eu]=Aplikazioak +Name[fi]=Sovellukset +Name[fr]=Applications +Name[ga]=Feidhmchláir +Name[gl]=Aplicacións +Name[hu]=Alkalmazások +Name[it]=Applicazioni +Name[ja]=Ľ˘Ľ×ĽęĽąĄźĽˇĽçĽó +Name[ko]=ŔŔżë ÇÁˇÎą×ˇĽ +Name[nl]=Toepassingen +Name[no]=Applikasjoner +Name[pl]=Aplikacje +Name[pt]=Aplicaçőes +Name[pt_BR]=Aplicaçőes +Name[ro]=Aplicaţii +Name[ru]=đŇÉĚĎÖĹÎÉŃ +Name[sk]=Aplikácie +Name[sv]=Applikationer +Name[tr]=Uygulamalar +Name[uk]=äĎÄÁÔËÉ +Name[zh_CN.GB2312]=ÓŚÓĂłĚĘ˝ +Name[zh_TW.Big5]=ŔłĽÎľ{ŚĄ +Comment=Applications menu +Comment[sl]=Menu programov +Comment[bg]=Ďđčëîćíč ďđîăđŕěč +Comment[ca]=Menú d'aplicacions +Comment[da]=Applikationsmenu +Comment[de]=Anwendungsmenü +Comment[el]=Ěĺíďý Ĺöáńěďăţí +Comment[es]=Menú de Aplicaciones +Comment[et]=Rakendusprogrammid +Comment[eu]=Aplikazioen menua +Comment[fi]=Sovellusohjelmavalikko +Comment[fr]=Menu Applications +Comment[ga]=Clár Feidhhmchláir +Comment[gl]=Menú de Aplicacións +Comment[hu]=Alkalmazások menü +Comment[it]=Programmi applicativi +Comment[ja]=Ľ˘Ľ×ĽęĽąĄźĽˇĽçĽóĽáĽËĽĺĄź +Comment[ko]=ŔŔżë ÇÁˇÎą×ˇĽ ¸Ţ´ş +Comment[nl]=Toepassingen menu +Comment[no]=Applikasjonsmeny +Comment[pl]=Menu aplikacji +Comment[pt]=Menu das Aplicaçőes +Comment[pt_BR]=Menu das Aplicaçőes +Comment[ro]=Meniul aplicaţii +Comment[ru]=íĹÎŔ ĐŇÉĚĎÖĹÎÉĘ +Comment[sk]=Menu aplikácií +Comment[sv]=Applikationsmeny +Comment[tr]=Uygulamalar mönüsü +Comment[uk]=íĹÎŔ ÄĎÄÁÔËŚ× +Comment[zh_CN.GB2312]=ÓŚÓĂłĚʽѥľĽ +Comment[zh_TW.Big5]=ŔłĽÎľ{ŚĄżďłć +Icon=gnome-applications.png +Type=Directory diff --git a/datas/programs-links/Casino.desktop b/datas/programs-links/Casino.desktop new file mode 100644 index 0000000..70e9cc1 --- /dev/null +++ b/datas/programs-links/Casino.desktop @@ -0,0 +1,8 @@ +# EFLTK Configuration - Version 2,003000 + +[Desktop Entry] + Name=Casino + Name[sk]=Casino + Exec=ecasino + Icon=misc.png + diff --git a/datas/programs-links/Development.directory b/datas/programs-links/Development.directory new file mode 100644 index 0000000..5618064 --- /dev/null +++ b/datas/programs-links/Development.directory @@ -0,0 +1,56 @@ +[Desktop Entry] +Name=Development +Name[sl]=Razvoj +Name[bg]=Đŕçđŕáîňęŕ +Name[cs]=Vývoj +Name[da]=Programudvikling +Name[de]=Entwicklung +Name[el]=ÁíÜđôőîç ĺöáńěďăţí +Name[es]=Desarrollo +Name[fi]=Ohjelmointi +Name[fr]=Développement +Name[ga]=Forbairt +Name[gl]=Desenvolvemento +Name[hu]=Fejlesztés +Name[it]=Sviluppo +Name[ja]=łŤČŻĽÄĄźĽë +Name[lt]=Programavimas +Name[no]=Utvikling +Name[pl]=Programowanie +Name[pt_BR]=Desenvolvimento +Name[ro]=Dezvoltare +Name[sk]=Vývoj +Name[sv]=Programutveckling +Name[tr]=Uygulama yazýýlýmlarý +Name[uk]=ňĎÚŇĎÂËÁ +Name[wa]=Programaedje +Name[zh_CN.GB2312]=Číźţˇ˘Őšš¤žß +Name[zh_TW.Big5]=łnĹéľoŽi¤u¨ă +Comment=Tools for software development +Comment[sl]=Orodja za razvoj programske opreme +Comment[bg]=Číńňđóěĺíňč çŕ đŕçđŕáîňęŕ íŕ ńîôňóĺđ +Comment[cs]=Nástroje pro vývoj aplikací +Comment[da]=Vćrktřjer for programudvikling +Comment[de]=Werkzeuge zur Softwareentwicklung +Comment[el]=Ĺńăáëĺßá áíÜđôőîçň ĺöáńěďăţí +Comment[fi]=Ohjelmointityökaluja +Comment[fr]=Outils de développement logiciel +Comment[ga]=Bogearraí Fhorbairt +Comment[gl]=Utilidades para o desenvolvemento de aplicacións +Comment[hu]=Eszközök programok fejlesztéséhez +Comment[it]=Applicativi per lo sviluppo +Comment[ja]=łŤČŻ¤Î¤ż¤á¤ÎĽÄĄźĽë +Comment[lt]=Árankiai programinës árangos kűrimui +Comment[no]=Verktřy for programvareutvikling +Comment[pl]=Narzędzia do tworzenia oprogramowania +Comment[pt_BR]=Applets para desenvolvimento de software +Comment[ro]=Unelte pentru dezvoltare software +Comment[sk]=Nástroje pre vývoj softvéru +Comment[sv]=Verktyg för programutveckling +Comment[tr]=Uygulama yazmak için uygulamalar +Comment[uk]=śÎÓÔŇŐÍĹÎÔ ÄĚŃ ŇĎÚŇĎÂËÉ ĐŇĎÇŇÁÍÎĎÇĎ ÚÁÂĹÚĐĹŢĹÎÎŃ +Comment[wa]=Usteyes pol programaedje di programes +Comment[zh_CN.GB2312]=ÓĂŔ´ˇ˘ŐšČíźţľÄš¤žßłĚĘ˝ +Comment[zh_TW.Big5]=ĽÎ¨Óś}ľołnĹ骺¤u¨ăľ{ŚĄ +Icon=gnome-devel.png +Type=Directory diff --git a/datas/programs-links/Emacs.desktop b/datas/programs-links/Emacs.desktop new file mode 100644 index 0000000..64e0e24 --- /dev/null +++ b/datas/programs-links/Emacs.desktop @@ -0,0 +1,74 @@ +# EFLTK Configuration - Version 2,003000 + +[Desktop Entry] + Name=Emacs + Name[sl]=Emacs + Name[bg]=Emacs + Name[ca]=Emacs + Name[cs]=Emacs + Name[da]=Emacs + Name[de]=Emacs + Name[el]=Emacs + Name[es]=Emacs + Name[et]=Emacs + Name[eu]=Emacs + Name[fi]=Emacs + Name[fr]=Emacs + Name[ga]=Emacs + Name[gl]=Emacs + Name[it]=Emacs + Name[ja]=Emacs + Name[ko]=Ŕ̸ƽş + Name[nl]=Emacs + Name[no]=Emacs + Name[pl]=Emacs + Name[pt]=Emacs + Name[pt_BR]=Emacs + Name[ro]=Emacs + Name[ru]=Emacs + Name[sk]=Emacs + Name[sv]=Emacs + Name[tr]=Emacs + Name[uk]=Emacs + Name[wa]=Emacs + Name[zh_CN.GB2312]=Emacs + Name[zh_TW.Big5]=Emacs + Comment=Emacs text editor + Comment[sl]=Urejevalnik besedil Emacs + Comment[bg]=Emacs ňĺęńňîâ đĺäŕęňîđ + Comment[ca]=L'editor de text Emacs + Comment[cs]=Textový editor Emacs + Comment[da]=Tekstredigeringsprogrammet Emacs + Comment[de]=Der Texteditor Emacs + Comment[el]=ĹđĺîĺńăáóôŢň ęĺéěÝíďő Emacs + Comment[es]=Editor de textos Emacs + Comment[et]=tekstiredaktor Emacs + Comment[eu]=Emacs testu editorea + Comment[fi]=Emacs-editori + Comment[fr]=Éditeur de texte Emacs + Comment[ga]=Eagarthóir Teacs Emacs + Comment[gl]=Editor de texto Emacs + Comment[hu]=Emacs szövegszerkesztő + Comment[it]=Editor di testo Emacs + Comment[ja]=EmacsĽĆĽ­ĽšĽČĽ¨ĽÇĽŁĽż + Comment[ko]=Ŕ̸ƽş šŽź­ ĆíÁýąâ + Comment[nl]=Emacs tekst editor + Comment[no]=Skriveprogrammet Emacs + Comment[pl]=Edytor tekstu Emacs + Comment[pt]=Editor de texto Emacs + Comment[pt_BR]=Editor de texto Emacs + Comment[ro]=Editorul de texte Emacs + Comment[ru]=ôĹËÓÔĎ×ŮĘ ŇĹÄÁËÔĎŇ Emacs + Comment[sk]=Textový editor Emacs + Comment[sv]=Emacs texteditor + Comment[tr]=Emacs metin editörü + Comment[uk]=ôĹËÓÔĎ×ÉĘ ŇĹÄÁËÔĎŇ + Comment[wa]=L' aspougneu di tekse Emacs + Comment[zh_CN.GB2312]=Emacs ÎÄ×ֱ༩Ć÷ + Comment[zh_TW.Big5]=Emacs ¤ĺŚr˝s˝ržš + TryExec=emacs + Exec=emacs + Icon=access2.png + Terminal=0 + Type=Application + diff --git a/datas/programs-links/Eterm.desktop b/datas/programs-links/Eterm.desktop new file mode 100644 index 0000000..55690ee --- /dev/null +++ b/datas/programs-links/Eterm.desktop @@ -0,0 +1,73 @@ +# EFLTK Configuration - Version 2,003000 + +[Desktop Entry] + Name=Eterm + Name[sl]=Eterm + Name[bg]=Eterm + Name[ca]=Eterm + Name[cs]=Eterm + Name[da]=Eterm + Name[de]=Eterm + Name[el]=Eterm + Name[es]=Eterm + Name[eu]=Eterm + Name[fi]=Eterm + Name[fr]=Eterm + Name[ga]=Eterm + Name[gl]=Eterm + Name[it]=Eterm + Name[ja]=Eterm + Name[ko]=Eterm + Name[nl]=Eterm + Name[no]=Eterm + Name[pl]=Eterm + Name[pl]=Eterm + Name[pt]=Eterm + Name[pt_BR]=Eterm + Name[ro]=Eterm + Name[ru]=Eterm ÔĹŇÍÉÎÁĚ + Name[sk]=Eterm + Name[sv]=Eterm + Name[tr]=Eterm + Name[uk]=Eterm + Name[wa]=Eterm + Name[zh_CN.GB2312]=Eterm + Name[zh_TW.Big5]=Eterm + Comment=Eterm + Comment[sl]=Terminal Eterm + Comment[bg]=Eterm Ňĺđěčíŕë + Comment[ca]=Emulador de terminal Eterm + Comment[cs]=Terminálový emulátor Eterm + Comment[da]=Eterm terminalemulering + Comment[de]=Terminalemulator: Eterm + Comment[el]=ĐńďóďěďéůôŢň Ôĺńěáôéęďý Eterm + Comment[es]=Terminal Eterm + Comment[et]=Terminal Eterm + Comment[eu]=Eterm terminala + Comment[fi]=Eterm pääte-emulaattori + Comment[fr]=Émulateur de terminal Eterm + Comment[ga]=Aithriseoir teirminéal Eterm + Comment[gl]=Emulador de terminal Eterm + Comment[it]=Programma di emulazione di terminale + Comment[ja]=EtermĽżĄźĽßĽĘĽë + Comment[ko]=Eterm Ĺ͚̳Π+ Comment[nl]=Eterm terminal emulator + Comment[no]=Eterm terminalemulator + Comment[pl]=Emulator terminala Eterm + Comment[pt]=Terminal Eterm + Comment[pt_BR]=Eterm + Comment[ro]=Emulatorul de terminal Eterm + Comment[ru]=üÍŐĚŃÔĎŇ ÔĹŇÍÉÎÁĚÁ Eterm + Comment[sk]=Eterm + Comment[sv]=Eterm terminalemulator + Comment[tr]=Eterm komutasý + Comment[uk]=ĺÍŐĚŃÔĎŇ ÔĹŇÍŚÎÁĚŐ + Comment[wa]=Purnea di terminĺ Eterm + Comment[zh_CN.GB2312]=Eterm Ö՜˝ú + Comment[zh_TW.Big5]=Eterm ˛×şÝž÷ + TryExec=Eterm + Exec=Eterm + Icon=konsole.png + Terminal=0 + Type=Application + diff --git a/datas/programs-links/GIMP.desktop b/datas/programs-links/GIMP.desktop new file mode 100644 index 0000000..d88dfcb --- /dev/null +++ b/datas/programs-links/GIMP.desktop @@ -0,0 +1,87 @@ +# EFLTK Configuration - Version 2,003000 + +[Desktop Entry] + Name=The GIMP + Name[sl]=GIMP + Name[bg]=GIMP + Name[br]=GIMP + Name[ca]=El GIMP + Name[cs]=GIMP + Name[da]=GIMP'en + Name[de]=GIMP + Name[el]=Ôď GIMP + Name[es]=El GIMP + Name[et]=GIMP + Name[eu]=GIMPa + Name[fi]=GIMP + Name[fr]=Le GIMP + Name[ga]=An GIMP + Name[ga]=An GIMP + Name[gl]=O GIMP + Name[hr]=GIMP + Name[hu]=A GIMP + Name[id]=GIMP + Name[is]=GIMP + Name[it]=GIMP + Name[ja]=GIMP + Name[ko]=ąčÇÁ + Name[lt]=GIMP + Name[nl]=GIMP + Name[no]=GIMP + Name[pl]=GIMP + Name[pt]=O GIMP + Name[pt_BR]=O GIMP + Name[ro]=GIMP + Name[ru]=GIMP + Name[sk]=GIMP + Name[sk]=GIMP + Name[sv]=GIMP + Name[tr]=GIMP + Name[uk]=GIMP + Name[zh_CN.GB2312]=GIMP + Name[zh_TW.Big5]=GIMP + Comment=GNU Image Manipulation Program + Comment[sl]=Program za manipuliranje s slikami GNU + Comment[bg]=Ďđîăđŕěŕ çŕ Îáđŕáîňęŕ íŕ Čçîáđŕćĺíč˙ / GNU + Comment[br]=Goulev GNU Dazverad Skeudennoů + Comment[ca]=El programa de manipulació d'imatges GNU + Comment[cs]=Program pro úpravu obrázků + Comment[da]=Tegne- og billedbehandlingprogram + Comment[de]=Das GNU-Bildbearbeitungsprogramm + Comment[el]=Đńüăńáěěá Ĺđĺîĺńăáóßáň Ĺéęüíůí GNU + Comment[es]=Programa de manipulación de imágenes GNU + Comment[et]=GNU pilditöötlusprogramm + Comment[eu]=GNU imaginak eraldatzeko programa + Comment[fi]=GIMP-kuvankäsittelyohjelma + Comment[fr]=Le Programme de Manipulation d'Images GNU + Comment[ga]=Ríomhchlár láimhsiú íomhá GNU + Comment[ga]=Ríomhchlar láimhsiú Pictuirí GNC + Comment[gl]=O Programa de Edición de Imaxes de GNU + Comment[hr]=Program za obradu forografija pod GNU licencom + Comment[hu]=GNU képfeldolgozó program + Comment[id]=GNU Image Manipulation Program + Comment[is]=GNU Myndvinnsluforrit + Comment[it]=Programma di Manipolazione Immagini GNU + Comment[ja]=GNU˛čÁüĘÔ˝¸Ľ×ĽíĽ°ĽéĽŕ + Comment[ko]=GNU ą×¸˛ ĆíÁý ÇÁˇÎą×ˇĽ + Comment[lt]=GNU atvaizdř apdorojimo programa + Comment[nl]=GNU beeldverwerkingsprogramma + Comment[no]=GNU bildebehandlingsprogram + Comment[pl]=Zaawansowany program graficzny + Comment[pt]=Programa de Ediçăo de Imagens GNU + Comment[pt_BR]=Programa de Ediçăo de Imagens GNU + Comment[ro]=Program GNU pentru manipulare de imagine + Comment[ru]=đŇĎÇŇÁÍÍÁ ÍÁÎÉĐŐĚŃĂÉÉ ÉÚĎÂŇÁÖĹÎÉŃ GNU + Comment[sk]=GNU Program pre spracovanie obrázkov + Comment[sv]=GNU Image Manipulation Program + Comment[tr]=GNU Resim deđiţtirme uygulamasý + Comment[uk]=đŇĎÇŇÁÍÁ GNU ÍÁÎŚĐŐĚŃĂŚ§ ÚĎÂŇÁÖĹÎÎŃÍ + Comment[wa]=Li programe da GNU po-z aspougnî des imĺdjes + Comment[zh_CN.GB2312]=GNU Ó°Ďó´ŚŔíłĚĘ˝ + Comment[zh_TW.Big5]=GNU źvšłłB˛zľ{ŚĄ + TryExec=gimp + Exec=gimp + Icon=gimp2.png + Terminal=0 + Type=Application + diff --git a/datas/programs-links/Games.directory b/datas/programs-links/Games.directory new file mode 100644 index 0000000..f6064b7 --- /dev/null +++ b/datas/programs-links/Games.directory @@ -0,0 +1,69 @@ +[Desktop Entry] +Name=Games +Name[sl]=Igre +Name[bg]=Čăđč +Name[ca]=Jocs +Name[cs]=Hry +Name[da]=Underholdning +Name[de]=Spiele +Name[el]=Đáé÷íßäéá +Name[es]=Juegos +Name[et]=Mängud +Name[eu]=Jokuak +Name[fi]=Pelit +Name[fr]=Jeux +Name[gl]=Xogos +Name[hu]=Játékok +Name[it]=Giochi +Name[ja]=Ľ˛ĄźĽŕ +Name[ko]=°ÔŔÓ +Name[nl]=Spelletjes +Name[no]=Spill +Name[pl]=Gry +Name[pt]=Jogos +Name[pt_BR]=Jogos +Name[ro]=Jocuri +Name[ru]=éÇŇŮ +Name[sk]=Hry +Name[sk]=Hry +Name[sv]=Spel +Name[tr]=Oyunlar +Name[uk]=śÇŇÉ +Name[wa]=Djeus +Name[zh_CN.GB2312]=ÓÎŔÖłĄ +Name[zh_TW.Big5]=šCźÖłő +Name]ga]=Cluichí +Comment=Games menu +Comment[sl]=Menu iger +Comment[bg]=Ěĺíţ ń čăđč +Comment[ca]=Menú de jocs +Comment[da]=Diverse computerspil +Comment[de]=Spielemenü +Comment[el]=Ěĺíďý đáé÷íéäéţí +Comment[es]=Menú de Juegos +Comment[et]=Mängude menüü +Comment[eu]=Jokuen menua +Comment[fi]=Pelivalikko +Comment[fr]=Menu des jeux +Comment[ga]=Chlár Chluichí +Comment[gl]=Menú de Xogos +Comment[hu]=Játékok menü +Comment[it]=Applicativi ludici +Comment[ja]=Ľ˛ĄźĽŕĽáĽËĽĺĄź +Comment[ko]=°ÔŔÓ ¸Ţ´ş +Comment[nl]=Spelletjes menu +Comment[no]=Spillmeny +Comment[pl]=Menu gier +Comment[pt]=Menu de Jogos +Comment[pt_BR]=Menu de Jogos +Comment[ro]=Meniul Jocuri +Comment[ru]=íĹÎŔ ÉÇŇ +Comment[sk]=Menu hier +Comment[sv]=Spelmeny +Comment[tr]=Oyunlar mönüsü +Comment[uk]=íĹÎŔ ŚÇŇ +Comment[wa]=Djeus di Gnome +Comment[zh_CN.GB2312]=ÓÎŔÖłĄŃĄľĽ +Comment[zh_TW.Big5]=šCźÖłőżďłć +Icon=gnome-joystick.png +Type=Directory diff --git a/datas/programs-links/Graphics.directory b/datas/programs-links/Graphics.directory new file mode 100644 index 0000000..58aa511 --- /dev/null +++ b/datas/programs-links/Graphics.directory @@ -0,0 +1,69 @@ +[Desktop Entry] +Name=Graphics +Name[sl]=Grafika +Name[bg]=Ăđŕôčęŕ +Name[ca]=Grŕfics +Name[cs]=Grafika +Name[da]=Grafik +Name[de]=Grafik +Name[el]=ĂńáöéęÜ +Name[es]=Gráficos +Name[et]=Graafika +Name[eu]=Grafikoak +Name[fi]=Grafiikka +Name[fr]=Graphisme +Name[ga]=Graphice +Name[gl]=Gráficos +Name[hu]=Grafika +Name[it]=Grafica +Name[ja]=Ľ°ĽéĽŐĽŁĽĂĽŻ +Name[ko]=ą×ˇĄÇČ +Name[nl]=Grafisch +Name[no]=Grafikk +Name[pl]=Grafika +Name[pt]=Gráficos +Name[pt_BR]=Gráficos +Name[ro]=Grafică +Name[ru]=çŇÁĆÉËÁ +Name[sk]=Grafika +Name[sk]=Grafika +Name[sv]=Grafik +Name[tr]=Grafik +Name[uk]=çŇÁĆŚËÁ +Name[wa]=Grafikes +Name[zh_CN.GB2312]=ĂŔš¤ťćÍź +Name[zh_TW.Big5]=Źü¤uøšĎ +Comment=Graphics menu +Comment[sl]=Menu grafike +Comment[bg]=Ěĺíţ ń ăđŕôč÷íč ďđîăđŕěč +Comment[ca]=Menú de programes per treballar amb imatges +Comment[da]=Grafikprogrammer +Comment[de]=Grafikmenü +Comment[el]=Ěĺíďý đńďăńáěěÜôůí ó÷ĺôéęţí ěĺ ăńáöéęÜ +Comment[es]=Menú de programas relacionados con gráficos +Comment[et]=Graafikaprogrammid +Comment[eu]=Grafikoen menua +Comment[fi]=Grafiikkaohjelmavalikko +Comment[fr]=Programmes ayant trait au graphisme et ŕ l'imagerie +Comment[ga]=Clár Graphice +Comment[gl]=Menú de programas para traballar con imaxes +Comment[hu]=Grafikai alkalmazások +Comment[it]=Applicativi di grafica +Comment[ja]=Ľ°ĽéĽŐĽŁĽĂĽŻĽáĽËĽĺĄź +Comment[ko]=ą×ˇĄÇČ ¸Ţ´ş +Comment[nl]=Grafische programma's +Comment[no]=Grafikkmeny +Comment[pl]=Programy graficzne +Comment[pt]=Menu de programas relacionados com gráficos +Comment[pt_BR]=Menu de Arquivos Gráficos +Comment[ro]=Meniul Grafică +Comment[ru]=íĹÎŔ ÇŇÁĆÉŢĹÓËÉČ ĐŇĎÇŇÁÍÍ +Comment[sk]=Menu programov pre grafiku +Comment[sv]=Grafikmeny +Comment[tr]=Grafik uygulamalarý +Comment[uk]=íĹÎŔ ÇŇÁĆŚŢÎÉČ ĐŇĎÇŇÁÍ +Comment[wa]=Programes grafikes čt dessinaedjes +Comment[zh_CN.GB2312]=ĂŔš¤ťć͟ѥľĽ +Comment[zh_TW.Big5]=Źü¤uøšĎżďłć +Icon=gnome-graphics.png +Type=Directory diff --git a/datas/programs-links/Internet.directory b/datas/programs-links/Internet.directory new file mode 100644 index 0000000..cf08e32 --- /dev/null +++ b/datas/programs-links/Internet.directory @@ -0,0 +1,66 @@ +[Desktop Entry] +Name=Internet +Name[sl]=Internet +Name[bg]=Číňĺđíĺň +Name[ca]=Internet +Name[cs]=Síť +Name[da]=Internet +Name[de]=Netzwerk +Name[el]=Äßęôőď +Name[es]=Red +Name[et]=Internet +Name[eu]=Internet +Name[fi]=Internet +Name[fr]=Réseau +Name[ga]=Idirlíon +Name[gl]=Internet +Name[hu]=Hálózat +Name[it]=Rete +Name[ja]=Ľ¤ĽóĽżĄźĽÍĽĂĽČ +Name[ko]=ŔÎĹÍłÝ +Name[no]=Internett +Name[pl]=Sieć +Name[pt]=Rede +Name[pt_BR]=Internet +Name[ro]=Internet +Name[ru]=éÎÔĹŇÎĹÔ +Name[sk]=Sieť +Name[sv]=Internet +Name[tr]=Internet +Name[uk]=śÎÔĹŇÎĹÔ +Name[wa]=Rantoele +Name[zh_CN.GB2312]=ÍřźĘÍř¡ +Name[zh_TW.Big5]=şôťÚşô¸ô +Comment=Programs for Internet and networks +Comment[sl]=Programi za Internet in omrežja +Comment[bg]=Ďđîăđŕěč çŕ Číňĺđíĺň č Ěđĺćč +Comment[ca]=Ferramentres per treballar amb La Xarxa +Comment[da]=Progammer for Internet og netvćrk +Comment[de]=Programme für Netzwerk oder Internet +Comment[el]=ĐńďăńÜěěáôá ÉíôĺńíÝô ęáé äéęôýůí +Comment[es]=Programas para redes e Internet +Comment[et]=Internetiprogrammid +Comment[eu]=Internet +Comment[fi]=Internet-valikko +Comment[fr]=Programmes pour réseaux et Internet +Comment[ga]=Bogearraí Idirlíon +Comment[gl]=Programas para Internet e redes +Comment[hu]=Internetes, hálózati alkalmazások +Comment[it]=Applicativi di rete +Comment[ja]=Ľ¤ĽóĽżĄźĽÍĽĂĽČ¤äĽÍĽĂĽČĽďĄźĽŻ¤Ë´Ř¤š¤ëĽ×ĽíĽ°ĽéĽŕ +Comment[ko]=ŔÎĹÍłÝ ¸Ţ´ş +Comment[no]=Programmer for bruk av internett-tjenester +Comment[pl]=Oprogramowanie sieciowe +Comment[pt_BR]=Programas para Internet e Redes +Comment[ro]=Programe pentru Internet şi reţele +Comment[ru]=íĹÎŔ éÎÔĹŇÎĹÔ +Comment[sk]=Programy pre Internet a siete +Comment[sv]=Program för internetanvändning +Comment[tr]=Internet uygulamarý +Comment[uk]=íĹÎŔ ĐŇĎÇŇÁÍ ÄĚŃ ÍĹŇĹÖ +Comment[wa]=Programes po naivyî čt ovrer sol rantoele daegnrece +Comment[zh_CN.GB2312]=Íř¡ź°ÍřźĘÍř¡ĎŕšŘÓŚÓĂłĚĘ˝ +Comment[zh_TW.Big5]=şô¸ô¤ÎşôťÚşô¸ôŹŰĂöŔłĽÎľ{ŚĄ +Icon=gnome-networktool.png +Type=Directory + diff --git a/datas/programs-links/Kterm.desktop b/datas/programs-links/Kterm.desktop new file mode 100644 index 0000000..829ab47 --- /dev/null +++ b/datas/programs-links/Kterm.desktop @@ -0,0 +1,69 @@ +# EFLTK Configuration - Version 2,003000 + +[Desktop Entry] + Name=Kanji terminal + Name[sl]=Terminal Kanji + Name[bg]=Ęŕíäćč Ňĺđěčíŕë + Name[ca]=Terminal Kanji + Name[cs]=Kanji terminál + Name[da]=Kanji-terminal + Name[de]=Kanji-Terminal + Name[el]=Ôĺńěáôéęü Kanji + Name[es]=Terminal Kanji + Name[et]=Kanji terminal + Name[eu]=Kanji terminala + Name[fi]=Kanji-pääte-emulaattori + Name[fr]=Terminal Kanji + Name[ga]=Teirminéal Kanji + Name[gl]=Terminal Kanji + Name[it]=Terminale Kanji + Name[ja]=ĆüËܸěĂźËö (kterm) + Name[ko]=°ŁÁö Ĺ͚̳Π+ Name[nl]=Kanji terminal + Name[no]=Kanjii terminal + Name[pl]=Terminal Kanji + Name[pt]=Terminal Kanji + Name[pt_BR]=Terminal Kanji + Name[ro]=Terminal Kanji + Name[ru]=ôĹŇÍÉÎÁĚ ëÁÎÖÉ + Name[sk]=Kanji terminál + Name[sv]=Kanji-terminal + Name[tr]=Kanji komutasý + Name[uk]=ôĹŇÍŚÎÁĚ ëÁÎÖŚ + Name[wa]=Terminĺ djapončs + Comment=Japanese terminal emulation program + Comment[sl]=Japonski emulator terminala + Comment[bg]=ßďîíńęŕ ňĺđěčíŕëíŕ ďđîăđŕěŕ + Comment[ca]=Emulador de terminal japonés (kanji) + Comment[cs]=Emulátor terminálu s podporou japonského písma + Comment[da]=Japansk teminalemulering + Comment[de]=Terminalemulator für japanische Kanji-Schrift + Comment[el]=Đńďóďěďßůóç Ôĺńěáôéęďý Kanji (éäĺďăńáöéęü) + Comment[es]=Emulador de terminal japonés (ideográfico) + Comment[et]=Jaapanikeelne teminal (kanji) + Comment[eu]=Idazkera ideografikoaren emulatzailea + Comment[fi]=Japaninkielinen pääte-emulaattori + Comment[fr]=Émulateur de terminal japonais (caractčres kanji) + Comment[ga]=Riomhchlár Teirminéal Seapáinis + Comment[gl]=Emulador de terminal Xaponés + Comment[it]=Emulatore di terminale giapponese + Comment[ja]=ĆüËܸ켿ĄźĽßĽĘĽëĽ¨ĽßĽĺĽěĄźĽż + Comment[ko]=ŔĎşťžî Ĺ͚̳ΠżĄšÄˇšŔĚźÇ ÇÁˇÎą×ˇĽ + Comment[nl]=Japanse terminal emulatie + Comment[no]=Japansk teminalemulator + Comment[pl]=Japoński emulator terminala (kanji) + Comment[pt]=Programa de emulaçăo de terminal Japonęs + Comment[pt_BR]=Programa de emulaçăo de terminal japonęs + Comment[ro]=Emulator de terminal japonez + Comment[ru]=ńĐĎÎÓËÉĘ ÔĹŇÍÉÎÁĚ + Comment[sk]=Emulátor japonského terminálu + Comment[sv]=Japansk terminalemulator + Comment[tr]=Japon komutasý + Comment[uk]=ńĐĎÎÓŘËÉĘ ĹÍŐĚŃÔĎŇ ÔĹŇÍŚÎÁĚŐ + Comment[wa]=Terminĺ ki eploye les caractčres djapončs + TryExec=kterm + Exec=kterm + Icon=konsole.png + Terminal=0 + Type=Application + diff --git a/datas/programs-links/Makefile b/datas/programs-links/Makefile new file mode 100644 index 0000000..7dc113e --- /dev/null +++ b/datas/programs-links/Makefile @@ -0,0 +1,157 @@ + +include ../../makeinclude + +appsdir = $(datadir)/ede/programs + +Rootdir = $(appsdir) +Applicationsdir = $(appsdir)/Applications +Developmentdir = $(appsdir)/Development +Graphicsdir = $(appsdir)/Graphics +Systemdir = $(appsdir)/System +Utilitiesdir = $(appsdir)/Utilities +Multimediadir = $(appsdir)/Multimedia +Internetdir = $(appsdir)/Internet +Gamesdir = $(appsdir)/Games +Settingsdir = $(appsdir)/Settings + +Directory_files = \ + Root.directory \ + Applications.directory \ + Graphics.directory \ + System.directory \ + Utilities.directory \ + Multimedia.directory \ + Internet.directory \ + Games.directory \ + Development.directory \ + Settings.directory + +Multimedia_DATA = \ + alsaplayer.desktop \ + ecdplayer.desktop \ + esoundmixer.desktop \ + mplayer.desktop \ + realplayer.desktop \ + xmms.desktop \ + x11amp.desktop + + +Utilities_DATA = \ + calc.desktop \ + finder.desktop \ + fstabedit.desktop \ + sccalc.desktop \ + tips.desktop \ + xmag.desktop + +Applications_DATA = \ + abiword.desktop \ + Emacs.desktop \ + lyx.desktop \ + notepad.desktop \ + ooffice.desktop \ + Vim.desktop \ + WordPerfect.desktop \ + Xemacs.desktop + +Graphics_DATA = \ + acroread.desktop \ + eimgviewer.desktop \ + GIMP.desktop \ + gv.desktop \ + xdvi.desktop \ + xpdf.desktop \ + xsane.desktop + +System_DATA = \ + Eterm.desktop \ + Kterm.desktop \ + UNIX.desktop \ + UNIX-regular.desktop \ + Vnterm.desktop \ + rxvt.desktop + +Settings_DATA = \ + colorsconf.desktop \ + control.desktop \ + edisplayconf.desktop \ + ehardware.desktop \ + eiconconf.desktop \ + epanelconf.desktop \ + etimedate.desktop \ + ewmconf.desktop \ + printers.desktop \ + scrsaver.desktop + + +Internet_DATA = \ + dialup.desktop \ + lynx.desktop \ + Mozilla.desktop \ + Netscape.desktop \ + Opera.desktop \ + postoffice.desktop + +Development_DATA = \ + cooledit.desktop \ + fluid.desktop \ + xwpe.desktop \ + xxgdb.desktop + +Root_DATA = + +Games_DATA = \ + Casino.desktop \ + lbreak.desktop \ + Mastermind.desktop \ + Qubix.desktop \ + xbill.desktop + + +# simple function for easier maintenance +# $(1) is a directory +# $(2) is a list of files + +INSTALL_LOOP=\ + $(MKINSTALLDIRS) $(1);\ + for f in $(2); do\ + $(INSTALL_DATA) $$f $(1);\ + done + +install: + $(call INSTALL_LOOP, $(Applicationsdir), $(Applications_DATA)) + $(call INSTALL_LOOP, $(Graphicsdir), $(Graphics_DATA)) + $(call INSTALL_LOOP, $(Utilitiesdir), $(Utilities_DATA)) + $(call INSTALL_LOOP, $(Systemdir), $(System_DATA)) + $(call INSTALL_LOOP, $(Multimediadir), $(Multimedia_DATA)) + $(call INSTALL_LOOP, $(Internetdir), $(Internet_DATA)) + $(call INSTALL_LOOP, $(Gamesdir), $(Games_DATA)) + $(call INSTALL_LOOP, $(Settingsdir), $(Settings_DATA)) + $(call INSTALL_LOOP, $(Rootdir), $(Root_DATA)) + $(call INSTALL_LOOP, $(Developmentdir), $(Development_DATA)) + + $(INSTALL_DATA) Root.directory $(Rootdir)/.directory + $(INSTALL_DATA) Applications.directory $(Applicationsdir)/.directory + $(INSTALL_DATA) Graphics.directory $(Graphicsdir)/.directory + $(INSTALL_DATA) System.directory $(Systemdir)/.directory + $(INSTALL_DATA) Utilities.directory $(Utilitiesdir)/.directory + $(INSTALL_DATA) Multimedia.directory $(Multimediadir)/.directory + $(INSTALL_DATA) Internet.directory $(Internetdir)/.directory + $(INSTALL_DATA) Games.directory $(Gamesdir)/.directory + $(INSTALL_DATA) Settings.directory $(Settingsdir)/.directory + $(INSTALL_DATA) Development.directory $(Developmentdir)/.directory + + +uninstall: + $(RM) -r $(Applicationsdir) + $(RM) -r $(Graphicsdir) + $(RM) -r $(Utilitiesdir) + $(RM) -r $(Systemdir) + $(RM) -r $(Multimediadir) + $(RM) -r $(Internetdir) + $(RM) -r $(Gamesdir) + $(RM) -r $(Settingsdir) + $(RM) -r $(Rootdir) + $(RM) -r $(Developmentdir) + +clean: diff --git a/datas/programs-links/Mastermind.desktop b/datas/programs-links/Mastermind.desktop new file mode 100644 index 0000000..a1e29af --- /dev/null +++ b/datas/programs-links/Mastermind.desktop @@ -0,0 +1,8 @@ +# EFLTK Configuration - Version 2,003000 + +[Desktop Entry] + Name=Master mind + Name[sk]=Master mind + Exec=emastermind + Icon=misc.png + diff --git a/datas/programs-links/Mozilla.desktop b/datas/programs-links/Mozilla.desktop new file mode 100644 index 0000000..d52d893 --- /dev/null +++ b/datas/programs-links/Mozilla.desktop @@ -0,0 +1,8 @@ +# EFLTK Configuration - Version 2,003000 + +[Desktop Entry] + Name=Mozilla + Name[sk]=Mozilla + Exec=mozilla + Icon=mozilla.png + diff --git a/datas/programs-links/Multimedia.directory b/datas/programs-links/Multimedia.directory new file mode 100644 index 0000000..b78534d --- /dev/null +++ b/datas/programs-links/Multimedia.directory @@ -0,0 +1,67 @@ +[Desktop Entry] +Name=Multimedia +Name[sl]=Večpredstavnost +Name[bg]=Ěóëňčěĺäč˙ +Name[ca]=Multimčdia +Name[cs]=Multimédia +Name[da]=Multimedia +Name[de]=Multimedia +Name[el]=ĐďëőěÝóá +Name[es]=Multimedios +Name[es_ES]=Multimedia +Name[et]=Multimeedia +Name[eu]=Multimedia +Name[fi]=Multimedia +Name[fr]=Multimédia +Name[ga]=Ilmheánach +Name[gl]=Multimedia +Name[hu]=Multimédia +Name[it]=Multimedia +Name[ja]=ĽŢĽëĽÁĽáĽÇĽŁĽ˘ +Name[ko]=¸ÖĆźšĚľđžî +Name[no]=Multimedia +Name[pl]=Multimedia +Name[pt]=Multimédia +Name[pt_BR]=Multimídia +Name[ro]=Multimedia +Name[ru]=íŐĚŘÔÉÍĹÄÉŃ +Name[sk]=Multimédiá +Name[sv]=Multimedia +Name[tr]=Ses vs. +Name[uk]=íŐĚŘÔÉÍĹÄŚÁ +Name[zh_CN.GB2312]=śŕĂ˝Ěĺ +Name[zh_TW.Big5]=Śh´CĹé +Comment=Multimedia menu +Comment[sl]=Menu večpredstavnosti +Comment[bg]=Ěĺíţ ń ěóëňčěĺäčéíč ďđîăđŕěč +Comment[ca]=Menú de ferramentes multimčdia +Comment[da]=Multimedieprogrammer +Comment[de]=Multimedia-Programme +Comment[el]=ĐńďăńÜěěáôá ĐďëőěÝóůí +Comment[es]=Programas multimedios +Comment[es_ES]=Programas multimedia +Comment[et]=Multimeediaprogrammid +Comment[eu]=Multimedia menua +Comment[fi]=Multimediavalikko +Comment[fr]=Programmes multimédia +Comment[ga]=Clár Ilmheánach +Comment[gl]=Programas multimedia +Comment[hu]=Multimédiás alkalmazások +Comment[it]=Applicativi multimediali +Comment[it]=Programmi multimediali +Comment[it]=Programmi multimediali +Comment[ja]=ĽŢĽëĽÁĽáĽÇĽŁĽ˘¤ň°ˇ¤ŚĽ×ĽíĽ°ĽéĽŕ +Comment[ko]=¸ÖĆźšĚľđžî ¸Ţ´ş +Comment[no]=Multimedia meny +Comment[pl]=Menu multimediów +Comment[pt_BR]=Menu de multimídias +Comment[ro]=Meniul Multimedia +Comment[ru]=íĹÎŔ íŐĚŘÔÉÍĹÄÉÁ +Comment[sk]=Menu multimédií +Comment[sv]=Multimediaprogram +Comment[tr]=Ses vesaire için uygulamalar +Comment[uk]=íĹÎŔ ĐŇĎÇŇÁÍ ÄĚŃ ÍŐĚŘÍĹÄŚÁ +Comment[zh_CN.GB2312]=śŕĂ˝ĚĺŃĄľĽ +Comment[zh_TW.Big5]=Śh´CĹéżďłć +Icon=gnome-multimedia.png +Type=Directory diff --git a/datas/programs-links/Netscape.desktop b/datas/programs-links/Netscape.desktop new file mode 100644 index 0000000..b643b26 --- /dev/null +++ b/datas/programs-links/Netscape.desktop @@ -0,0 +1,83 @@ +# EFLTK Configuration - Version 2,003000 + +[Desktop Entry] + Name=Netscape + Name[sl]=Netscape + Name[bg]=Netscape + Name[ca]=Netscape + Name[cs]=Netscape + Name[da]=Netscape + Name[de]=Netscape + Name[el]=Netscape + Name[es]=Netscape + Name[et]=netscape + Name[eu]=Netscape + Name[fi]=Netscape + Name[fr]=Netscape + Name[ga]=Netscape + Name[gl]=Netscape + Name[hr]=Netscape + Name[hu]=Netscape + Name[id]=Netscape + Name[it]=Netscape + Name[ja]=ĽÍĽĂĽČĽšĽąĄźĽ× + Name[ko]=łÝ˝şÄÉŔĚÇÁ + Name[nl]=Netscape + Name[no]=Netscape + Name[pl]=Netscape + Name[pt]=Netscape + Name[pt_BR]=Netscape + Name[ro]=Netscape + Name[ru]=Netscape + Name[sk]=Netscape + Name[sv]=Netscape + Name[tr]=Netscape + Name[uk]=Netscape + Name[wa]=Netscape + Name[zh_CN.GB2312]=Netscape + Name[zh_TW.Big5]=Netscape + Comment=Netscape browser + Comment[sl]=Brskalnik Netscape + Comment[bg]=Netscape Íŕâčăŕňîđ + Comment[br]=Merdeer Netscape + Comment[ca]=Navegador d'Internet Netscape + Comment[cs]=Prohlížeč HTML souborů umístěných na Síti nebo disku + Comment[da]=Netscape-netsurfningsprogram + Comment[de]=Netscape Navigator + Comment[el]=ÖőëëďěĺôńçôŢň Netscape + Comment[es]=Navegador Netscape + Comment[et]=WWW lehitseja Netscape + Comment[eu]=Netscape Nabigatzailea + Comment[fi]=Netscape-internetselain + Comment[fr]=Navigateur Netscape + Comment[ga]=Líonléitheoir Netscape + Comment[ga]=Súiladóir Idirlíon Netscape + Comment[gl]=Navegador Netscape + Comment[hr]=Netscape preglednik + Comment[hu]=Netscape Navigátor + Comment[id]=Browser Netscape Navigator + Comment[is]=Netscape Navigator vafri + Comment[it]=Netscape Navigator + Comment[ja]=ĽÍĽĂĽČĽšĽąĄźĽ×ĄŚĽÖĽéĽŚĽś + Comment[ko]=łÝ˝şÄÉŔĚÇÁ ŔĽşęśóżěŔú + Comment[lt]=Netscape Narđyklë + Comment[nl]=Netscape Navigator + Comment[no]=Netscape nettleser + Comment[pl]=Przeglądarka Netscape + Comment[pt]=Browser Netscape Navigator + Comment[pt_BR]=Navegador Netscape + Comment[ro]=Browser Netscape + Comment[ru]=Web ÎÁ×ÉÇÁÔĎŇ Netscape + Comment[sk]=Prehliadač Netscape + Comment[sv]=Webbläsaren Netscape + Comment[tr]=Netscape internet gezgini + Comment[uk]=îÁ׌ÇÁÔĎŇ Netscape + Comment[wa]=Netscape, li betcheu del rantoele daegnrece + Comment[zh_CN.GB2312]=Netscape äŻŔŔĆ÷ + Comment[zh_TW.Big5]=Netscape ÂsÄýžš + TryExec=netscape + Exec=netscape + Icon=netscape.png + Terminal=0 + Type=Application + diff --git a/datas/programs-links/Opera.desktop b/datas/programs-links/Opera.desktop new file mode 100644 index 0000000..d4423ab --- /dev/null +++ b/datas/programs-links/Opera.desktop @@ -0,0 +1,8 @@ +# EFLTK Configuration - Version 2,003000 + +[Desktop Entry] + Name=Opera + Name[sk]=Opera + Exec=opera + Icon=opera.png + diff --git a/datas/programs-links/Qubix.desktop b/datas/programs-links/Qubix.desktop new file mode 100644 index 0000000..e4a729c --- /dev/null +++ b/datas/programs-links/Qubix.desktop @@ -0,0 +1,8 @@ +# EFLTK Configuration - Version 2,003000 + +[Desktop Entry] + Name=Qubix + Name[sk]=Qubix + Exec=equbix + Icon=misc.png + diff --git a/datas/programs-links/Root.directory b/datas/programs-links/Root.directory new file mode 100644 index 0000000..7137458 --- /dev/null +++ b/datas/programs-links/Root.directory @@ -0,0 +1,56 @@ +[Desktop Entry] +Name=Programs +Name[sl]=Programi +Name[bg]=Ďđîăđŕěč +Name[da]=Programmer +Name[de]=Programme +Name[el]=ĐńďăńÜěěáôá +Name[es]=Programas +Name[et]=Programmid +Name[fi]=Ohjelmat +Name[fr]=Programmes +Name[ga]=Bogearraí +Name[gl]=Programas +Name[hu]=Programok +Name[it]=Programmi +Name[ja]=Ľ×ĽíĽ°ĽéĽŕ +Name[lt]=Programos +Name[no]=Programmer +Name[pl]=Programy +Name[pt_BR]=Programas +Name[ro]=Programe +Name[sk]=Programy +Name[sv]=Program +Name[tr]=Uygulamalar +Name[uk]=đŇĎÇŇÁÍÉ +Name[wa]=Programes +Name[zh_TW.Big5]=ľ{ŚĄ +Comment=Programs menu +Comment[sl]=Menu programov +Comment[bg]=Ďđîăđŕěíî ěĺíţ +Comment[da]=Programmmenu +Comment[de]=Programmmenü +Comment[el]=Ěĺíďý đńďăńáěěÜôůí +Comment[es]=Menú de programes +Comment[et]=Programmide menüü +Comment[fi]=Ohjelmavalikko +Comment[ga]=Clár ríomhchlár +Comment[gl]=Menú de programas +Comment[gl]=Menú de programas +Comment[hu]=Porgramok menüje +Comment[it]=Menu applicazioni +Comment[ja]=Ľ×ĽíĽ°ĽéĽŕĽáĽËĽĺĄź +Comment[lt]=Programř meniu +Comment[no]=Programmeny +Comment[pl]=Menu programów +Comment[pt_BR]=Menu de Programas +Comment[pt_BT]=Menú de programas +Comment[ro]=Meniul Programe +Comment[sk]=Menu programov +Comment[sv]=Programmeny +Comment[tr]=Uygulamalar +Comment[uk]=íĹÎŔ ĐŇĎÇŇÁÍ +Comment[wa]=Menu des programes +Comment[zh_TW.Big5]=ľ{ŚĄżďłć +Icon=gnome-folder.png +Type=Directory diff --git a/datas/programs-links/Settings.directory b/datas/programs-links/Settings.directory new file mode 100644 index 0000000..2e2cf9c --- /dev/null +++ b/datas/programs-links/Settings.directory @@ -0,0 +1,67 @@ +[Desktop Entry] +Name=Settings +Name[sl]=Nastavitve +Name[bg]=Íŕńňđîéęč +Name[ca]=Configuració +Name[cs]=Nastavení +Name[da]=Opsćtning +Name[de]=Konfiguration +Name[el]=Ńőčěßóĺéň +Name[es]=Configuración +Name[et]=Häälestus +Name[eu]=Aukerak +Name[fi]=Asetukset +Name[fr]=Paramčtres +Name[ga]=Cumraíocht +Name[gl]=Configuración +Name[hu]=Beállítások +Name[it]=Impostazioni +Name[ja]=ĽÇĽšĽŻĽČĽĂĽ×ŔßÄę +Name[ko]=źłÁ¤ +Name[lt]=Nuostatos +Name[no]=Innstillinger +Name[pl]=Ustawienia +Name[pt_BR]=Configuraçőes +Name[ro]=Setări +Name[ru]=îÁÓÔŇĎĘËÉ +Name[sk]=Nastavenie +Name[sv]=Inställningar +Name[tr]=Ayarlar +Name[uk]=őÓÔÁÎĎ×ËÉ +Name[wa]=Apontiaedjes +Name[zh_CN.GB2312]=É蜨 +Name[zh_TW.Big5]=ł]Šw +Comment=Desktop Settings +Comment[sl]=Nastavitve namizja +Comment[bg]=Íŕńňđîéęč íŕ ńđĺäŕňŕ +Comment[ca]=Configuració de l'escriptori +Comment[cs]=Konfigurace a nastavení v systému +Comment[da]=Skrivebordsindstillinger +Comment[de]=Konfiguration des Desktops +Comment[el]=Ńőčěßóĺéň ĺđéöÜíĺéáň ĺńăáóßáň +Comment[es]=Configuración del área de trabajo +Comment[et]=Häälestusprogrammid +Comment[eu]=Erakuslehioaren aukerak +Comment[fi]=Työpöydän asetukset +Comment[fr]=Paramčtres du bureau +Comment[ga]=Cumraíocht Barr Deisce +Comment[gl]=Configuración dos Escritorios +Comment[hu]=Felület beállítások +Comment[it]=Impostazioni del sistema +Comment[ja]=ĽÇĽšĽŻĽČĽĂĽ×¤ÎŔßÄę +Comment[ko]=ľĽ˝şĹŠĹž źłÁ¤ +Comment[lt]=Darbo aplinkos nuostatos +Comment[no]=Skrivebordsinnstillinger +Comment[pl]=Ustawienia biurka +Comment[pt_BR]=Configuraçőes da Área de Trabalho +Comment[ro]=Setări Desktop +Comment[ru]=îÁÓÔŇĎĘËÉ ňÁÂĎŢĹÇĎ óÔĎĚÁ +Comment[sk]=Nastavenie plochy +Comment[sv]=Skrivbordsinställningar +Comment[tr]=Masaüstü ayarlarý +Comment[uk]=őÓÔÁÎĎ×ËÉ ŇĎÂĎŢĎÇĎ ÓÔĎĚŐ +Comment[wa]=Apontiaedje do scribanne +Comment[zh_CN.GB2312]=¸÷ÖÖ×ŔĂćÉ蜨 +Comment[zh_TW.Big5]=ŚUşŘŽŕ­ął]Šw +Icon=gnome-settings.png +Type=Directory diff --git a/datas/programs-links/System.directory b/datas/programs-links/System.directory new file mode 100644 index 0000000..e7d86f8 --- /dev/null +++ b/datas/programs-links/System.directory @@ -0,0 +1,69 @@ +[Desktop Entry] +Name=System +Name[sl]=Sistem +Name[bg]=Ńčńňĺěŕ +Name[ca]=Sistema +Name[cs]=Systém +Name[da]=System +Name[de]=System +Name[el]=Óýóôçěá +Name[es]=Sistema +Name[et]=Süsteem +Name[eu]=Sistema +Name[fi]=Järjestelmä +Name[fr]=Systčme +Name[ga]=Corás +Name[gl]=Sistema +Name[hu]=Rendszer +Name[it]=Sistema +Name[ja]=ĽˇĽšĽĆĽŕ +Name[ko]=˝Ă˝şĹŰ +Name[nl]=Systeem +Name[no]=System +Name[pl]=System +Name[pt]=Sistema +Name[pt_BR]=Sistema +Name[ro]=Sistem +Name[ru]=óÉÓÔĹÍÁ +Name[sk]=Systém +Name[sv]=System +Name[tr]=Sistem +Name[uk]=óÉÓÔĹÍÁ +Name[wa]=Sistinme +Name[zh_CN.GB2312]=Ͼͳ +Name[zh_TW.Big5]=¨t˛Î +Comment=System menu +Comment[sl]=Sistemski menu +Comment[bg]=Ńčńňĺěíî ěĺíţ +Comment[ca]=Menú de sistema +Comment[cs]=Systémové programy +Comment[da]=Systemprogrammer +Comment[de]=Systemmenü +Comment[el]=Ěĺíďý óőóôŢěáôďň +Comment[es]=Menú del Sistema +Comment[et]=Süsteemimenüü +Comment[eu]=Sistemaren menua +Comment[fi]=Järjestelmävalikko +Comment[fr]=Menu Systčme +Comment[ga]=Clár Coráis +Comment[gl]=Menú de Sistema +Comment[hu]=Rendszer menü +Comment[it]=Programmi di gestione del sistema +Comment[ja]=ĽˇĽšĽĆĽŕĽáĽËĽĺĄź +Comment[ko]=˝Ă˝şĹŰ ¸Ţ´ş +Comment[nl]=Systeem menu +Comment[no]=Systemmeny +Comment[pl]=Menu systemowe +Comment[pt]=Menu de Sistema +Comment[pt_BR]=Menu do Sistema +Comment[ro]=Meniul Sistem +Comment[ru]=óÉÓÔĹÍÎĎĹ ÍĹÎŔ +Comment[sk]=Systémové menu +Comment[sv]=Systemmeny +Comment[tr]=Sistem mönüsü +Comment[uk]=óÉÓÔĹÍÎĹ ÍĹÎŔ +Comment[wa]=Menu do Sistinme +Comment[zh_CN.GB2312]=ϾͳѥľĽ +Comment[zh_TW.Big5]=¨t˛Îżďłć +Icon=gnome-term.png +Type=Directory diff --git a/datas/programs-links/UNIX-regular.desktop b/datas/programs-links/UNIX-regular.desktop new file mode 100644 index 0000000..b68f9da --- /dev/null +++ b/datas/programs-links/UNIX-regular.desktop @@ -0,0 +1,77 @@ +# EFLTK Configuration - Version 2,003000 + +[Desktop Entry] + Name=Regular XTerm + Name[sl]=Običajni XTerm + Name[bg]=XŇĺđěčíŕë + Name[ca]=XTerm normal + Name[cs]=XTerm + Name[da]=Almindelig xterm + Name[de]=Normales XTerm + Name[el]=Ôőđéęü XTerm + Name[es]=XTerm normal + Name[et]=Tavaline XTerm + Name[eu]=XTerm arrunta + Name[fi]=Tavallinen XTerm + Name[fr]=XTerm Normal + Name[fr]=XTerm normal + Name[ga]=XTerm Gnáth + Name[gl]=XTerm normal + Name[hu]=Alap x-terminál + Name[it]=XTerm Normale + Name[ja]=xterm + Name[ko]=ş¸Ĺë ż˘˝şĹŇ + Name[nl]=Normale XTerm + Name[no]=Vanlig X-terminal + Name[pl]=Zwykły XTerm + Name[pt]=XTerm Normal + Name[pt_BR]=XTerm Normal + Name[ro]=Terminal X obişnuit + Name[ru]=ďÂŮŢÎŮĘ XTerm + Name[sk]=Štandardný XTerm + Name[sv]=Xterm, normal + Name[tr]=Vasat XTerm + Name[uk]=ú×ÉŢÁĘÎÉĘ Xterm + Name[wa]=Xterm normĺ + Name[zh_CN.GB2312]=X Ö՜˝ú + Name[zh_TW.Big5]=X ˛×şÝž÷ + Comment=Regular XTerm + Comment[sl]=Običajni XTerm + Comment[bg]=Îáčęíîâĺí XŇĺđěčíŕë + Comment[ca]=Emulador de terminal XTerm normal + Comment[cs]=Standardní terminálový emulátor pro X Window + Comment[da]=Den gode gamle X-terminal + Comment[de]=Normales X-Terminal + Comment[el]=ÔőđéęŢ đńďóďěďßůóç ôĺńěáôéęďý XTerm + Comment[es]=XTerm normal + Comment[et]=Tavaline XTerm + Comment[eu]=XTerm arrunta + Comment[fi]=Tavallinen XTerm + Comment[fr]=Émulateur de terminal XTerm + Comment[fr]=XTerm normal + Comment[ga]=XTerm Gnáth + Comment[gl]=XTerm normal + Comment[hu]=Alapértelmezett X-terminál + Comment[it]=XTerm Normale + Comment[ja]=ÄĚžďČÇ xterm + Comment[ko]=ş¸Ĺë ż˘˝şĹŇ + Comment[nl]=Normale XTerm + Comment[no]=Vanlig X-terminal + Comment[pl]=Emulator terminala (XTerm) + Comment[pt]=XTerm Regular + Comment[pt_BR]=XTerm Normal + Comment[ro]=Terminal X obişnuit + Comment[ru]=ďÂŮŢÎŮĘ XTerm + Comment[sk]=Štandardný XTerm + Comment[sv]=Vanlig X-terminal + Comment[tr]=Vasat XTerm komutasý + Comment[uk]=ú×ÉŢÁĘÎÉĘ XTerm + Comment[wa]=Terminĺ xterm normĺ + Comment[zh_CN.GB2312]=X Ö՜˝ú + Comment[zh_TW.Big5]=X ˛×şÝž÷ + TryExec=xterm + Exec=xterm + Icon=konsole.png + Terminal=0 + Type=Application + diff --git a/datas/programs-links/UNIX.desktop b/datas/programs-links/UNIX.desktop new file mode 100644 index 0000000..dd35cb9 --- /dev/null +++ b/datas/programs-links/UNIX.desktop @@ -0,0 +1,78 @@ +# EFLTK Configuration - Version 2,003000 + +[Desktop Entry] + Name=Color XTerm + Name[sl]=Bravni XTerm + Name[bg]=Öâĺňĺí XŇĺđěčíŕë + Name[ca]=Xterm en color + Name[cs]=Barevný terminálový emulátor + Name[da]=Farve xterm + Name[de]=Farbiges XTerm + Name[el]=¸ă÷ńůěď XTerm + Name[en_GB]=Colour XTerm + Name[es]=XTerm a color + Name[et]=Värviline XTerm + Name[eu]=XTerm koloretan + Name[fi]=Värillinen XTerm + Name[fr]=XTerm Couleur + Name[fr]=XTerm couleur + Name[ga]=Xterm daite + Name[gl]=Xterm a cores + Name[hu]=Színes X-terminál + Name[it]=XTerm a colori + Name[ja]=ĽŤĽéĄź xterm + Name[ko]=ÄŽśó ż˘˝şĹŇ + Name[nl]=Kleuren XTerm + Name[no]=Farge X-terminal + Name[pl]=Kolorowy XTerm + Name[pt]=XTerm a cores + Name[pt_BR]=XTerm a cores + Name[ro]=Terminal X color + Name[ru]=ă×ĹÔÎĎĘ XTerm + Name[sk]=Farebný XTerm + Name[sv]=XTerm, färg + Name[tr]=XTerm komutasý + Name[uk]=ëĎĚŘĎŇĎ×ÉĘ XTerm + Name[wa]=Xterm č coleur + Name[zh_CN.GB2312]=˛ĘÉŤ X Ö՜˝ú + Name[zh_TW.Big5]=ąmŚâ X ˛×şÝž÷ + Comment=Color XTerm + Comment[sl]=Barvni XTerm + Comment[bg]=Öâĺňĺí ňĺđěčíŕëĺí ĺěóëŕňîđ + Comment[ca]=Emulador de terminal XTerm en color + Comment[cs]=Terminálový emulátor schopný zobrazení barev + Comment[da]=X-terminal i farver + Comment[de]=Farbiges XTerm + Comment[el]=¸ă÷ńůěç đńďóďěďßůóç ôĺńěáôéęďý XTerm + Comment[en_GB]=Colour XTerm + Comment[es]=XTerm a color + Comment[et]=Värviline XTerm + Comment[eu]=XTerm koloretan + Comment[fi]=Värillinen XTerm + Comment[fr]=Émulateur de terminal XTerm couleur + Comment[ga]=XTerm daite + Comment[gl]=Xterm a cores + Comment[hu]=Színes X-terminál + Comment[it]=XTerm a colori + Comment[ja]=ĽŤĽéĄźČÇ xterm + Comment[ko]=ÄŽśó ż˘˝şĹŇ + Comment[nl]=Kleuren XTerm + Comment[no]=Xterm i farger + Comment[pl]=Kolorowy emulator terminala + Comment[pt]=XTerm a cores(nxterm) + Comment[pt_BR]=XTerm a cores(nxterm) + Comment[ro]=Terminal X color + Comment[ru]=ă×ĹÔÎĎĘ XTerm + Comment[sk]=Farebný XTerm + Comment[sv]=X-terminal i färg + Comment[tr]=Xterm komutasý + Comment[uk]=ëĎĚŘĎŇĎ×ÉĘ ĹÍŐĚŃÔĎŇ ÔĹŇÍŚÎÁĚŐ + Comment[wa]=Terminĺ xterm avou des coleurs + Comment[zh_CN.GB2312]=˛ĘÉŤ X Ö՜˝ú + Comment[zh_TW.Big5]=ąmŚâ X ˛×şÝž÷ + TryExec=nxterm + Exec=nxterm + Icon=konsole.png + Terminal=0 + Type=Application + diff --git a/datas/programs-links/Utilities.directory b/datas/programs-links/Utilities.directory new file mode 100644 index 0000000..5f0511b --- /dev/null +++ b/datas/programs-links/Utilities.directory @@ -0,0 +1,68 @@ +[Desktop Entry] +Name=Utilities +Name[sl]=Pripomočki +Name[bg]=Ďîëĺçíč +Name[ca]=Utilitats +Name[cs]=Nástroje +Name[da]=Vćrktřj +Name[de]=Werkzeuge +Name[el]=Ĺńăáëĺßá +Name[es]=Utilerías +Name[et]=Abivahendid +Name[eu]=Tresnak +Name[fi]=Apuohjelmat +Name[fr]=Utilitaires +Name[ga]=Fontáis +Name[gl]=Utilidades +Name[hu]=Segédeszközök +Name[it]=Utilitŕ +Name[ja]=ĽćĄźĽĆĽŁĽęĽĆĽŁĄź +Name[ko]=ľľą¸ľé +Name[nl]=Hulpmiddelen +Name[no]=Verktřy +Name[pl]=Narzędzia +Name[pt]=Utilitários +Name[pt_BR]=Utilitários +Name[ro]=Utilitare +Name[ru]=őÔÉĚÉÔŮ +Name[sk]=Pomôcky +Name[sv]=Verktyg +Name[tr]=Zýmpýrtý +Name[uk]=őÔÉĚŚÔÉ +Name[wa]=Usteyes +Name[zh_CN.GB2312]=šŤÓĂłĚĘ˝ +Name[zh_TW.Big5]=¤˝ĽÎľ{ŚĄ +Comment=Utilities menu +Comment[sl]=Menu pripomočkov +Comment[bg]=Ďîěîůíč ďđîăđŕěč č číńňđóěĺíňč +Comment[cs]=Menu nástrojů a užitečných programů +Comment[da]=Vćrktřjsmenu +Comment[de]=Werkzeugmenü +Comment[el]=Ěĺíďý ĺńăáëĺßůí +Comment[es]=Menú de Utilerías +Comment[et]=Abiprogrammide menüü +Comment[eu]=Tresnen menua +Comment[fi]=Apuohjelmavalikko +Comment[fr]=Menu Utilitaires +Comment[ga]=Clár Fóntais +Comment[gl]=Menú de Utilidades +Comment[hu]=Segédeszközök menü +Comment[it]=Applicativi di Utilitŕ +Comment[ja]=ĽćĄźĽĆĽŁĽęĽĆĽŁĄźĽáĽËĽĺĄź +Comment[ko]=ľľą¸ľé ¸Ţ´ş +Comment[nl]=Hulpmiddelen menu +Comment[no]=Verktřymeny +Comment[pl]=Programy narzędziowe +Comment[pt]=Menu de utilitários +Comment[pt_BR]=Menu de utilitários +Comment[ro]=Meniul Utilitare +Comment[ru]=íĹÎŔ ŐÔÉĚÉÔ +Comment[sk]=Menu pomôcok +Comment[sv]=Verktygsprogram +Comment[tr]=Ufak tefek uygulamalar +Comment[uk]=íĹÎŔ ŐÔÉĚŚÔ +Comment[wa]=Menu des usteyes +Comment[zh_CN.GB2312]=šŤÓĂłĚʽѥľĽ +Comment[zh_TW.Big5]=¤˝ĽÎľ{ŚĄżďłć +Icon=gnome-util.png +Type=Directory diff --git a/datas/programs-links/Vim.desktop b/datas/programs-links/Vim.desktop new file mode 100644 index 0000000..c011050 --- /dev/null +++ b/datas/programs-links/Vim.desktop @@ -0,0 +1,54 @@ +# EFLTK Configuration - Version 2,003000 + +[Desktop Entry] + Name=Vim + Name[sl]=Vim + Name[bg]=Vim + Name[cs]=Vim + Name[da]=Vim + Name[de]=Vim + Name[el]=Vim + Name[fi]=Vim + Name[fr]=Vim + Name[ga]=Vim + Name[gl]=Vim + Name[it]=Vim + Name[ja]=Vim + Name[lt]=Vim + Name[no]=Vim + Name[pl]=Vim + Name[pt_BR]=Vim + Name[ro]=Vim + Name[ru]=Vim + Name[sk]=Vim + Name[tr]=Vim + Name[uk]=Vim + Comment=Gtk+ port of Vim + Comment[sl]=Gtk+ različica Vim-a + Comment[bg]=Ăđŕôč÷íŕ Gtk+ âĺđńč˙ íŕ Vim + Comment[cs]=GTK+ verze vim + Comment[da]=Gtk+-udgave af tekstbehandleren Vim + Comment[de]=GTK+-Version des Vim + Comment[el]=GTK+ Ýęäďóç ôďő ĺđĺîĺńăáóôŢ ęĺéěÝíďő Vim + Comment[fi]=Vim-tekstieditori + Comment[fr]=Portage GTK+ de Vim + Comment[ga]=Leagan Gtk+ do Vim + Comment[gl]=Versión do Vim para Gtk+ + Comment[it]=Versione Gtk+ di Vim + Comment[ja]=Gtk+ ČÇ Vim + Comment[lt]=Vim'o GTK+ versija + Comment[no]=GTK+ versjonen av Vim + Comment[pl]=Wersja Vima dla GTK+ + Comment[pt_BR]=Vim para o Gtk+ + Comment[ro]=Portare GTK+ a lui Vim + Comment[ru]=Vim ĐĹŇĹÎĹÓĹÎÎŮĘ ĐĎÄ Gtk+ + Comment[sk]=Port Vim pre Gtk+ + Comment[tr]=Vim'in Gtk+ kullaným yüzü + Comment[uk]=Vim ĐĹŇĹÎĹÓĹÎÉĘ ĐŚÄ Gtk+ + Comment[wa]=Modeye Gtk+ di l' aspougneu di tecse vim + TryExec=gvim + Exec=gvim + Icon=tux.png + Terminal=0 + Type=Application + diff --git a/datas/programs-links/Vnterm.desktop b/datas/programs-links/Vnterm.desktop new file mode 100644 index 0000000..e3507fe --- /dev/null +++ b/datas/programs-links/Vnterm.desktop @@ -0,0 +1,75 @@ +# EFLTK Configuration - Version 2,003000 + +[Desktop Entry] + Name=Vietnamese terminal + Name[sl]=Vietnamski terminal + Name[bg]=Âčĺňíŕěńęč ňĺđěčíŕë + Name[ca]=Terminal vietnamita + Name[cs]=Vietnamský terminál + Name[da]=Vietnamesisk terminal + Name[de]=Vietnamesisches Terminal + Name[el]=ÂéĺôíáěÝćéęď ôĺńěáôéęü + Name[es]=Terminal Vietnamita + Name[et]=Vietnami terminal + Name[eu]=Terminal Vietnamdarra + Name[fi]=Vietnamilainen pääte + Name[fr]=Terminal Vietnamien + Name[ga]=Teirminéal Vítneamáis + Name[gl]=Terminal vietnamita + Name[it]=Terminale vietnamita + Name[ja]=ĽŮĽČĽĘĽŕ¸ěĽżĄźĽßĽĘĽë (vnterm) + Name[ko]=şŁĆŽł˛žî Ĺ͚̳Π+ Name[nl]=Vietnamese terminal + Name[no]=Vietnamesisk terminal + Name[pl]=Wietnamski terminal + Name[pt_BR]=Terminal vietnamita + Name[ro]=Terminal vietnamez + Name[sk]=Vietnamský terminál + Name[sv]=Vietnamesisk terminal + Name[tr]=Viyetnam komutasý + Name[uk]=÷'¤ÔÎÁÍÓŘËÉĘ ÔĹŇÍŚÎÁĚ + Name[vi]=Terminal mľu cho tiŐng ViÖt + Name[vi_VN.TCVN]=Terminal mľu cho tiŐng ViÖt + Name[vi_VN.VISCII]=Terminal mŕu cho tiŞng ViŽt + Name[wa]=Terminĺ vietnamiyen + Name[zh_CN.GB2312]=Ô˝ÄĎÖ՜˝ú + Name[zh_TW.Big5]=śVŤn˛×şÝž÷ + Comment=Vietnamese terminal emulation program + Comment[sl]=Vietnamski emulator terminala + Comment[bg]=Ňĺđěčíŕëĺí ĺěóëŕňîđ çŕ Âčĺňíŕě + Comment[ca]=Emulador de terminal vietnamita + Comment[cs]=Terminálový emulátor podporující vietnamské písmo + Comment[da]=Vietnamesisk terminalemulering + Comment[de]=Vietnamesischer Terminalemulator + Comment[el]=ÂéĺôíáěÝćéęďň đńďóďěďéůôŢň ôĺńěáôéęďý + Comment[es]=Emulador de terminal vietnamita + Comment[et]=Vietnamikeelne terminal + Comment[eu]=Terminal Vietnamdarraren emulatzailea + Comment[fi]=Vietnamilainen pääte-emulaattoriohjelma + Comment[fr]=Émulateur de terminal vietnamien + Comment[ga]=Teirminéal Vítneamáis + Comment[gl]=Emulador de terminal vietnamita + Comment[it]=Emulatore di terminale vietnamita + Comment[ja]=ĽŮĽČĽĘĽŕ¸ěĽżĄźĽßĽĘĽëĽ¨ĽßĽĺĽěĄźĽż + Comment[ko]=şŁĆŽł˛žî Ĺ͚̳Π+ Comment[nl]=Vietnamese terminalemulator + Comment[no]=Vietnamesisk terminalemulator + Comment[pl]=Wietnamski emulator terminala + Comment[pt_BR]=Emulador de terminal vietnamita + Comment[ro]=Emulator de terminal vietnamez + Comment[sk]=Emulátor vietnamského terminálu + Comment[sv]=Vietnamesisk terminalemulator + Comment[tr]=Viyetnamlý komuta + Comment[uk]=÷'¤ÔÎÁÍÓŘËÉĘ ĹÍŐĚŃÔĎŇ ÔĹŇÍŚÎÁĚŐ + Comment[vi]=Terminal mľu cho tiŐng ViÖt + Comment[vi_VN.TCVN]=Terminal mľu cho tiŐng ViÖt + Comment[vi_VN.VISCII]=Terminal mŕu cho tiŞng ViŽt + Comment[wa]=Terminĺ vietnamiyen + Comment[zh_CN.GB2312]=Ô˝ÄĎÎÄ×ÖľÄÖ՜˝úÄŁÄâłĚĘ˝ + Comment[zh_TW.Big5]=śVŤn¤ĺŚrŞş˛×şÝž÷źŇŔŔľ{ŚĄ + TryExec=vnterm + Exec=vnterm + Icon=konsole.png + Terminal=0 + Type=Application + diff --git a/datas/programs-links/WordPerfect.desktop b/datas/programs-links/WordPerfect.desktop new file mode 100644 index 0000000..bcc68ad --- /dev/null +++ b/datas/programs-links/WordPerfect.desktop @@ -0,0 +1,38 @@ +# EFLTK Configuration - Version 2,003000 + +[Desktop Entry] + Name=WordPerfect + Name[sl]=WordPerfect + Name[da]=WordPerfect + Name[de]=WordPerfect + Name[fi]=WordPerfect + Name[fr]=WordPerfect + Name[it]=WordPerfect + Name[lt]=WordPerfect + Name[no]=WordPerfect + Name[pt_BR]=WordPerfect + Name[ro]=WordPerfect + Name[sk]=WordPerfect + Name[sv]=WordPerfect + Comment=WordPerfect for Linux + Comment[sl]=WordPerfect za Linux + Comment[da]=WordPerfect til Linux + Comment[de]=WordPerfect für Linux + Comment[el]=WordPerfect ăéá Linux + Comment[fi]=WordPerfect Linuxille + Comment[fr]=WordPerfect pour Linux + Comment[it]=WordPerfect per Linux + Comment[lt]=Linux'inis WordPerfect + Comment[no]=WordPerfect for Linux + Comment[pt_BR]=WordPerfect para Linux + Comment[ro]=WordPerfect pentru Linux + Comment[sk]=WordPerfect pre Linux + Comment[sv]=WordPerfect för Linux + Comment[wa]=Li programe di traitment di tecsse WordPerfect + TryExec=/u/s/wp + Exec=wp + Icon=synaptic.png + Terminal=false + MultipleArgs=false + Type=Application + diff --git a/datas/programs-links/Xemacs.desktop b/datas/programs-links/Xemacs.desktop new file mode 100644 index 0000000..ffcd905 --- /dev/null +++ b/datas/programs-links/Xemacs.desktop @@ -0,0 +1,40 @@ +# EFLTK Configuration - Version 2,003000 + +[Desktop Entry] + Name=XEmacs + Name[sl]=XEmacs + Name[da]=XEmacs + Name[de]=XEmacs + Name[el]=XEmacs + Name[fi]=XEmacs + Name[fr]=XEmacs + Name[it]=XEmacs + Name[lt]=XEmacs + Name[no]=XEmacs + Name[pt_BR]=XEmacs + Name[ro]=XEmacs + Name[sk]=XEmacs + Name[sv]=XEmacs + Name[wa]=XEmacs + Comment=xemacs text editor + Comment[sl]=Urejevalnik besedil xemacs + Comment[da]=XEmacs tekstbehandler + Comment[de]=XEmacs Texteditor + Comment[el]=ĹđĺîĺńăáóôŢň ęĺéěÝíďő XEmacs + Comment[fi]=XEmacs-editori + Comment[fr]=Éditeur de texte XEmacs + Comment[it]=Editor XEmacs + Comment[lt]=xemacs tekstř editorius + Comment[no]=Xemacs teksteditor + Comment[pt_BR]=Editor de texto XEmacs + Comment[ro]=Editorul de texte Xemacs + Comment[sk]=Textový editor xemacs + Comment[sv]=xemacs textedito + Comment[wa]=L' aspougneu di tecsse xemacs + TryExec=xemacs + Exec=xemacs + Icon=moc_src.png + Terminal=false + MultipleArgs=false + Type=Application + diff --git a/datas/programs-links/abiword.desktop b/datas/programs-links/abiword.desktop new file mode 100644 index 0000000..d5cd7b7 --- /dev/null +++ b/datas/programs-links/abiword.desktop @@ -0,0 +1,8 @@ +# EFLTK Configuration - Version 2,003000 + +[Desktop Entry] + Name=AbiWord + Exec=AbiWord + Icon=document.png + Name[sk]=AbiWord + diff --git a/datas/programs-links/acroread.desktop b/datas/programs-links/acroread.desktop new file mode 100644 index 0000000..7dbf0f6 --- /dev/null +++ b/datas/programs-links/acroread.desktop @@ -0,0 +1,8 @@ +# EFLTK Configuration - Version 2,003000 + +[Desktop Entry] + Name=Acrobat Reader + Exec=acroread + Icon=pdf-document.png + Name[sk]=Acrobat Reader + diff --git a/datas/programs-links/alsaplayer.desktop b/datas/programs-links/alsaplayer.desktop new file mode 100644 index 0000000..d0f6b2f --- /dev/null +++ b/datas/programs-links/alsaplayer.desktop @@ -0,0 +1,8 @@ +# EFLTK Configuration - Version 2,003000 + +[Desktop Entry] + Name=Alsa Player + Exec=alsaplayer -i ede + Icon=midi.png + Name[sk]=Alsa Player + diff --git a/datas/programs-links/calc.desktop b/datas/programs-links/calc.desktop new file mode 100644 index 0000000..8716552 --- /dev/null +++ b/datas/programs-links/calc.desktop @@ -0,0 +1,36 @@ +# EFLTK Configuration - Version 2,003000 + +[Desktop Entry] + Name=Simple Calculator + Name[sl]=Enostavni kalkulator + Name[pt_BR]=Calculadora Simples + Name[ca]=Calculadora + Name[cs]=Kalkulačka + Name[da]=Lommeregner + Name[de]=Taschenrechner + Name[el]=ŐđďëďăéóôŢň ôóÝđçň + Name[es]=Calculadora + Name[et]=Taskuarvuti + Name[fi]=Laskin + Name[fr]=Calculatrice + Name[gl]=Calculadora + Name[ja]=´Ę°×ĹĹÂî + Name[ko]=°čťęąâ + Name[lt]=Skaičiuotuvas + Name[hr]=Kalkulator + Name[hu]=Számológép + Name[it]=Calcolatrice + Name[lt]=Skaičiuotuvas + Name[nl]=Rekenmachine + Name[no]=Kalkulator + Name[pl]=Kalkulator + Name[pt]=Calculadora + Name[ru]=ëÁĚŘËŐĚŃÔĎŇ + Name[sk]=Kalkulačka + Name[sv]=Miniräknare + Name[tr]=Hesap makinasý + Name[uk]=ëÁĚŘËŐĚŃÔĎŇ + Name[wa]=Carculete + Exec=ecalc + Icon=lime.png + diff --git a/datas/programs-links/colorsconf.desktop b/datas/programs-links/colorsconf.desktop new file mode 100644 index 0000000..d2fe3cb --- /dev/null +++ b/datas/programs-links/colorsconf.desktop @@ -0,0 +1,8 @@ +# EFLTK Configuration - Version 2,003000 + +[Desktop Entry] + Name=Colors and fonts settings + Exec=ecolorconf + Icon=colorset.png + Name[sk]=Nastavenie farieb a fontov + diff --git a/datas/programs-links/control.desktop b/datas/programs-links/control.desktop new file mode 100644 index 0000000..744f56a --- /dev/null +++ b/datas/programs-links/control.desktop @@ -0,0 +1,8 @@ +# EFLTK Configuration - Version 2,003000 + +[Desktop Entry] + Name=Control panel + Name[sk]=Kontrólny panel + Exec=econtrol + Icon=kcontrol.png + diff --git a/datas/programs-links/cooledit.desktop b/datas/programs-links/cooledit.desktop new file mode 100644 index 0000000..0c9bf87 --- /dev/null +++ b/datas/programs-links/cooledit.desktop @@ -0,0 +1,8 @@ +# EFLTK Configuration - Version 2,003000 + +[Desktop Entry] + Name=Cool edit + Name[sk]=Cool edit + Exec=cooledit + Icon=tgz.png + diff --git a/datas/programs-links/dialup.desktop b/datas/programs-links/dialup.desktop new file mode 100644 index 0000000..5ab4e5d --- /dev/null +++ b/datas/programs-links/dialup.desktop @@ -0,0 +1,8 @@ +# EFLTK Configuration - Version 2,003000 + +[Desktop Entry] + Name=Connection to Internet + Name[sk]=Pripojenie na Internet + Exec=epppdialer + Icon=network.png + diff --git a/datas/programs-links/ecdplayer.desktop b/datas/programs-links/ecdplayer.desktop new file mode 100644 index 0000000..fe134b5 --- /dev/null +++ b/datas/programs-links/ecdplayer.desktop @@ -0,0 +1,8 @@ +# EFLTK Configuration - Version 2,003000 + +[Desktop Entry] + Name=CD Player + Exec=ecdplayer + Icon=cdtrack.png + Name[sk]=Prehrávač CD + diff --git a/datas/programs-links/edisplayconf.desktop b/datas/programs-links/edisplayconf.desktop new file mode 100644 index 0000000..d25fc57 --- /dev/null +++ b/datas/programs-links/edisplayconf.desktop @@ -0,0 +1,8 @@ +# EFLTK Configuration - Version 2,003000 + +[Desktop Entry] + Name=Display settings + Exec=edisplayconf + Icon=konsole3.png + Name[sk]=Nastavenie displaya + diff --git a/datas/programs-links/ehardware.desktop b/datas/programs-links/ehardware.desktop new file mode 100644 index 0000000..6c73387 --- /dev/null +++ b/datas/programs-links/ehardware.desktop @@ -0,0 +1,8 @@ +# EFLTK Configuration - Version 2,003000 + +[Desktop Entry] + Name=Hardware center + Exec=ehardcenter + Icon=linuxconf.png + Name[sk]=Hardvérové centrum + diff --git a/datas/programs-links/eiconconf.desktop b/datas/programs-links/eiconconf.desktop new file mode 100644 index 0000000..94490ae --- /dev/null +++ b/datas/programs-links/eiconconf.desktop @@ -0,0 +1,8 @@ +# EFLTK Configuration - Version 2,003000 + +[Desktop Entry] + Name=Icons settings + Exec=eiconsconf + Icon=image.png + Name[sk]=Nastavenie ikon + diff --git a/datas/programs-links/eimgviewer.desktop b/datas/programs-links/eimgviewer.desktop new file mode 100644 index 0000000..63084f5 --- /dev/null +++ b/datas/programs-links/eimgviewer.desktop @@ -0,0 +1,8 @@ +# EFLTK Configuration - Version 2,003000 + +[Desktop Entry] + Name=Image Viewer + Name[sk]=Prehliadač obrázkov + Exec=eimgviewer + Icon=gimp.png + diff --git a/datas/programs-links/epanelconf.desktop b/datas/programs-links/epanelconf.desktop new file mode 100644 index 0000000..89968ec --- /dev/null +++ b/datas/programs-links/epanelconf.desktop @@ -0,0 +1,8 @@ +# EFLTK Configuration - Version 2,003000 + +[Desktop Entry] + Name=Panel settings + Exec=epanelconf + Icon=package_application.png + Name[sk]=Možnosti panela + diff --git a/datas/programs-links/esoundmixer.desktop b/datas/programs-links/esoundmixer.desktop new file mode 100644 index 0000000..7c6e2bf --- /dev/null +++ b/datas/programs-links/esoundmixer.desktop @@ -0,0 +1,8 @@ +# EFLTK Configuration - Version 2,003000 + +[Desktop Entry] + Name=Volume control + Exec=evolume + Icon=sound.png + Name[sk]=Nastavenie hlasitosti + diff --git a/datas/programs-links/etimedate.desktop b/datas/programs-links/etimedate.desktop new file mode 100644 index 0000000..9e9a3a8 --- /dev/null +++ b/datas/programs-links/etimedate.desktop @@ -0,0 +1,8 @@ +# EFLTK Configuration - Version 2,003000 + +[Desktop Entry] + Name=Time and date + Exec=etimedate + Icon=quicktime.png + Name[sk]=Čas a dátum + diff --git a/datas/programs-links/ewmconf.desktop b/datas/programs-links/ewmconf.desktop new file mode 100644 index 0000000..99bbb59 --- /dev/null +++ b/datas/programs-links/ewmconf.desktop @@ -0,0 +1,8 @@ +# EFLTK Configuration - Version 2,003000 + +[Desktop Entry] + Name=Window manager settings + Exec=ewmconf + Icon=window_new.png + Name[sk]=Nastavenie manažéra okien + diff --git a/datas/programs-links/finder.desktop b/datas/programs-links/finder.desktop new file mode 100644 index 0000000..870e80b --- /dev/null +++ b/datas/programs-links/finder.desktop @@ -0,0 +1,8 @@ +# EFLTK Configuration - Version 2,003000 + +[Desktop Entry] + Name=Finder + Exec=efinder + Icon=find.png + Name[sk]=Hľadať + diff --git a/datas/programs-links/fluid.desktop b/datas/programs-links/fluid.desktop new file mode 100644 index 0000000..327c59f --- /dev/null +++ b/datas/programs-links/fluid.desktop @@ -0,0 +1,8 @@ +# EFLTK Configuration - Version 2,003000 + +[Desktop Entry] + Name=eFLUID - GUI Designer + Name[sk]=eFLUID - GIU Dizajnér + Exec=efluid + Icon=binary.png + diff --git a/datas/programs-links/fstabedit.desktop b/datas/programs-links/fstabedit.desktop new file mode 100644 index 0000000..06e8478 --- /dev/null +++ b/datas/programs-links/fstabedit.desktop @@ -0,0 +1,8 @@ +# EFLTK Configuration - Version 2,003000 + +[Desktop Entry] + Name=Mount point editor + Exec=efstabedit + Icon=folder_red.png + Name[sk]=Editor diskových pripojení + diff --git a/datas/programs-links/gv.desktop b/datas/programs-links/gv.desktop new file mode 100644 index 0000000..7fb042d --- /dev/null +++ b/datas/programs-links/gv.desktop @@ -0,0 +1,8 @@ +# EFLTK Configuration - Version 2,003000 + +[Desktop Entry] + Name[sk]=Prehliadač Ghostview + Name=Ghostview + Icon=txt.png + Exec=gv + diff --git a/datas/programs-links/lbreak.desktop b/datas/programs-links/lbreak.desktop new file mode 100644 index 0000000..4e56869 --- /dev/null +++ b/datas/programs-links/lbreak.desktop @@ -0,0 +1,8 @@ +# EFLTK Configuration - Version 2,003000 + +[Desktop Entry] + Name=L Breakout + Exec=lbreakout2 + Icon=misc.png + Name[sk]=L Breakout + diff --git a/datas/programs-links/lynx.desktop b/datas/programs-links/lynx.desktop new file mode 100644 index 0000000..73b4022 --- /dev/null +++ b/datas/programs-links/lynx.desktop @@ -0,0 +1,40 @@ +# EFLTK Configuration - Version 2,003000 + +[Desktop Entry] + Name=Lynx + Name[sl]=Lynx + Name[da]=Lynx + Name[de]=Lynx + Name[el]=Lynx + Name[fi]=Lynx + Name[fr]=Lynx + Name[it]=Lynx + Name[lt]=Lynx + Name[no]=Lynx + Name[pt_BR]=Lynx + Name[ro]=Lynx + Name[sk]=Lynx + Name[sv]=Lynx + Name[wa]=Lynx + Comment=Text based web browser + Comment[sl]=Tekstovni spletni brskalnik + Comment[da]=Tekstbaseret netsurfningsprogram + Comment[de]=Textbasierter Webbrowser + Comment[el]=ÖőëëďěĺôńçôŢň Äéęôýďő ęáôÜóôáóçň ôĺńěáôéęďý + Comment[fi]=Tekstipohjainen Internet-selain + Comment[fr]=Navigateur Web en mode texte + Comment[it]=Browser web testuale + Comment[lt]=Tekstinë web narđyklë + Comment[no]=Tekstbasert webleser + Comment[pt_BR]=Navegador da Internet baseado em texto + Comment[ro]=Browser web în mod text + Comment[sk]=Textový prehliadač WWW + Comment[sv]=Textbaserad webbläsare + Comment[wa]=Lynx est on betcheu waibe č môde tecsse + TryExec=rxvt -title Lynx -e lynx ~/.netscape/bookmarks.html + Exec=xterm -title Lynx -e lynx ~/.netscape/bookmarks.html + Icon=log.png + Terminal=false + MultipleArgs=false + Type=Application + diff --git a/datas/programs-links/lyx.desktop b/datas/programs-links/lyx.desktop new file mode 100644 index 0000000..7eb7d36 --- /dev/null +++ b/datas/programs-links/lyx.desktop @@ -0,0 +1,8 @@ +# EFLTK Configuration - Version 2,003000 + +[Desktop Entry] + Name=Lyx + Exec=lyx + Icon=key_enter.png + Name[sk]=Lyx + diff --git a/datas/programs-links/mplayer.desktop b/datas/programs-links/mplayer.desktop new file mode 100644 index 0000000..9876c96 --- /dev/null +++ b/datas/programs-links/mplayer.desktop @@ -0,0 +1,8 @@ +# EFLTK Configuration - Version 2,003000 + +[Desktop Entry] + Name=MPlayer + Exec=emplayer -gui + Icon=noatun.png + Name[sk]=Media Player + diff --git a/datas/programs-links/notepad.desktop b/datas/programs-links/notepad.desktop new file mode 100644 index 0000000..93a2a5f --- /dev/null +++ b/datas/programs-links/notepad.desktop @@ -0,0 +1,8 @@ +# EFLTK Configuration - Version 2,003000 + +[Desktop Entry] + Name=Notepad + Name[sk]=Poznámkový blok + Exec=enotepad + Icon=txt.png + diff --git a/datas/programs-links/ooffice.desktop b/datas/programs-links/ooffice.desktop new file mode 100644 index 0000000..df47a0e --- /dev/null +++ b/datas/programs-links/ooffice.desktop @@ -0,0 +1,8 @@ +# EFLTK Configuration - Version 2,003000 + +[Desktop Entry] + Name=Open Office + Exec=ooffice + Icon=soffice.png + Name[sk]=Open Office + diff --git a/datas/programs-links/postoffice.desktop b/datas/programs-links/postoffice.desktop new file mode 100644 index 0000000..ff83acf --- /dev/null +++ b/datas/programs-links/postoffice.desktop @@ -0,0 +1,8 @@ +# EFLTK Configuration - Version 2,003000 + +[Desktop Entry] + Name=Email client + Name[sk]=Poštový klient + Exec=epostoffice + Icon=mozilla-mail.png + diff --git a/datas/programs-links/printers.desktop b/datas/programs-links/printers.desktop new file mode 100644 index 0000000..4837ff8 --- /dev/null +++ b/datas/programs-links/printers.desktop @@ -0,0 +1,8 @@ +# EFLTK Configuration - Version 2,003000 + +[Desktop Entry] + Name=Printers management + Name[sk]=Nastavenie tlačiarní + Exec=eprintconf + Icon=klpq.png + diff --git a/datas/programs-links/realplayer.desktop b/datas/programs-links/realplayer.desktop new file mode 100644 index 0000000..1519568 --- /dev/null +++ b/datas/programs-links/realplayer.desktop @@ -0,0 +1,8 @@ +# EFLTK Configuration - Version 2,003000 + +[Desktop Entry] + Name=Real Player + Exec=realplay + Icon=real_doc.png + Name[sk]=Real Player + diff --git a/datas/programs-links/rxvt.desktop b/datas/programs-links/rxvt.desktop new file mode 100644 index 0000000..039ff6e --- /dev/null +++ b/datas/programs-links/rxvt.desktop @@ -0,0 +1,11 @@ +# EFLTK Configuration - Version 2,003000 + +[Desktop Entry] + Name=Rxvt + Comment=Rxvt + TryExec=rxvt + Exec=rxvt + Icon=konsole.png + Terminal=0 + Type=Application + diff --git a/datas/programs-links/sccalc.desktop b/datas/programs-links/sccalc.desktop new file mode 100644 index 0000000..1f844e5 --- /dev/null +++ b/datas/programs-links/sccalc.desktop @@ -0,0 +1,8 @@ +# EFLTK Configuration - Version 2,003000 + +[Desktop Entry] + Name=Scientific calculator + Exec=esccplus + Icon=bookmark.png + Name[sk]=Vedecká kalkulačka + diff --git a/datas/programs-links/scrsaver.desktop b/datas/programs-links/scrsaver.desktop new file mode 100644 index 0000000..31088d6 --- /dev/null +++ b/datas/programs-links/scrsaver.desktop @@ -0,0 +1,8 @@ +# EFLTK Configuration - Version 2,003000 + +[Desktop Entry] + Name=Screensaver settings + Exec=esvrconf + Icon=konsole2.png + Name[sk]=Nastavenie šetriča + diff --git a/datas/programs-links/tips.desktop b/datas/programs-links/tips.desktop new file mode 100644 index 0000000..2bc17c8 --- /dev/null +++ b/datas/programs-links/tips.desktop @@ -0,0 +1,8 @@ +# EFLTK Configuration - Version 2,003000 + +[Desktop Entry] + Name=Tips + Exec=etip + Icon=tux.png + Name[sk]=Tipy pri štarte + diff --git a/datas/programs-links/x11amp.desktop b/datas/programs-links/x11amp.desktop new file mode 100644 index 0000000..3df79e9 --- /dev/null +++ b/datas/programs-links/x11amp.desktop @@ -0,0 +1,8 @@ +# EFLTK Configuration - Version 2,003000 + +[Desktop Entry] + Name=X11 Amp + Exec=x11amp + Icon=xmms.png + Name[sk]=X11 Amp + diff --git a/datas/programs-links/xbill.desktop b/datas/programs-links/xbill.desktop new file mode 100644 index 0000000..7e6fb69 --- /dev/null +++ b/datas/programs-links/xbill.desktop @@ -0,0 +1,22 @@ +# EFLTK Configuration - Version 2,003000 + +[Desktop Entry] + Name=xBill + Name[pt_BR]=xBill + Name[da]=xBill + Name[de]=xBill + Name[el]=Bill + Name[et]=Bill + Name[fi]=xBill + Name[fr]=xBill + Name[gl]=xBill + Name[ja]=XĽÓĽë + Name[lt]=xBill + Name[no]=xBill + Name[sk]=xBill + Name[sv]=xBill + Icon=misc.png + Exec=exbill + Terminal=0 + Type=Application + diff --git a/datas/programs-links/xdvi.desktop b/datas/programs-links/xdvi.desktop new file mode 100644 index 0000000..8babb13 --- /dev/null +++ b/datas/programs-links/xdvi.desktop @@ -0,0 +1,8 @@ +# EFLTK Configuration - Version 2,003000 + +[Desktop Entry] + Name[sk]=Prehliadač Dvi + Name=Dvi Viewer + Icon=font_bitmap.png + Exec=xdvi + diff --git a/datas/programs-links/xmag.desktop b/datas/programs-links/xmag.desktop new file mode 100644 index 0000000..3215555 --- /dev/null +++ b/datas/programs-links/xmag.desktop @@ -0,0 +1,8 @@ +# EFLTK Configuration - Version 2,003000 + +[Desktop Entry] + Name=Magnify + Exec=xmag + Icon=window_fullscreen.png + Name[sk]=Zväčšenie + diff --git a/datas/programs-links/xmms.desktop b/datas/programs-links/xmms.desktop new file mode 100644 index 0000000..e42dc92 --- /dev/null +++ b/datas/programs-links/xmms.desktop @@ -0,0 +1,8 @@ +# EFLTK Configuration - Version 2,003000 + +[Desktop Entry] + Name=X Multimedia System + Exec=xmms + Icon=xmms_classic.png + Name[sk]=X Multimedia System + diff --git a/datas/programs-links/xpdf.desktop b/datas/programs-links/xpdf.desktop new file mode 100644 index 0000000..9ad1027 --- /dev/null +++ b/datas/programs-links/xpdf.desktop @@ -0,0 +1,8 @@ +# EFLTK Configuration - Version 2,003000 + +[Desktop Entry] + Name=PDF Viewer + Exec=epdfreader + Icon=pdf-document.png + Name[sk]=PDF Viewer + diff --git a/datas/programs-links/xsane.desktop b/datas/programs-links/xsane.desktop new file mode 100644 index 0000000..8954316 --- /dev/null +++ b/datas/programs-links/xsane.desktop @@ -0,0 +1,8 @@ +# EFLTK Configuration - Version 2,003000 + +[Desktop Entry] + Name=XSane + Exec=xsane + Icon=scanner.png + Name[sk]=XSane + diff --git a/datas/programs-links/xwpe.desktop b/datas/programs-links/xwpe.desktop new file mode 100644 index 0000000..ae7ef29 --- /dev/null +++ b/datas/programs-links/xwpe.desktop @@ -0,0 +1,8 @@ +# EFLTK Configuration - Version 2,003000 + +[Desktop Entry] + Name=XWPE Editor + Name[sk]=Editor XWPE + Exec=xwpe + Icon=resource.png + diff --git a/datas/programs-links/xxgdb.desktop b/datas/programs-links/xxgdb.desktop new file mode 100644 index 0000000..99338a9 --- /dev/null +++ b/datas/programs-links/xxgdb.desktop @@ -0,0 +1,8 @@ +# EFLTK Configuration - Version 2,003000 + +[Desktop Entry] + Name=X Debuger + Icon=core.png + Exec=xxgdb + Name[sk]=X Debuger + diff --git a/datas/schemes/Active.scheme b/datas/schemes/Active.scheme new file mode 100644 index 0000000..685cdc9 --- /dev/null +++ b/datas/schemes/Active.scheme @@ -0,0 +1,29 @@ +# EFLTK Configuration - Version 2,000300 + +[widgets] + + [widgets/tooltip] + color=-16784896 + label color=32 + + [widgets/default] + color=7 + label color=32 + selection color=796173568 + selection text color=7 + highlight color=49 + off color=-623654656 + text color=32 + highlight label color=32 + label font=tahoma + text font=tahoma + label size=12 + text size=12 + text background=7 + font encoding=iso8859-2 + +[global colors] + background=-673724416 + +[general] + diff --git a/datas/schemes/Blueworld.scheme b/datas/schemes/Blueworld.scheme new file mode 100644 index 0000000..8f55dd3 --- /dev/null +++ b/datas/schemes/Blueworld.scheme @@ -0,0 +1,24 @@ + +[widgets] + + [widgets/tooltip] + color = -117460480 + label color = 32 + + [widgets/default] + color = 7 + label color = -320017408 + selection color = -1254740224 + selection text color = 7 + highlight color = 1939656960 + off color = -623654656 + text color = 32 + highlight label color = 1 + text background = 7 + label font = lucida sans + text font = lucida sans + label size = 12 + text size = 12 + +[global colors] + background = 1782567168 diff --git a/datas/schemes/Brown1.scheme b/datas/schemes/Brown1.scheme new file mode 100644 index 0000000..bcf612f --- /dev/null +++ b/datas/schemes/Brown1.scheme @@ -0,0 +1,25 @@ +[widgets] + + [widgets/default] + color=7 + label color=32 + selection color=796173568 + selection text color=7 + highlight color=49 + off color=-623654656 + text color=32 + highlight label color=32 + text background=7 + label font=lucida + text font=lucida + label size=12 + text size=12 + font encoding=iso8859-2 + + [widgets/tooltip] + color=-16784896 + label color=32 + +[global colors] + background=-673724416 + diff --git a/datas/schemes/Brown2.scheme b/datas/schemes/Brown2.scheme new file mode 100644 index 0000000..9c26b67 --- /dev/null +++ b/datas/schemes/Brown2.scheme @@ -0,0 +1,25 @@ +[widgets] + + [widgets/default] + color=7 + label color=32 + selection color=-1977078528 + selection text color=7 + highlight color=17 + off color=-623654656 + text color=32 + highlight label color=302170112 + text background=7 + label font=lucida + text font=lucida + label size=12 + text size=12 + font encoding=iso8859-2 + + [widgets/tooltip] + color=-941621504 + label color=32 + +[global colors] + background=17 + diff --git a/datas/schemes/Ede1.scheme b/datas/schemes/Ede1.scheme new file mode 100644 index 0000000..6bd0c1b --- /dev/null +++ b/datas/schemes/Ede1.scheme @@ -0,0 +1,24 @@ + +[widgets] + + [widgets/tooltip] + color = -117460480 + label color = 32 + + [widgets/default] + color = 7 + label color = 32 + selection color = 153381120 + selection text color = 7 + highlight color = -774778624 + off color = -623654656 + text color = 32 + highlight label color = 302170112 + text background = 7 + label font = tahoma + text font = tahoma + label size = 12 + text size = 12 + +[global colors] + background = -774778624 diff --git a/datas/schemes/Ede2.scheme b/datas/schemes/Ede2.scheme new file mode 100644 index 0000000..69e4860 --- /dev/null +++ b/datas/schemes/Ede2.scheme @@ -0,0 +1,25 @@ + +[widgets] + + [widgets/tooltip] + color = -16784896 + label color = 32 + + [widgets/default] + color = 7 + label color = 32 + selection color = 153381120 + selection text color = 7 + highlight color = 17 + off color = -623654656 + text color = 796173568 + highlight label color = -1659739904 + text background = 7 + label font = tahoma + text font = tahoma + label size = 12 + text size = 12 + font encoding = iso8859-2 + +[global colors] + background = 17 diff --git a/datas/schemes/Ede3.scheme b/datas/schemes/Ede3.scheme new file mode 100644 index 0000000..055c3f4 --- /dev/null +++ b/datas/schemes/Ede3.scheme @@ -0,0 +1,25 @@ + +[widgets] + + [widgets/tooltip] + color = -16784896 + label color = 32 + + [widgets/default] + color = 7 + label color = 32 + selection color = 153381120 + selection text color = 7 + highlight color = -572662528 + off color = -623654656 + text color = 796173568 + highlight label color = -1659739904 + text background = 7 + label font = tahoma + text font = tahoma + label size = 12 + text size = 12 + font encoding = iso8859-2 + +[global colors] + background = -572662528 diff --git a/datas/schemes/Futuristic.scheme b/datas/schemes/Futuristic.scheme new file mode 100644 index 0000000..c01f0b2 --- /dev/null +++ b/datas/schemes/Futuristic.scheme @@ -0,0 +1,26 @@ + +[widgets] + + [widgets/tooltip] + color = -16784896 + label color = 32 + + [widgets/default] + color = 7 + label color = 32 + selection color = 153381120 + selection text color = 7 + highlight color = -269488384 + off color = -623654656 + text color = 796173568 + highlight label color = -1659739904 + text background = 7 + label font = arial + text font = arial + label size = 12 + text size = 12 + font encoding = iso8859-2 + box = border + +[global colors] + background = -269488384 diff --git a/datas/schemes/Gray1.scheme b/datas/schemes/Gray1.scheme new file mode 100644 index 0000000..3f91e46 --- /dev/null +++ b/datas/schemes/Gray1.scheme @@ -0,0 +1,25 @@ +[widgets] + + [widgets/default] + color=7 + label color=32 + selection color=32768 + selection text color=7 + highlight color=29 + off color=-623654656 + text color=32 + highlight label color=32 + text background=7 + label font=lucida + text font=lucida + label size=12 + text size=12 + font encoding=iso8859-2 + + [widgets/tooltip] + color=-662528 + label color=32 + +[global colors] + background=29 + diff --git a/datas/schemes/GrayBrown.scheme b/datas/schemes/GrayBrown.scheme new file mode 100644 index 0000000..bcf612f --- /dev/null +++ b/datas/schemes/GrayBrown.scheme @@ -0,0 +1,25 @@ +[widgets] + + [widgets/default] + color=7 + label color=32 + selection color=796173568 + selection text color=7 + highlight color=49 + off color=-623654656 + text color=32 + highlight label color=32 + text background=7 + label font=lucida + text font=lucida + label size=12 + text size=12 + font encoding=iso8859-2 + + [widgets/tooltip] + color=-16784896 + label color=32 + +[global colors] + background=-673724416 + diff --git a/datas/schemes/LightBrown.scheme b/datas/schemes/LightBrown.scheme new file mode 100644 index 0000000..42c75a2 --- /dev/null +++ b/datas/schemes/LightBrown.scheme @@ -0,0 +1,24 @@ + +[widgets] + + [widgets/tooltip] + color = -941621504 + label color = 32 + + [widgets/default] + color = 7 + label color = 32 + selection color = -1977078528 + selection text color = 7 + highlight color = 17 + off color = -623654656 + text color = 32 + highlight label color = 302170112 + text background = 7 + label font = lucida sans + text font = lucida sans + label size = 12 + text size = 12 + +[global colors] + background = 17 diff --git a/datas/schemes/Lilola.scheme b/datas/schemes/Lilola.scheme new file mode 100644 index 0000000..374c7af --- /dev/null +++ b/datas/schemes/Lilola.scheme @@ -0,0 +1,25 @@ +[widgets] + + [widgets/default] + color=7 + label color=32 + selection color=-421795328 + selection text color=-2063563520 + highlight color=-269488384 + off color=-623654656 + text color=796173568 + highlight label color=-1659739904 + text background=7 + label font=tahoma + text font=tahoma + label size=12 + text size=12 + font encoding=iso8859-2 + + [widgets/tooltip] + color=-16784896 + label color=32 + +[global colors] + background=-269488384 + diff --git a/datas/schemes/Makefile b/datas/schemes/Makefile new file mode 100644 index 0000000..a3e45b2 --- /dev/null +++ b/datas/schemes/Makefile @@ -0,0 +1,33 @@ + +include ../../makeinclude + +schemesdir = $(datadir)/ede/.ede/schemes + +SCHEMES = \ + Active.scheme \ + Blueworld.scheme \ + Brown1.scheme \ + Brown2.scheme \ + Ede1.scheme \ + Ede2.scheme \ + Ede3.scheme \ + Futuristic.scheme \ + GrayBrown.scheme \ + Gray1.scheme \ + LightBrown.scheme \ + Lilola.scheme \ + None.scheme \ + Tubus.scheme \ + TypicalBrown.scheme + +install: + $(MKINSTALLDIRS) $(schemesdir);\ + for f in $(SCHEMES); do\ + echo "Installing $(schemesdir)/$$f";\ + $(INSTALL_DATA) $$f $(schemesdir);\ + done + +uninstall: + $(RM) -r $(schemesdir) + +clean: diff --git a/datas/schemes/None.scheme b/datas/schemes/None.scheme new file mode 100644 index 0000000..6bd0c1b --- /dev/null +++ b/datas/schemes/None.scheme @@ -0,0 +1,24 @@ + +[widgets] + + [widgets/tooltip] + color = -117460480 + label color = 32 + + [widgets/default] + color = 7 + label color = 32 + selection color = 153381120 + selection text color = 7 + highlight color = -774778624 + off color = -623654656 + text color = 32 + highlight label color = 302170112 + text background = 7 + label font = tahoma + text font = tahoma + label size = 12 + text size = 12 + +[global colors] + background = -774778624 diff --git a/datas/schemes/Tubus.scheme b/datas/schemes/Tubus.scheme new file mode 100644 index 0000000..994b854 --- /dev/null +++ b/datas/schemes/Tubus.scheme @@ -0,0 +1,25 @@ + +[widgets] + + [widgets/tooltip] + color = -16784896 + label color = 32 + + [widgets/default] + color = 7 + label color = 32 + selection color = 153381120 + selection text color = 7 + highlight color = -269488384 + off color = -623654656 + text color = 796173568 + highlight label color = -1659739904 + text background = 7 + label font = arial + text font = arial + label size = 12 + text size = 12 + font encoding = iso8859-2 + +[global colors] + background = -269488384 diff --git a/datas/schemes/TypicalBrown.scheme b/datas/schemes/TypicalBrown.scheme new file mode 100644 index 0000000..cea5121 --- /dev/null +++ b/datas/schemes/TypicalBrown.scheme @@ -0,0 +1,25 @@ +[widgets] + + [widgets/default] + color=7 + label color=32 + selection color=203844608 + selection text color=7 + highlight color=-724514816 + off color=-623654656 + text color=32 + highlight label color=32 + text background=7 + label font=tahoma + text font=tahoma + label size=12 + text size=12 + font encoding=iso8859-2 + + [widgets/tooltip] + color=-16784896 + label color=32 + +[global colors] + background=-724514816 + diff --git a/datas/startede.in b/datas/startede.in new file mode 100644 index 0000000..febdd2f --- /dev/null +++ b/datas/startede.in @@ -0,0 +1,47 @@ +#!/bin/sh +# +# startede.in +# +####################################################### +# $Id$ +# + +PREFIX=@prefix@ +XSSAVER=`which xscreensaver 2> /dev/null` +XSETROOT=`which xsetroot 2> /dev/null` + +userresources=$HOME/.Xdefaults +sysresources=/usr/X11R6/lib/X11/xinit/.Xresources + +if [ -f $sysresources ]; then + xrdb -merge $sysresources +fi + +if [ -f $userresources ]; then + xrdb -merge $userresources +fi + +PATH=$PATH:$PREFIX:$PREFIX/bin +export PATH + +if [ -x $HOME/.ede ]; then + echo "EDE home dir exists, ok." +else + echo "Default EDE home dir for user $HOME does not exist. Creating one..." + cp -R $PREFIX/share/ede/.ede $HOME +fi + +# If we have xsetroot than script shoult run it +if [ "$XSETROOT" ]; then + $XSETROOT -solid black +fi + +# Test if XScreenSaver is somewhere in PATH, if not - don't start it +if [ "$XSSAVER" ]; then + xscreensaver -nosplash & +fi + + exec edewm & + exec eiconman & + etip & + exec eworkpanel diff --git a/datas/startede2.in b/datas/startede2.in new file mode 100644 index 0000000..b4b4441 --- /dev/null +++ b/datas/startede2.in @@ -0,0 +1,79 @@ +#!/bin/sh +# $Id$ +# +# Main script responsible for starting and setting +# needed environment parts. +# +# Details about XDG_XXX data and how they are set is at: +# http://standards.freedesktop.org/basedir-spec/basedir-spec-0.6.html + +# Note: XDG_DATA_DIRS and XDG_CONFIG_DIRS are not currently used + +# EDE_DATA_HOME is directory where user specific data are stored. +# If XDG_DATA_HOME is not present, default is "$HOME/.local/share" +if [ "$XDG_DATA_HOME" ]; then + EDE_DATA_HOME=$XDG_DATA_HOME +else + EDE_DATA_HOME="$HOME/.local/share" +fi + +# EDE_CONFIG_HOME is directory where user configuration files are stored. +# If XDG_CONFIG_HOME is not present, default is "$HOME/.config" +if [ "$XDG_CONFIG_HOME" ]; then + EDE_CONFIG_HOME=$XDG_CONFIG_HOME +else + EDE_CONFIG_HOME="$HOME/.config" +fi + +# EDE_CACHE_HOME is directory where applications should keep cached data. +# If XDG_CACHE_HOME is not present, default is "$HOME/.cache" +if [ "$XDG_CACHE_HOME" ]; then + EDE_CACHE_HOME=$XDG_CACHE_HOME +else + EDE_CACHE_HOME="$HOME/.cache" +fi + +EDE_DATA_HOME="$EDE_DATA_HOME/ede" +[ -d $EDE_DATA_HOME ]; || mkdir -p $EDE_DATA_HOME +EDE_CONFIG_HOME="$EDE_CONFIG_HOME/ede" +[ -d $EDE_CONFIG_HOME ]; || mkdir -p $EDE_CONFIG_HOME +EDE_CACHE_HOME="$EDE_CACHE_HOME/ede" +[ -d $EDE_CACHE_HOME ]; || mkdir -p $EDE_CACHE_HOME + +export $EDE_DATA_HOME +export $EDE_CONFIG_HOME +export $EDE_CACHE_HOME + + +PREFIX=@prefix@ +XSSAVER=`which xscreensaver 2> /dev/null` +XSETROOT=`which xsetroot 2> /dev/null` + +userresources=$HOME/.Xdefaults +sysresources=/usr/X11R6/lib/X11/xinit/.Xresources + +if [ -f $sysresources ]; then + xrdb -merge $sysresources +fi + +if [ -f $userresources ]; then + xrdb -merge $userresources +fi + +PATH=$PATH:$PREFIX:$PREFIX/bin +export PATH + +# Set background inside X +if [ "$XSETROOT" ]; then + $XSETROOT -solid black +fi + +# Run xscreensaver if exists +if [ "$XSSAVER" ]; then + xscreensaver -nosplash & +fi + +edewm & +eiconman & +etip & +eworkpanel diff --git a/datas/wmanager.conf b/datas/wmanager.conf new file mode 100644 index 0000000..829da06 --- /dev/null +++ b/datas/wmanager.conf @@ -0,0 +1,32 @@ +# EFLTK Configuration - Version 2,000300 + +[TitleBar] + Active color=RGB(0,0,128) + Active color text=RGB(255,255,255) + Normal color=RGB(0,0,117) + Normal color text=RGB(192,192,192) + Draw gradient=1 + +[Resize] + Opaque resize=0 + Animate=1 + Animate Speed=20 + + + [Hotkeys] + NextWindow=Alt+Tab + PreviousWindow=Alt+Shift+Tab + Desktop1=Alt+F1 + Desktop2=Alt+F2 + Desktop3=Alt+F3 + Desktop4=Alt+F4 + Desktop5=Alt+F5 + Desktop6=Alt+F6 + Desktop7=Alt+F7 + Desktop8=Alt+F8 + NextDesktop=Alt+Ctrl+Right + PreviousDesktop=Alt+Ctrl+Left + FindFile=Ctrl+F3 + FastRun=Ctrl+F12 + CloseWindow=Ctrl+F4 + diff --git a/ecalc/Jamfile b/ecalc/Jamfile new file mode 100644 index 0000000..470e350 --- /dev/null +++ b/ecalc/Jamfile @@ -0,0 +1,16 @@ +# +# $Id$ +# +# Part of Equinox Desktop Environment (EDE). +# Copyright (c) 2000-2007 EDE Authors. +# +# This program is licenced under terms of the +# GNU General Public Licence version 2 or newer. +# See COPYING for details. + + +SubDir TOP ecalc ; + +SOURCE = SciCalc.cpp Main.cpp ; + +MakeProgram ecalc : $(SOURCE) ; diff --git a/ecalc/Main.cpp b/ecalc/Main.cpp new file mode 100644 index 0000000..dae27c3 --- /dev/null +++ b/ecalc/Main.cpp @@ -0,0 +1,10 @@ +// generated by Fast Light User Interface Designer (fluid) version 1.0108 + +#include "Main.h" + +int main(int ac,char *av) { + SciCalc *calc = new SciCalc(); + + calc->run(); + delete calc; +} diff --git a/ecalc/Main.fl b/ecalc/Main.fl new file mode 100644 index 0000000..d86f941 --- /dev/null +++ b/ecalc/Main.fl @@ -0,0 +1,14 @@ +# data file for the Fltk User Interface Designer (fluid) +version 1.0108 +header_name {.h} +code_name {.cpp} +decl {\#include "SciCalc.h"} {public +} + +Function {main(int ac,char *av)} {open selected return_type int +} { + code {SciCalc *calc = new SciCalc(); + + calc->run(); + delete calc;} {} +} diff --git a/ecalc/Main.h b/ecalc/Main.h new file mode 100644 index 0000000..215efb5 --- /dev/null +++ b/ecalc/Main.h @@ -0,0 +1,8 @@ +// generated by Fast Light User Interface Designer (fluid) version 1.0108 + +#ifndef Main_h +#define Main_h +#include +#include "SciCalc.h" +int main(int ac,char *av); +#endif diff --git a/ecalc/Makefile b/ecalc/Makefile new file mode 100644 index 0000000..4aff6ca --- /dev/null +++ b/ecalc/Makefile @@ -0,0 +1,17 @@ + +CPPFILES = SciCalc.cpp Main.cpp +TARGET = ecalc + +include ../makeinclude + +install: + $(INSTALL_PROGRAM) $(TARGET) $(bindir) + $(INSTALL_LOCALE) + +uninstall: + $(RM) $(bindir)/$(TARGET) + +clean: + $(RM) $(TARGET) + $(RM) *.o + diff --git a/ecalc/README b/ecalc/README new file mode 100644 index 0000000..3271393 --- /dev/null +++ b/ecalc/README @@ -0,0 +1,8 @@ +This small calculator with scientific functions based on flCalc - Copyright 2000 by Yves Usson. +http://www-timc.imag.fr/Yves.Usson/personnel/mysofts.html + +Mikko Lahteenmaki did a port to efltk. + +This version is based on original flCalc, with some cleanups. + +Sanel Zukan diff --git a/ecalc/SciCalc.cpp b/ecalc/SciCalc.cpp new file mode 100644 index 0000000..a0bfbf4 --- /dev/null +++ b/ecalc/SciCalc.cpp @@ -0,0 +1,1341 @@ +// generated by Fast Light User Interface Designer (fluid) version 1.0108 + +#include "SciCalc.h" +#include +#include +#include +#include "math.h" + +static double gammaln(double xx) { + int j; +double x,y,tmp,ser; +static double cof[6] = {76.18009172947146, + -86.50532032941677, + 24.01409824083091, + -1.231739572450155, + 0.1208650973866179e-2, + -0.5395239384953e-5}; + + y = x = xx; + tmp = x + 5.5; + tmp -= (x+0.5)*log(tmp); + ser = 1.000000000190015; + for (j=0;j<6;j++) ser += cof[j]/++y; + return -tmp+log(2.5066282746310005*ser/x); +} + +static double truncf(double x) { + if (x < 0.0) + x = -floor(-x); + else + x = floor(x); + return x; +} + +void SciCalc::cb_radio_2_i(Fl_Button*, void*) { + change_base(2); +} +void SciCalc::cb_radio_2(Fl_Button* o, void* v) { + ((SciCalc*)(o->parent()->parent()->user_data()))->cb_radio_2_i(o,v); +} + +void SciCalc::cb_radio_8_i(Fl_Button*, void*) { + change_base(8); +} +void SciCalc::cb_radio_8(Fl_Button* o, void* v) { + ((SciCalc*)(o->parent()->parent()->user_data()))->cb_radio_8_i(o,v); +} + +void SciCalc::cb_radio_10_i(Fl_Button*, void*) { + change_base(10); +} +void SciCalc::cb_radio_10(Fl_Button* o, void* v) { + ((SciCalc*)(o->parent()->parent()->user_data()))->cb_radio_10_i(o,v); +} + +void SciCalc::cb_radio_16_i(Fl_Button*, void*) { + change_base(16); +} +void SciCalc::cb_radio_16(Fl_Button* o, void* v) { + ((SciCalc*)(o->parent()->parent()->user_data()))->cb_radio_16_i(o,v); +} + +void SciCalc::cb_but_7_i(Fl_Button*, void*) { + handle_number(7); +} +void SciCalc::cb_but_7(Fl_Button* o, void* v) { + ((SciCalc*)(o->parent()->parent()->user_data()))->cb_but_7_i(o,v); +} + +void SciCalc::cb_but_8_i(Fl_Button*, void*) { + handle_number(8); +} +void SciCalc::cb_but_8(Fl_Button* o, void* v) { + ((SciCalc*)(o->parent()->parent()->user_data()))->cb_but_8_i(o,v); +} + +void SciCalc::cb_but_9_i(Fl_Button*, void*) { + handle_number(9); +} +void SciCalc::cb_but_9(Fl_Button* o, void* v) { + ((SciCalc*)(o->parent()->parent()->user_data()))->cb_but_9_i(o,v); +} + +void SciCalc::cb_but_4_i(Fl_Button*, void*) { + handle_number(4); +} +void SciCalc::cb_but_4(Fl_Button* o, void* v) { + ((SciCalc*)(o->parent()->parent()->user_data()))->cb_but_4_i(o,v); +} + +void SciCalc::cb_but_5_i(Fl_Button*, void*) { + handle_number(5); +} +void SciCalc::cb_but_5(Fl_Button* o, void* v) { + ((SciCalc*)(o->parent()->parent()->user_data()))->cb_but_5_i(o,v); +} + +void SciCalc::cb_but_6_i(Fl_Button*, void*) { + handle_number(6); +} +void SciCalc::cb_but_6(Fl_Button* o, void* v) { + ((SciCalc*)(o->parent()->parent()->user_data()))->cb_but_6_i(o,v); +} + +void SciCalc::cb_but_1_i(Fl_Button*, void*) { + handle_number(1); +} +void SciCalc::cb_but_1(Fl_Button* o, void* v) { + ((SciCalc*)(o->parent()->parent()->user_data()))->cb_but_1_i(o,v); +} + +void SciCalc::cb_but_2_i(Fl_Button*, void*) { + handle_number(2); +} +void SciCalc::cb_but_2(Fl_Button* o, void* v) { + ((SciCalc*)(o->parent()->parent()->user_data()))->cb_but_2_i(o,v); +} + +void SciCalc::cb_but_3_i(Fl_Button*, void*) { + handle_number(3); +} +void SciCalc::cb_but_3(Fl_Button* o, void* v) { + ((SciCalc*)(o->parent()->parent()->user_data()))->cb_but_3_i(o,v); +} + +void SciCalc::cb_but_0_i(Fl_Button*, void*) { + handle_number(0); +} +void SciCalc::cb_but_0(Fl_Button* o, void* v) { + ((SciCalc*)(o->parent()->parent()->user_data()))->cb_but_0_i(o,v); +} + +void SciCalc::cb_but_dot_i(Fl_Button*, void*) { + handle_number(DOT); +} +void SciCalc::cb_but_dot(Fl_Button* o, void* v) { + ((SciCalc*)(o->parent()->parent()->user_data()))->cb_but_dot_i(o,v); +} + +void SciCalc::cb_but_sign_i(Fl_Button*, void*) { + if (! emode) +{ + value[top] = -value[top]; + set_display(value[top],NORM); +} +else +{ + exponent = -exponent; + value[top] = mantissa*pow(10.0, (double)exponent); + set_display(mantissa,EXP); +}; +} +void SciCalc::cb_but_sign(Fl_Button* o, void* v) { + ((SciCalc*)(o->parent()->parent()->user_data()))->cb_but_sign_i(o,v); +} + +void SciCalc::cb_but_C_i(Fl_Button*, void*) { + init_value(top); +set_display(0.0,NORM); +} +void SciCalc::cb_but_C(Fl_Button* o, void* v) { + ((SciCalc*)(o->parent()->user_data()))->cb_but_C_i(o,v); +} + +void SciCalc::cb_but_AC_i(Fl_Button*, void*) { + init_value(0); +set_display(0.0,NORM); +currentbrkt = 0; +box_bracket->label(""); +box_bracket->redraw(); +} +void SciCalc::cb_but_AC(Fl_Button* o, void* v) { + ((SciCalc*)(o->parent()->user_data()))->cb_but_AC_i(o,v); +} + +void SciCalc::cb_but_X_i(Fl_Button*, void*) { + handle_operator(MULT); +} +void SciCalc::cb_but_X(Fl_Button* o, void* v) { + ((SciCalc*)(o->parent()->user_data()))->cb_but_X_i(o,v); +} + +void SciCalc::cb_but_div_i(Fl_Button*, void*) { + handle_operator(DIV); +} +void SciCalc::cb_but_div(Fl_Button* o, void* v) { + ((SciCalc*)(o->parent()->user_data()))->cb_but_div_i(o,v); +} + +void SciCalc::cb_but_plus_i(Fl_Button*, void*) { + handle_operator(PLUS); +} +void SciCalc::cb_but_plus(Fl_Button* o, void* v) { + ((SciCalc*)(o->parent()->user_data()))->cb_but_plus_i(o,v); +} + +void SciCalc::cb_but_minus_i(Fl_Button*, void*) { + handle_operator(MINUS); +} +void SciCalc::cb_but_minus(Fl_Button* o, void* v) { + ((SciCalc*)(o->parent()->user_data()))->cb_but_minus_i(o,v); +} + +void SciCalc::cb_but_pi_i(Fl_Button*, void*) { + exponent_pi(); +} +void SciCalc::cb_but_pi(Fl_Button* o, void* v) { + ((SciCalc*)(o->parent()->user_data()))->cb_but_pi_i(o,v); +} + +void SciCalc::cb_but_eval_i(Fl_Button*, void*) { + handle_operator(EVAL); +} +void SciCalc::cb_but_eval(Fl_Button* o, void* v) { + ((SciCalc*)(o->parent()->user_data()))->cb_but_eval_i(o,v); +} + +void SciCalc::cb_but_eval_hidden_i(Fl_Button*, void*) { + handle_operator(EVAL); +} +void SciCalc::cb_but_eval_hidden(Fl_Button* o, void* v) { + ((SciCalc*)(o->parent()->user_data()))->cb_but_eval_hidden_i(o,v); +} + +void SciCalc::cb_but_eval_hidden2_i(Fl_Button*, void*) { + handle_operator(EVAL); +} +void SciCalc::cb_but_eval_hidden2(Fl_Button* o, void* v) { + ((SciCalc*)(o->parent()->user_data()))->cb_but_eval_hidden2_i(o,v); +} + +void SciCalc::cb_but_sqrt_i(Fl_Button*, void*) { + if (base > 10) handle_number(10.0); + else + if (! inv) + { + value[top] = sqrt(value[top]); + set_display(value[top],NORM); + ready = 1; + } + else + { + value[top] = pow(value[top], 2.0); + set_display(value[top],NORM); + ready = 1; + }; +} +void SciCalc::cb_but_sqrt(Fl_Button* o, void* v) { + ((SciCalc*)(o->parent()->user_data()))->cb_but_sqrt_i(o,v); +} + +void SciCalc::cb_but_pow_i(Fl_Button*, void*) { + if (base > 10) + handle_number(11.0); + else + handle_operator(check_inv->value()?INVPOW:POW); +} +void SciCalc::cb_but_pow(Fl_Button* o, void* v) { + ((SciCalc*)(o->parent()->user_data()))->cb_but_pow_i(o,v); +} + +void SciCalc::cb_but_sin_i(Fl_Button*, void*) { + if (base > 10) handle_number(12.0); +else + if (! inv) + { + value[top] = sin(to_drg(value[top])); + set_display(value[top],NORM); + ready = 1; + } + else + { + value[top] = from_drg(asin(value[top])); + set_display(value[top],NORM); + ready = 1; + }; +} +void SciCalc::cb_but_sin(Fl_Button* o, void* v) { + ((SciCalc*)(o->parent()->user_data()))->cb_but_sin_i(o,v); +} + +void SciCalc::cb_but_cos_i(Fl_Button*, void*) { + if (base > 10) handle_number(13.0); +else + if (! inv) + { + value[top] = cos(to_drg(value[top])); + set_display(value[top],NORM); + ready = 1; + } + else + { + value[top] = from_drg(acos(value[top])); + set_display(value[top],NORM); + ready = 1; + }; +} +void SciCalc::cb_but_cos(Fl_Button* o, void* v) { + ((SciCalc*)(o->parent()->user_data()))->cb_but_cos_i(o,v); +} + +void SciCalc::cb_but_tan_i(Fl_Button*, void*) { + if (base > 10) handle_number(14.0); + else + if (! inv) + { + value[top] = tan(to_drg(value[top])); + set_display(value[top],NORM); + ready = 1; + } + else + { + value[top] = from_drg(atan(value[top])); + set_display(value[top],NORM); + ready = 1; + }; +} +void SciCalc::cb_but_tan(Fl_Button* o, void* v) { + ((SciCalc*)(o->parent()->user_data()))->cb_but_tan_i(o,v); +} + +void SciCalc::cb_but_log_i(Fl_Button*, void*) { + if (base > 10) handle_number(15.0); +else + if (! inv) + { + value[top] = log10(value[top]); + set_display(value[top],NORM); + ready = 1; + } + else + { + value[top] = pow(10.0, value[top]); + set_display(value[top],NORM); + ready = 1; + }; +} +void SciCalc::cb_but_log(Fl_Button* o, void* v) { + ((SciCalc*)(o->parent()->user_data()))->cb_but_log_i(o,v); +} + +void SciCalc::cb_but_ln_i(Fl_Button*, void*) { + if (! inv) + { + value[top] = log(value[top]); + set_display(value[top],NORM); + ready = 1; + } + else + { + value[top] = exp(value[top]); + set_display(value[top],NORM); + ready = 1; + }; +} +void SciCalc::cb_but_ln(Fl_Button* o, void* v) { + ((SciCalc*)(o->parent()->user_data()))->cb_but_ln_i(o,v); +} + +void SciCalc::cb_but_int_i(Fl_Button*, void*) { + if (! inv) + { + value[top] = truncf(value[top]); + set_display(value[top],NORM); + ready = 1; + } + else + { + value[top] = value[top] - truncf(value[top]); + set_display(value[top],NORM); + ready = 1; + }; +} +void SciCalc::cb_but_int(Fl_Button* o, void* v) { + ((SciCalc*)(o->parent()->user_data()))->cb_but_int_i(o,v); +} + +void SciCalc::cb_but_dr_i(Fl_Button*, void*) { + if (! inv) + { + value[top] = M_PI*value[top]/180.0; + set_display(value[top],NORM); + ready = 1; + } + else + { + value[top] = 180.0*value[top]/M_PI; + set_display(value[top],NORM); + ready = 1; + }; +} +void SciCalc::cb_but_dr(Fl_Button* o, void* v) { + ((SciCalc*)(o->parent()->user_data()))->cb_but_dr_i(o,v); +} + +void SciCalc::cb_but_drg_i(Fl_Button*, void*) { + drgmode++; + drgmode %= 3; + set_drgdisp(); +} +void SciCalc::cb_but_drg(Fl_Button* o, void* v) { + ((SciCalc*)(o->parent()->user_data()))->cb_but_drg_i(o,v); +} + +void SciCalc::cb_but_leftbr_i(Fl_Button*, void*) { + add_left_bracket(); +} +void SciCalc::cb_but_leftbr(Fl_Button* o, void* v) { + ((SciCalc*)(o->parent()->user_data()))->cb_but_leftbr_i(o,v); +} + +void SciCalc::cb_but_rightbr_i(Fl_Button*, void*) { + add_right_bracket(); +} +void SciCalc::cb_but_rightbr(Fl_Button* o, void* v) { + ((SciCalc*)(o->parent()->user_data()))->cb_but_rightbr_i(o,v); +} + +void SciCalc::cb_but_exch_i(Fl_Button*, void*) { + exchange(); +} +void SciCalc::cb_but_exch(Fl_Button* o, void* v) { + ((SciCalc*)(o->parent()->user_data()))->cb_but_exch_i(o,v); +} + +void SciCalc::cb_but_invx_i(Fl_Button*, void*) { + value[top] = 1.0/value[top]; + set_display(value[top],NORM); + ready = 1; +} +void SciCalc::cb_but_invx(Fl_Button* o, void* v) { + ((SciCalc*)(o->parent()->user_data()))->cb_but_invx_i(o,v); +} + +void SciCalc::cb_but_fact_i(Fl_Button*, void*) { + factorial(); +} +void SciCalc::cb_but_fact(Fl_Button* o, void* v) { + ((SciCalc*)(o->parent()->user_data()))->cb_but_fact_i(o,v); +} + +void SciCalc::cb_but_Mplus_i(Fl_Button*, void*) { + if (! inv) mem += value[top]; else mem -= value[top]; + set_display(value[top],NORM); + ready = 1; + set_memdisp(); +} +void SciCalc::cb_but_Mplus(Fl_Button* o, void* v) { + ((SciCalc*)(o->parent()->user_data()))->cb_but_Mplus_i(o,v); +} + +void SciCalc::cb_but_Mmult_i(Fl_Button*, void*) { + if (! inv) mem *= value[top]; else mem /= value[top]; + set_display(value[top],NORM); + ready = 1; + set_memdisp(); +} +void SciCalc::cb_but_Mmult(Fl_Button* o, void* v) { + ((SciCalc*)(o->parent()->user_data()))->cb_but_Mmult_i(o,v); +} + +void SciCalc::cb_but_Mclear_i(Fl_Button*, void*) { + if (! inv) + { + mem = 0.0; + set_display(value[top],NORM); + ready = 1; + set_memdisp(); + } + else + memexch(); +} +void SciCalc::cb_but_Mclear(Fl_Button* o, void* v) { + ((SciCalc*)(o->parent()->user_data()))->cb_but_Mclear_i(o,v); +} + +void SciCalc::cb_but_Mst_i(Fl_Button*, void*) { + mem = value[top]; + set_display(value[top],NORM); + ready = 1; + set_memdisp(); +} +void SciCalc::cb_but_Mst(Fl_Button* o, void* v) { + ((SciCalc*)(o->parent()->user_data()))->cb_but_Mst_i(o,v); +} + +void SciCalc::cb_but_Mrc_i(Fl_Button*, void*) { + value[top] = mem; + set_display(value[top],NORM); + ready = 1; +} +void SciCalc::cb_but_Mrc(Fl_Button* o, void* v) { + ((SciCalc*)(o->parent()->user_data()))->cb_but_Mrc_i(o,v); +} + +void SciCalc::cb_check_inv_i(Fl_Button*, void*) { + if (inv) + { + inv = 0; + setnormlabels(); + } + else + { + inv = 1; + setinvlabels(); + }; +} +void SciCalc::cb_check_inv(Fl_Button* o, void* v) { + ((SciCalc*)(o->parent()->user_data()))->cb_check_inv_i(o,v); +} + +void SciCalc::cb_but_quit_i(Fl_Button*, void*) { + win->hide(); +delete win; +} +void SciCalc::cb_but_quit(Fl_Button* o, void* v) { + ((SciCalc*)(o->parent()->user_data()))->cb_but_quit_i(o,v); +} +/* members */ +/********/ + +SciCalc::SciCalc() { + { win = new Fl_Double_Window(181, 262, "flCalc"); + win->user_data((void*)(this)); + { leddisplay = new Fl_Box(5, 3, 172, 24, "0 "); + leddisplay->box(FL_DOWN_BOX); + leddisplay->color((Fl_Color)207); + leddisplay->labelfont(1); + leddisplay->labelsize(16); + leddisplay->labelcolor((Fl_Color)59); + leddisplay->align(FL_ALIGN_RIGHT|FL_ALIGN_INSIDE); + } // Fl_Box* leddisplay + { box_DEGRAD = new Fl_Box(24, 27, 35, 15, " "); + box_DEGRAD->box(FL_ENGRAVED_BOX); + box_DEGRAD->labelsize(9); + box_DEGRAD->align(FL_ALIGN_CENTER|FL_ALIGN_INSIDE); + } // Fl_Box* box_DEGRAD + { box_bracket = new Fl_Box(59, 27, 65, 15); + box_bracket->box(FL_ENGRAVED_BOX); + box_bracket->labelsize(9); + box_bracket->align(FL_ALIGN_CENTER|FL_ALIGN_INSIDE); + } // Fl_Box* box_bracket + { box_M = new Fl_Box(124, 27, 35, 15, "M"); + box_M->box(FL_ENGRAVED_BOX); + box_M->labelsize(9); + box_M->align(FL_ALIGN_CENTER|FL_ALIGN_INSIDE); + } // Fl_Box* box_M + { Fl_Group* o = new Fl_Group(46, 44, 93, 22); + o->color((Fl_Color)46); + { radio_2 = new Fl_Button(49, 48, 20, 15, "2"); + radio_2->type(102); + radio_2->labelsize(10); + radio_2->labelcolor((Fl_Color)1); + radio_2->callback((Fl_Callback*)cb_radio_2); + } // Fl_Button* radio_2 + { radio_8 = new Fl_Button(70, 48, 21, 15, "8"); + radio_8->type(102); + radio_8->labelsize(10); + radio_8->labelcolor((Fl_Color)1); + radio_8->callback((Fl_Callback*)cb_radio_8); + } // Fl_Button* radio_8 + { radio_10 = new Fl_Button(92, 48, 21, 15, "10"); + radio_10->type(102); + radio_10->value(1); + radio_10->labelsize(10); + radio_10->labelcolor((Fl_Color)1); + radio_10->callback((Fl_Callback*)cb_radio_10); + } // Fl_Button* radio_10 + { radio_16 = new Fl_Button(114, 48, 21, 15, "16"); + radio_16->type(102); + radio_16->labelsize(10); + radio_16->labelcolor((Fl_Color)1); + radio_16->callback((Fl_Callback*)cb_radio_16); + } // Fl_Button* radio_16 + o->end(); + } // Fl_Group* o + { Fl_Group* o = new Fl_Group(3, 163, 107, 94); + o->box(FL_FLAT_BOX); + o->color((Fl_Color)43); + { but_7 = new Fl_Button(6, 167, 32, 20, "7"); + but_7->shortcut(0x37); + but_7->labelfont(1); + but_7->labelsize(16); + but_7->callback((Fl_Callback*)cb_but_7); + } // Fl_Button* but_7 + { but_8 = new Fl_Button(41, 167, 32, 20, "8"); + but_8->shortcut(0x38); + but_8->labelfont(1); + but_8->labelsize(16); + but_8->callback((Fl_Callback*)cb_but_8); + } // Fl_Button* but_8 + { but_9 = new Fl_Button(75, 167, 32, 20, "9"); + but_9->shortcut(0x39); + but_9->labelfont(1); + but_9->labelsize(16); + but_9->callback((Fl_Callback*)cb_but_9); + } // Fl_Button* but_9 + { but_4 = new Fl_Button(6, 189, 32, 20, "4"); + but_4->shortcut(0x34); + but_4->labelfont(1); + but_4->labelsize(16); + but_4->callback((Fl_Callback*)cb_but_4); + } // Fl_Button* but_4 + { but_5 = new Fl_Button(41, 189, 32, 20, "5"); + but_5->shortcut(0x35); + but_5->labelfont(1); + but_5->labelsize(16); + but_5->callback((Fl_Callback*)cb_but_5); + } // Fl_Button* but_5 + { but_6 = new Fl_Button(75, 189, 32, 20, "6"); + but_6->shortcut(0x36); + but_6->labelfont(1); + but_6->labelsize(16); + but_6->callback((Fl_Callback*)cb_but_6); + } // Fl_Button* but_6 + { but_1 = new Fl_Button(6, 211, 32, 20, "1"); + but_1->shortcut(0x31); + but_1->labelfont(1); + but_1->labelsize(16); + but_1->callback((Fl_Callback*)cb_but_1); + } // Fl_Button* but_1 + { but_2 = new Fl_Button(41, 211, 32, 20, "2"); + but_2->shortcut(0x32); + but_2->labelfont(1); + but_2->labelsize(16); + but_2->callback((Fl_Callback*)cb_but_2); + } // Fl_Button* but_2 + { but_3 = new Fl_Button(75, 211, 32, 20, "3"); + but_3->shortcut(0x33); + but_3->labelfont(1); + but_3->labelsize(16); + but_3->callback((Fl_Callback*)cb_but_3); + } // Fl_Button* but_3 + { but_0 = new Fl_Button(6, 233, 32, 20, "0"); + but_0->shortcut(0x30); + but_0->labelfont(1); + but_0->labelsize(16); + but_0->callback((Fl_Callback*)cb_but_0); + } // Fl_Button* but_0 + { but_dot = new Fl_Button(41, 233, 32, 20, "."); + but_dot->shortcut(0x2e); + but_dot->labelfont(1); + but_dot->labelsize(16); + but_dot->callback((Fl_Callback*)cb_but_dot); + } // Fl_Button* but_dot + { but_sign = new Fl_Button(75, 233, 32, 20, "+/-"); + but_sign->labelfont(1); + but_sign->labelsize(16); + but_sign->callback((Fl_Callback*)cb_but_sign); + } // Fl_Button* but_sign + o->end(); + } // Fl_Group* o + { but_C = new Fl_Button(112, 167, 31, 20, "C"); + but_C->labelfont(1); + but_C->labelsize(16); + but_C->callback((Fl_Callback*)cb_but_C); + } // Fl_Button* but_C + { but_AC = new Fl_Button(146, 167, 30, 20, "AC"); + but_AC->labelfont(1); + but_AC->labelsize(16); + but_AC->callback((Fl_Callback*)cb_but_AC); + } // Fl_Button* but_AC + { but_X = new Fl_Button(112, 189, 31, 20, "x"); + but_X->shortcut(0x2a); + but_X->labelfont(1); + but_X->labelsize(16); + but_X->callback((Fl_Callback*)cb_but_X); + } // Fl_Button* but_X + { but_div = new Fl_Button(146, 189, 30, 20, "/"); + but_div->shortcut(0x2f); + but_div->labelfont(1); + but_div->labelsize(16); + but_div->callback((Fl_Callback*)cb_but_div); + } // Fl_Button* but_div + { but_plus = new Fl_Button(112, 211, 31, 20, "+"); + but_plus->shortcut(0x2b); + but_plus->labelfont(1); + but_plus->labelsize(16); + but_plus->callback((Fl_Callback*)cb_but_plus); + } // Fl_Button* but_plus + { but_minus = new Fl_Button(146, 211, 30, 20, "-"); + but_minus->shortcut(0x2d); + but_minus->labelfont(1); + but_minus->labelsize(16); + but_minus->callback((Fl_Callback*)cb_but_minus); + } // Fl_Button* but_minus + { but_pi = new Fl_Button(112, 233, 31, 20, "e/p"); + but_pi->labelfont(12); + but_pi->labelsize(17); + but_pi->callback((Fl_Callback*)cb_but_pi); + } // Fl_Button* but_pi + { but_eval = new Fl_Button(146, 233, 30, 20, "="); + but_eval->shortcut(0x3d); + but_eval->labelfont(1); + but_eval->labelsize(16); + but_eval->callback((Fl_Callback*)cb_but_eval); + } // Fl_Button* but_eval + { but_eval_hidden = new Fl_Button(147, 253, 6, 7); + but_eval_hidden->box(FL_NO_BOX); + but_eval_hidden->shortcut(0xff0d); + but_eval_hidden->labelfont(1); + but_eval_hidden->labelsize(16); + but_eval_hidden->callback((Fl_Callback*)cb_but_eval_hidden); + } // Fl_Button* but_eval_hidden + { but_eval_hidden2 = new Fl_Button(157, 263, 6, 7); + but_eval_hidden2->box(FL_NO_BOX); + but_eval_hidden2->shortcut(0xff8d); + but_eval_hidden2->labelfont(1); + but_eval_hidden2->labelsize(16); + but_eval_hidden2->callback((Fl_Callback*)cb_but_eval_hidden2); + } // Fl_Button* but_eval_hidden2 + { but_sqrt = new Fl_Button(6, 70, 32, 21, "sqrt"); + but_sqrt->labelsize(11); + but_sqrt->labelcolor((Fl_Color)4); + but_sqrt->callback((Fl_Callback*)cb_but_sqrt); + } // Fl_Button* but_sqrt + { but_pow = new Fl_Button(41, 70, 32, 21, "x^y"); + but_pow->labelsize(11); + but_pow->labelcolor((Fl_Color)4); + but_pow->callback((Fl_Callback*)cb_but_pow); + } // Fl_Button* but_pow + { but_sin = new Fl_Button(76, 70, 31, 21, "sin"); + but_sin->labelsize(11); + but_sin->labelcolor((Fl_Color)4); + but_sin->callback((Fl_Callback*)cb_but_sin); + } // Fl_Button* but_sin + { but_cos = new Fl_Button(110, 70, 31, 21, "cos"); + but_cos->labelsize(11); + but_cos->labelcolor((Fl_Color)4); + but_cos->callback((Fl_Callback*)cb_but_cos); + } // Fl_Button* but_cos + { but_tan = new Fl_Button(144, 70, 30, 21, "tan"); + but_tan->labelsize(11); + but_tan->labelcolor((Fl_Color)4); + but_tan->callback((Fl_Callback*)cb_but_tan); + } // Fl_Button* but_tan + { but_log = new Fl_Button(6, 93, 32, 21, "log"); + but_log->labelsize(11); + but_log->labelcolor((Fl_Color)4); + but_log->callback((Fl_Callback*)cb_but_log); + } // Fl_Button* but_log + { but_ln = new Fl_Button(41, 93, 32, 21, "ln"); + but_ln->labelsize(11); + but_ln->labelcolor((Fl_Color)4); + but_ln->callback((Fl_Callback*)cb_but_ln); + } // Fl_Button* but_ln + { but_int = new Fl_Button(76, 93, 31, 21, "int"); + but_int->labelsize(11); + but_int->labelcolor((Fl_Color)4); + but_int->callback((Fl_Callback*)cb_but_int); + } // Fl_Button* but_int + { but_dr = new Fl_Button(110, 93, 31, 21, "d->r"); + but_dr->labelsize(10); + but_dr->labelcolor((Fl_Color)4); + but_dr->callback((Fl_Callback*)cb_but_dr); + } // Fl_Button* but_dr + { but_drg = new Fl_Button(144, 93, 30, 21, "d-r-g"); + but_drg->labelsize(9); + but_drg->callback((Fl_Callback*)cb_but_drg); + } // Fl_Button* but_drg + { but_leftbr = new Fl_Button(6, 116, 32, 21, "["); + but_leftbr->shortcut(0x28); + but_leftbr->labelsize(11); + but_leftbr->callback((Fl_Callback*)cb_but_leftbr); + } // Fl_Button* but_leftbr + { but_rightbr = new Fl_Button(41, 116, 32, 21, "]"); + but_rightbr->shortcut(0x29); + but_rightbr->labelsize(11); + but_rightbr->callback((Fl_Callback*)cb_but_rightbr); + } // Fl_Button* but_rightbr + { but_exch = new Fl_Button(76, 116, 31, 21, "exch"); + but_exch->labelsize(11); + but_exch->callback((Fl_Callback*)cb_but_exch); + } // Fl_Button* but_exch + { but_invx = new Fl_Button(110, 116, 31, 21, "1/x"); + but_invx->labelsize(11); + but_invx->callback((Fl_Callback*)cb_but_invx); + } // Fl_Button* but_invx + { but_fact = new Fl_Button(144, 116, 30, 21, "x!"); + but_fact->labelsize(11); + but_fact->callback((Fl_Callback*)cb_but_fact); + } // Fl_Button* but_fact + { but_Mplus = new Fl_Button(6, 139, 32, 21, "M+"); + but_Mplus->color((Fl_Color)93); + but_Mplus->labelcolor((Fl_Color)4); + but_Mplus->callback((Fl_Callback*)cb_but_Mplus); + } // Fl_Button* but_Mplus + { but_Mmult = new Fl_Button(41, 139, 32, 21, "M*"); + but_Mmult->color((Fl_Color)93); + but_Mmult->labelcolor((Fl_Color)4); + but_Mmult->callback((Fl_Callback*)cb_but_Mmult); + } // Fl_Button* but_Mmult + { but_Mclear = new Fl_Button(76, 139, 31, 21, "MC"); + but_Mclear->color((Fl_Color)93); + but_Mclear->labelcolor((Fl_Color)4); + but_Mclear->callback((Fl_Callback*)cb_but_Mclear); + } // Fl_Button* but_Mclear + { but_Mst = new Fl_Button(110, 139, 31, 21, "Mst"); + but_Mst->color((Fl_Color)93); + but_Mst->callback((Fl_Callback*)cb_but_Mst); + } // Fl_Button* but_Mst + { but_Mrc = new Fl_Button(144, 139, 30, 21, "Mrc"); + but_Mrc->color((Fl_Color)93); + but_Mrc->callback((Fl_Callback*)cb_but_Mrc); + } // Fl_Button* but_Mrc + { check_inv = new Fl_Button(6, 44, 32, 21, "inv"); + check_inv->type(1); + check_inv->labelsize(11); + check_inv->labelcolor((Fl_Color)4); + check_inv->callback((Fl_Callback*)cb_check_inv); + } // Fl_Button* check_inv + { but_quit = new Fl_Button(145, 44, 29, 21, "Exit"); + but_quit->labelfont(1); + but_quit->labelcolor((Fl_Color)33); + but_quit->callback((Fl_Callback*)cb_but_quit); + } // Fl_Button* but_quit + win->end(); + } // Fl_Double_Window* win + init_value(0); + drgmode = 1; + base = 10; + currentbrkt = 0; + startbrkt[0] = 0; + + set_memdisp(); + set_brktdisp(); + radio_10->value(1); + set_drgdisp(); + set_display(0.0,NONE); +} + +SciCalc::~SciCalc() { +} + +void SciCalc::run(int px,int py) { + win->show(); +Fl::run(); +} + +void SciCalc::handle_number(double numb) { + int first; +double sign; + + if (ready) init_value(top); + + if (numb == -1.0) + if (dot) /* check whether we already have a dot */ + return; + else + { + dot = 1; + set_display(value[top],DOT); + return; + } + + if (emode) + { + sign = copysign(1.0, (double)exponent); + if (abs(exponent)*10 + numb > 999) + { /* cycle if exponent has > 3 digits */ + first = (int)floor((double)abs(exponent)/100.0); + exponent = abs(exponent) - 100*first; + exponent *= (int)sign; + } + exponent = exponent*10 + (int) (sign*numb); + value[top] = mantissa*pow(10.0, (double)exponent); + set_display(mantissa, EXP); + } + else if (numb < base) + { /* both decimal and non decimal number entry */ + sign = copysign(1.0, value[top]); + if (dot && behind < 9) + { + behind++; + diver = diver/(double)base; + value[top] += sign*diver*numb; + } + else + if ((! dot) && (value[top] < 1.0e10)) + value[top] = (double)base*value[top] + sign*numb; + + set_display(value[top],(mode)behind); + } +} + +void SciCalc::handle_operator(Operator op) { + int prevop, i, finished; + + switch (op) + { + case PLUS: + case MINUS: + case MULT: + case DIV: + case POW: + case INVPOW: + finished = 0; + do + { + if (top == startbrkt[currentbrkt]) finished = 1; /* is 1st operator */ + if (! finished) + { /* compare priority of previous operators with current op */ + prevop = oper[top-1]; + if (priority[prevop] < priority[op]) + finished = 1; + else + { /* last op can be calculated */ + top--; + calc(top); + } + } + } while (! finished); + + oper[top] = op; + init_value(top+1); + + set_display(value[top-1],NORM); + break; + + case EVAL: + while (currentbrkt > 0) add_right_bracket(); + for (i = top; i > 0; i--) calc(i-1); + top = 0; + ready = 1; + set_display(value[top],NORM); + break; + } +} + +void SciCalc::change_base(int newbase) { + int oldbase; + + oldbase = base; + base = newbase; + + set_display(value[top], NORM); + ready = 1; + if ((oldbase == 16) || (base == 16)) setnormlabels(); +} + +void SciCalc::set_display(double val,mode behind) { + int i; +char dispstr[40], expstr[10], str2[10]; + + /* number or operator handled to get here so reset inv stuff */ +/* + if (inv) + { + inv = 0; + check_inv->value(0); + setnormlabels(); + }*/ + if (behind >= 0) + { /* format with appropriate number of decimal places */ + if (base == 10) + { + emode = 0; + strcpy(str2,"%.1f"); + str2[2] = behind + '0'; + sprintf(dispstr,str2,val); + } + else /* non base 10 display */ + cvttobase(val, base, behind, dispstr); + } + else + if (behind == DOT) + { /* display the . at the right */ + if (base == 10) + { + emode = 0; + sprintf(dispstr,"%.1f",val); + dispstr[strlen(dispstr)-1] = 0; + } + else + cvttobase(val, base, behind, dispstr); + } + else if (behind == NORM) + { /* normal display */ + if (base == 10) + { + emode = 0; + sprintf(dispstr,"%.9g",val); + } + else /* non base 10 display */ + cvttobase(val, base, behind, dispstr); + } + else + { /* exponent entering display */ + sprintf(dispstr,"%.8f",val); + for (i = strlen(dispstr); dispstr[i-1] == '0'; i--); + dispstr[i] =0; + strcat(dispstr, "e"); + sprintf(expstr,"%d",exponent); + strcat(dispstr, expstr); + } + strcat(dispstr," "); + dispstr[17] = 0; + leddisplay->copy_label(dispstr); + leddisplay->redraw(); +} + +void SciCalc::set_memdisp() { + if (mem) + box_M->label("M"); +else + box_M->label(""); +box_M->redraw(); +} + +void SciCalc::set_drgdisp() { + if (drgmode == 0) + box_DEGRAD->label("DEG"); +else +{ + if (drgmode == 1) + box_DEGRAD->label("RAD"); + else + box_DEGRAD->label("GRAD"); +} +box_DEGRAD->redraw(); +} + +void SciCalc::set_brktdisp() { + char dispstr[40]; + + if (currentbrkt > 0) + { + sprintf(dispstr, "%d [ max %d", currentbrkt, MaxNumBrkts); + box_bracket->copy_label(dispstr); + } + else + box_bracket->label(""); +box_bracket->redraw(); +} + +void SciCalc::add_left_bracket() { + if (currentbrkt < MaxNumBrkts) + { + currentbrkt++; + startbrkt[currentbrkt] = top; + ready = 1; + set_brktdisp(); + } +} + +void SciCalc::add_right_bracket() { + int i; + + if (currentbrkt > 0) + { + for (i = top; i > startbrkt[currentbrkt]; i--) calc(i-1); + top = startbrkt[currentbrkt]; + currentbrkt--; + ready = 1; + } + set_display(value[top],NORM); + set_brktdisp(); +} + +void SciCalc::factorial() { + double lg, alpha; + + /* uses gamma functions to get result for non-integer values */ + + alpha = value[top] + 1.0; + if ((floor(alpha) == alpha)&&(alpha <= 0.0)) + { + init_value(0); + leddisplay->label("Error: -ve integer "); + leddisplay->redraw(); + } + else + if (alpha > 32) + { + lg = exp(gammaln(alpha)); + value[top] = lg; + set_display(value[top],NORM); + ready = 1; + } + else + if (alpha > 1.0) + { + int n = (int)truncf(alpha); + lg = 1.0; + for (int i = 1; i startbrkt[currentbrkt]) { + temp = value[top]; + value[top] = value[top-1]; + value[top-1] = temp; + + set_display(value[top],NORM); + ready = 1; + } +} + +void SciCalc::exponent_pi() { + if ((value[top] == 0.0) || (ready)) { + value[top] = M_PI; + set_display(value[top],NORM); + ready = 1; + } + else if ((! emode) && (base == 10)) { + emode = 1; + exponent = 0; + mantissa = value[top]; + set_display(mantissa,EXP); + } +} + +void SciCalc::calc(int i) { + switch (oper[i]) + { + case PLUS: value[i] += value[i+1]; break; + case MINUS: value[i] -= value[i+1]; break; + case MULT: value[i] *= value[i+1]; break; + case DIV: value[i] /= value[i+1]; break; + case POW: value[i] = pow(value[i], value[i+1]); break; + case INVPOW: value[i] = pow(value[i], 1.0/value[i+1]); break; + } +} + +void SciCalc::init_value(int lev) { + top = lev; + value[top] = 0.0; + ready = 0; + emode = 0; + dot = 0; + diver = 1.0; + behind = 0; + if (inv) + { + inv = 0; + check_inv->value(0); + setnormlabels(); + } +} + +void SciCalc::cvttobase(double num,int base,mode behind,char *str) { + double sign, div; +int place, digit, i; +char digstr[2]; + + sign = copysign(1.0, num); + num *= sign; + if (sign == -1.0) + sprintf(str, "-"); + else + str[0] = 0; + + if (num == 0.0) + { + sprintf(str, "0"); + if (behind > 0) + { + strcat(str, "."); + for(i = 0; i < behind; i++) strcat(str, "0"); + } + return; + } + place = (int)( log(num)/log((double)base) ); + if (place < 0) place = 0; + do + { + div = pow((double)base, (double)place); + digit = (int)(num/div); + num -= (double)digit*div; + if (place == -1) strcat(str, "."); + place--; + sprintf(digstr, "%x", digit); + strcat(str, digstr); + if (strlen(str) > 18) + { + sprintf(str, "can't display"); + return; + } + } while ((place >= 0) || ((place >= -9) && (num != 0.0))); + + if ((place == -1) && ((behind == DOT) || (behind > 0))) + strcat(str, "."); + while ((behind > 0) && (behind >= -place)) + { + strcat(str, "0"); + place--; + } +} + +void SciCalc::setnormlabels() { + if (base <= 10) + { + but_sqrt->label("sqrt"); but_sqrt->shortcut(0); + but_pow->label("x^y"); but_pow->shortcut(0); + but_sin->label("sin"); but_sin->shortcut(0); + but_cos->label("cos"); but_cos->shortcut(0); + but_tan->label("tan"); but_tan->shortcut(0); + but_log->label("log"); but_log->shortcut(0); + but_sqrt->labelcolor(FL_BLUE); + but_pow->labelcolor(FL_BLUE); + but_sin->labelcolor(FL_BLUE); + but_cos->labelcolor(FL_BLUE); + but_tan->labelcolor(FL_BLUE); + but_log->labelcolor(FL_BLUE); + } + else + { + but_sqrt->label("a"); but_sqrt->shortcut('a'); + but_pow->label("b"); but_pow->shortcut('b'); + but_sin->label("c"); but_sin->shortcut('c'); + but_cos->label("d"); but_cos->shortcut('d'); + but_tan->label("e"); but_tan->shortcut('e'); + but_log->label("f"); but_log->shortcut('f'); + but_sqrt->labelcolor(FL_BLACK); + but_pow->labelcolor(FL_BLACK); + but_sin->labelcolor(FL_BLACK); + but_cos->labelcolor(FL_BLACK); + but_tan->labelcolor(FL_BLACK); + but_log->labelcolor(FL_BLACK); + } + but_ln->label("ln"); + but_int->label("int"); + but_dr->label("d->r"); + but_Mplus->label("M+"); + but_Mmult->label("M*"); + but_Mclear->label("MC"); + but_sqrt->redraw(); + but_pow->redraw(); + but_sin->redraw(); + but_cos->redraw(); + but_tan->redraw(); + but_log->redraw(); + but_ln->redraw(); + but_int->redraw(); + but_dr->redraw(); + but_Mplus->redraw(); + but_Mmult->redraw(); + but_Mclear->redraw(); +} + +void SciCalc::setinvlabels() { + if (base <= 10) + { + but_sqrt->label("x^2"); + but_pow->label("x^1/y"); + but_sin->label("asin"); + but_cos->label("acos"); + but_tan->label("atan"); + but_log->label("10^x"); + but_sqrt->labelcolor(FL_BLUE); + but_pow->labelcolor(FL_BLUE); + but_sin->labelcolor(FL_BLUE); + but_cos->labelcolor(FL_BLUE); + but_tan->labelcolor(FL_BLUE); + but_log->labelcolor(FL_BLUE); + } + else + { + but_sqrt->label("a"); + but_pow->label("b"); + but_sin->label("c"); + but_cos->label("d"); + but_tan->label("e"); + but_log->label("f"); + but_sqrt->labelcolor(FL_BLACK); + but_pow->labelcolor(FL_BLACK); + but_sin->labelcolor(FL_BLACK); + but_cos->labelcolor(FL_BLACK); + but_tan->labelcolor(FL_BLACK); + but_log->labelcolor(FL_BLACK); + } + but_ln->label("e^x"); + but_int->label("frac"); + but_dr->label("r->d"); + but_Mplus->label("M-"); + but_Mmult->label("M/"); + but_Mclear->label("Mex"); + but_sqrt->redraw(); + but_pow->redraw(); + but_sin->redraw(); + but_cos->redraw(); + but_tan->redraw(); + but_log->redraw(); + but_ln->redraw(); + but_int->redraw(); + but_dr->redraw(); + but_Mplus->redraw(); + but_Mmult->redraw(); + but_Mclear->redraw(); +} + +void SciCalc::mem_exchange() { + double temp; + + temp = mem; + mem = value[top]; + value[top] = temp; + + set_display(value[top],NORM); + ready = 1; + set_memdisp(); + printf("Hello, World!\n"); +} + +double SciCalc::to_drg(double angle) { + if (drgmode == 0) + return (M_PI*angle/180.0); + else + if (drgmode == 2) + return (M_PI*angle/100.0); + else + return (angle); +} + +double SciCalc::from_drg(double angle) { + if (drgmode == 0) + return (180.0*angle/M_PI); + else + if (drgmode == 2) + return (100.0*angle/M_PI); + else + return (angle); +} + +void SciCalc::memexch() { + double temp; + + temp = mem; + mem = value[top]; + value[top] = temp; + set_display(value[top],NORM); + ready = 1; + set_memdisp(); +} diff --git a/ecalc/SciCalc.fl b/ecalc/SciCalc.fl new file mode 100644 index 0000000..bfd0141 --- /dev/null +++ b/ecalc/SciCalc.fl @@ -0,0 +1,1005 @@ +# data file for the Fltk User Interface Designer (fluid) +version 1.0108 +header_name {.h} +code_name {.cpp} +decl {\#include } {} + +decl {\#include } {selected global +} + +decl {\#include } {global +} + +decl {\#include "math.h"} {} + +Function {gammaln(double xx)} {open private return_type double +} { + code {int j; +double x,y,tmp,ser; +static double cof[6] = {76.18009172947146, + -86.50532032941677, + 24.01409824083091, + -1.231739572450155, + 0.1208650973866179e-2, + -0.5395239384953e-5}; + + y = x = xx; + tmp = x + 5.5; + tmp -= (x+0.5)*log(tmp); + ser = 1.000000000190015; + for (j=0;j<6;j++) ser += cof[j]/++y; + return -tmp+log(2.5066282746310005*ser/x);} {} +} + +Function {truncf(double x)} {private return_type double +} { + code {if (x < 0.0) + x = -floor(-x); + else + x = floor(x); + return x;} {} +} + +class SciCalc {open +} { + decl {enum {MaxNumBrkts=10};} {} + decl {enum Operator {PLUS,MINUS,MULT,DIV,POW,INVPOW,EVAL};} {} + decl {enum mode {NONE=0,DOT=-1,NORM=-2,EXP=-3};} {} + declblock {/* members */} {after {/********/} + } { + decl {double value[4*(MaxNumBrkts+1)]; /* The values on the stack */} {} + decl {int priority[6]; /* the priorities of each operator */} {} + decl {int oper[3*(MaxNumBrkts+1)]; /* the operators between them */} {} + decl {int top; /* the top of the stack */} {} + decl {int startbrkt[(MaxNumBrkts+1)]; /* the positions of the left brackets */} {} + decl {int currentbrkt; /* bracketing we are in */} {} + decl {double mem; /* The memory value */} {} + decl {int ready; /* Whether last number is ready. + if "ready" is set, then typing another number + overwrites the current number. */} {} + decl {int dot; /* Whether the dot has been typed */} {} + decl {double diver; /* The divider when behind the dot */} {} + decl {int behind; /* Number of digits behind dot */} {} + decl {int inv; /* Whether inverse key is depressed */} {} + decl {int emode; /* Whether we are entering the exponent */} {} + decl {int exponent; /* the exponent value whilst entering exponent */} {} + decl {double mantissa; /* the mantissa value whilst entering exponent */} {} + decl {int base; /* the base we are working in (2,8,10 or 16) */} {} + decl {int drgmode; /* whether we are in deg, rad or grad mode */} {} + } + Function {SciCalc()} {open + } { + Fl_Window win { + label flCalc open + private xywh {528 286 181 262} type Double visible + } { + Fl_Box leddisplay { + label {0 } + private xywh {5 3 172 24} box DOWN_BOX color 207 labelfont 1 labelsize 16 labelcolor 59 align 24 + } + Fl_Box box_DEGRAD { + label { } + private xywh {24 27 35 15} box ENGRAVED_BOX labelsize 9 align 16 + } + Fl_Box box_bracket { + private xywh {59 27 65 15} box ENGRAVED_BOX labelsize 9 align 16 + } + Fl_Box box_M { + label M + private xywh {124 27 35 15} box ENGRAVED_BOX labelsize 9 align 16 + } + Fl_Group {} {open + private xywh {46 44 93 22} color 46 + } { + Fl_Button radio_2 { + label 2 + callback {change_base(2);} + private xywh {49 48 20 15} type Radio labelsize 10 labelcolor 1 + } + Fl_Button radio_8 { + label 8 + callback {change_base(8);} + private xywh {70 48 21 15} type Radio labelsize 10 labelcolor 1 + } + Fl_Button radio_10 { + label 10 + callback {change_base(10);} + private xywh {92 48 21 15} type Radio value 1 labelsize 10 labelcolor 1 + } + Fl_Button radio_16 { + label 16 + callback {change_base(16);} + private xywh {114 48 21 15} type Radio labelsize 10 labelcolor 1 + } + } + Fl_Group {} {open + private xywh {3 163 107 94} box FLAT_BOX color 43 + } { + Fl_Button but_7 { + label 7 + callback {handle_number(7);} + private xywh {6 167 32 20} shortcut 0x37 labelfont 1 labelsize 16 + } + Fl_Button but_8 { + label 8 + callback {handle_number(8);} + private xywh {41 167 32 20} shortcut 0x38 labelfont 1 labelsize 16 + } + Fl_Button but_9 { + label 9 + callback {handle_number(9);} + private xywh {75 167 32 20} shortcut 0x39 labelfont 1 labelsize 16 + } + Fl_Button but_4 { + label 4 + callback {handle_number(4);} + private xywh {6 189 32 20} shortcut 0x34 labelfont 1 labelsize 16 + } + Fl_Button but_5 { + label 5 + callback {handle_number(5);} + private xywh {41 189 32 20} shortcut 0x35 labelfont 1 labelsize 16 + } + Fl_Button but_6 { + label 6 + callback {handle_number(6);} + private xywh {75 189 32 20} shortcut 0x36 labelfont 1 labelsize 16 + } + Fl_Button but_1 { + label 1 + callback {handle_number(1);} + private xywh {6 211 32 20} shortcut 0x31 labelfont 1 labelsize 16 + } + Fl_Button but_2 { + label 2 + callback {handle_number(2);} + private xywh {41 211 32 20} shortcut 0x32 labelfont 1 labelsize 16 + } + Fl_Button but_3 { + label 3 + callback {handle_number(3);} + private xywh {75 211 32 20} shortcut 0x33 labelfont 1 labelsize 16 + } + Fl_Button but_0 { + label 0 + callback {handle_number(0);} + private xywh {6 233 32 20} shortcut 0x30 labelfont 1 labelsize 16 + } + Fl_Button but_dot { + label {.} + callback {handle_number(DOT);} + private xywh {41 233 32 20} shortcut 0x2e labelfont 1 labelsize 16 + } + Fl_Button but_sign { + label {+/-} + callback {if (! emode) +{ + value[top] = -value[top]; + set_display(value[top],NORM); +} +else +{ + exponent = -exponent; + value[top] = mantissa*pow(10.0, (double)exponent); + set_display(mantissa,EXP); +}} + xywh {75 233 32 20} labelfont 1 labelsize 16 + } + } + Fl_Button but_C { + label C + callback {init_value(top); +set_display(0.0,NORM);} + private xywh {112 167 31 20} labelfont 1 labelsize 16 + } + Fl_Button but_AC { + label AC + callback {init_value(0); +set_display(0.0,NORM); +currentbrkt = 0; +box_bracket->label(""); +box_bracket->redraw();} + private xywh {146 167 30 20} labelfont 1 labelsize 16 + } + Fl_Button but_X { + label x + callback {handle_operator(MULT);} + private xywh {112 189 31 20} shortcut 0x2a labelfont 1 labelsize 16 + } + Fl_Button but_div { + label {/} + callback {handle_operator(DIV);} + private xywh {146 189 30 20} shortcut 0x2f labelfont 1 labelsize 16 + } + Fl_Button but_plus { + label {+} + callback {handle_operator(PLUS);} + private xywh {112 211 31 20} shortcut 0x2b labelfont 1 labelsize 16 + } + Fl_Button but_minus { + label {-} + callback {handle_operator(MINUS);} + private xywh {146 211 30 20} shortcut 0x2d labelfont 1 labelsize 16 + } + Fl_Button but_pi { + label {e/p} + callback {exponent_pi();} + private xywh {112 233 31 20} labelfont 12 labelsize 17 + } + Fl_Button but_eval { + label {=} + callback {handle_operator(EVAL);} + private xywh {146 233 30 20} shortcut 0x3d labelfont 1 labelsize 16 + } + Fl_Button but_eval_hidden { + callback {handle_operator(EVAL);} + private xywh {147 253 6 7} box NO_BOX shortcut 0xff0d labelfont 1 labelsize 16 + } + Fl_Button but_eval_hidden2 { + callback {handle_operator(EVAL);} + private xywh {157 263 6 7} box NO_BOX shortcut 0xff8d labelfont 1 labelsize 16 + } + Fl_Button but_sqrt { + label sqrt + callback {if (base > 10) handle_number(10.0); + else + if (! inv) + { + value[top] = sqrt(value[top]); + set_display(value[top],NORM); + ready = 1; + } + else + { + value[top] = pow(value[top], 2.0); + set_display(value[top],NORM); + ready = 1; + }} + private xywh {6 70 32 21} labelsize 11 labelcolor 4 + } + Fl_Button but_pow { + label {x^y} + callback {if (base > 10) + handle_number(11.0); + else + handle_operator(check_inv->value()?INVPOW:POW);} + private xywh {41 70 32 21} labelsize 11 labelcolor 4 + } + Fl_Button but_sin { + label sin + callback {if (base > 10) handle_number(12.0); +else + if (! inv) + { + value[top] = sin(to_drg(value[top])); + set_display(value[top],NORM); + ready = 1; + } + else + { + value[top] = from_drg(asin(value[top])); + set_display(value[top],NORM); + ready = 1; + }} + private xywh {76 70 31 21} labelsize 11 labelcolor 4 + } + Fl_Button but_cos { + label cos + callback {if (base > 10) handle_number(13.0); +else + if (! inv) + { + value[top] = cos(to_drg(value[top])); + set_display(value[top],NORM); + ready = 1; + } + else + { + value[top] = from_drg(acos(value[top])); + set_display(value[top],NORM); + ready = 1; + }} + private xywh {110 70 31 21} labelsize 11 labelcolor 4 + } + Fl_Button but_tan { + label tan + callback {if (base > 10) handle_number(14.0); + else + if (! inv) + { + value[top] = tan(to_drg(value[top])); + set_display(value[top],NORM); + ready = 1; + } + else + { + value[top] = from_drg(atan(value[top])); + set_display(value[top],NORM); + ready = 1; + }} + private xywh {144 70 30 21} labelsize 11 labelcolor 4 + } + Fl_Button but_log { + label log + callback {if (base > 10) handle_number(15.0); +else + if (! inv) + { + value[top] = log10(value[top]); + set_display(value[top],NORM); + ready = 1; + } + else + { + value[top] = pow(10.0, value[top]); + set_display(value[top],NORM); + ready = 1; + }} + private xywh {6 93 32 21} labelsize 11 labelcolor 4 + } + Fl_Button but_ln { + label ln + callback {if (! inv) + { + value[top] = log(value[top]); + set_display(value[top],NORM); + ready = 1; + } + else + { + value[top] = exp(value[top]); + set_display(value[top],NORM); + ready = 1; + }} + private xywh {41 93 32 21} labelsize 11 labelcolor 4 + } + Fl_Button but_int { + label int + callback {if (! inv) + { + value[top] = truncf(value[top]); + set_display(value[top],NORM); + ready = 1; + } + else + { + value[top] = value[top] - truncf(value[top]); + set_display(value[top],NORM); + ready = 1; + }} + private xywh {76 93 31 21} labelsize 11 labelcolor 4 + } + Fl_Button but_dr { + label {d->r} + callback {if (! inv) + { + value[top] = M_PI*value[top]/180.0; + set_display(value[top],NORM); + ready = 1; + } + else + { + value[top] = 180.0*value[top]/M_PI; + set_display(value[top],NORM); + ready = 1; + }} + private xywh {110 93 31 21} labelsize 10 labelcolor 4 + } + Fl_Button but_drg { + label {d-r-g} + callback {drgmode++; + drgmode %= 3; + set_drgdisp();} + private xywh {144 93 30 21} labelsize 9 + } + Fl_Button but_leftbr { + label {[} + callback {add_left_bracket();} + private xywh {6 116 32 21} shortcut 0x28 labelsize 11 + } + Fl_Button but_rightbr { + label {]} + callback {add_right_bracket();} + private xywh {41 116 32 21} shortcut 0x29 labelsize 11 + } + Fl_Button but_exch { + label exch + callback {exchange();} + private xywh {76 116 31 21} labelsize 11 + } + Fl_Button but_invx { + label {1/x} + callback {value[top] = 1.0/value[top]; + set_display(value[top],NORM); + ready = 1;} + private xywh {110 116 31 21} labelsize 11 + } + Fl_Button but_fact { + label {x!} + callback {factorial();} + private xywh {144 116 30 21} labelsize 11 + } + Fl_Button but_Mplus { + label {M+} + callback {if (! inv) mem += value[top]; else mem -= value[top]; + set_display(value[top],NORM); + ready = 1; + set_memdisp();} + private xywh {6 139 32 21} color 93 labelcolor 4 + } + Fl_Button but_Mmult { + label {M*} + callback {if (! inv) mem *= value[top]; else mem /= value[top]; + set_display(value[top],NORM); + ready = 1; + set_memdisp();} + private xywh {41 139 32 21} color 93 labelcolor 4 + } + Fl_Button but_Mclear { + label MC + callback {if (! inv) + { + mem = 0.0; + set_display(value[top],NORM); + ready = 1; + set_memdisp(); + } + else + memexch();} + private xywh {76 139 31 21} color 93 labelcolor 4 + } + Fl_Button but_Mst { + label Mst + callback {mem = value[top]; + set_display(value[top],NORM); + ready = 1; + set_memdisp();} + private xywh {110 139 31 21} color 93 + } + Fl_Button but_Mrc { + label Mrc + callback {value[top] = mem; + set_display(value[top],NORM); + ready = 1;} + private xywh {144 139 30 21} color 93 + } + Fl_Button check_inv { + label inv + callback {if (inv) + { + inv = 0; + setnormlabels(); + } + else + { + inv = 1; + setinvlabels(); + }} + private xywh {6 44 32 21} type Toggle labelsize 11 labelcolor 4 + } + Fl_Button but_quit { + label Exit + callback {win->hide(); +delete win;} + private xywh {145 44 29 21} labelfont 1 labelcolor 33 + } + } + code {init_value(0); + drgmode = 1; + base = 10; + currentbrkt = 0; + startbrkt[0] = 0; + + set_memdisp(); + set_brktdisp(); + radio_10->value(1); + set_drgdisp(); + set_display(0.0,NONE);} {} + } + Function {~SciCalc()} {} {} + Function {run(int px=-1,int py=-1)} {open + } { + code {win->show(); +Fl::run();} {} + } + Function {handle_number(double numb)} {private + } { + code {int first; +double sign; + + if (ready) init_value(top); + + if (numb == -1.0) + if (dot) /* check whether we already have a dot */ + return; + else + { + dot = 1; + set_display(value[top],DOT); + return; + } + + if (emode) + { + sign = copysign(1.0, (double)exponent); + if (abs(exponent)*10 + numb > 999) + { /* cycle if exponent has > 3 digits */ + first = (int)floor((double)abs(exponent)/100.0); + exponent = abs(exponent) - 100*first; + exponent *= (int)sign; + } + exponent = exponent*10 + (int) (sign*numb); + value[top] = mantissa*pow(10.0, (double)exponent); + set_display(mantissa, EXP); + } + else if (numb < base) + { /* both decimal and non decimal number entry */ + sign = copysign(1.0, value[top]); + if (dot && behind < 9) + { + behind++; + diver = diver/(double)base; + value[top] += sign*diver*numb; + } + else + if ((! dot) && (value[top] < 1.0e10)) + value[top] = (double)base*value[top] + sign*numb; + + set_display(value[top],(mode)behind); + }} {} + } + Function {handle_operator(Operator op)} {private + } { + code {int prevop, i, finished; + + switch (op) + { + case PLUS: + case MINUS: + case MULT: + case DIV: + case POW: + case INVPOW: + finished = 0; + do + { + if (top == startbrkt[currentbrkt]) finished = 1; /* is 1st operator */ + if (! finished) + { /* compare priority of previous operators with current op */ + prevop = oper[top-1]; + if (priority[prevop] < priority[op]) + finished = 1; + else + { /* last op can be calculated */ + top--; + calc(top); + } + } + } while (! finished); + + oper[top] = op; + init_value(top+1); + + set_display(value[top-1],NORM); + break; + + case EVAL: + while (currentbrkt > 0) add_right_bracket(); + for (i = top; i > 0; i--) calc(i-1); + top = 0; + ready = 1; + set_display(value[top],NORM); + break; + }} {} + } + Function {change_base(int newbase)} {open private + } { + code {int oldbase; + + oldbase = base; + base = newbase; + + set_display(value[top], NORM); + ready = 1; + if ((oldbase == 16) || (base == 16)) setnormlabels();} {} + } + Function {set_display(double val,mode behind)} {open private + } { + code {int i; +char dispstr[40], expstr[10], str2[10]; + + /* number or operator handled to get here so reset inv stuff */ +/* + if (inv) + { + inv = 0; + check_inv->value(0); + setnormlabels(); + }*/ + if (behind >= 0) + { /* format with appropriate number of decimal places */ + if (base == 10) + { + emode = 0; + strcpy(str2,"%.1f"); + str2[2] = behind + '0'; + sprintf(dispstr,str2,val); + } + else /* non base 10 display */ + cvttobase(val, base, behind, dispstr); + } + else + if (behind == DOT) + { /* display the . at the right */ + if (base == 10) + { + emode = 0; + sprintf(dispstr,"%.1f",val); + dispstr[strlen(dispstr)-1] = 0; + } + else + cvttobase(val, base, behind, dispstr); + } + else if (behind == NORM) + { /* normal display */ + if (base == 10) + { + emode = 0; + sprintf(dispstr,"%.9g",val); + } + else /* non base 10 display */ + cvttobase(val, base, behind, dispstr); + } + else + { /* exponent entering display */ + sprintf(dispstr,"%.8f",val); + for (i = strlen(dispstr); dispstr[i-1] == '0'; i--); + dispstr[i] =0; + strcat(dispstr, "e"); + sprintf(expstr,"%d",exponent); + strcat(dispstr, expstr); + } + strcat(dispstr," "); + dispstr[17] = 0; + leddisplay->copy_label(dispstr); + leddisplay->redraw();} {} + } + Function {set_memdisp()} {open private + } { + code {if (mem) + box_M->label("M"); +else + box_M->label(""); +box_M->redraw();} {} + } + Function {set_drgdisp()} {open private + } { + code {if (drgmode == 0) + box_DEGRAD->label("DEG"); +else +{ + if (drgmode == 1) + box_DEGRAD->label("RAD"); + else + box_DEGRAD->label("GRAD"); +} +box_DEGRAD->redraw();} {} + } + Function {set_brktdisp()} {open private + } { + code {char dispstr[40]; + + if (currentbrkt > 0) + { + sprintf(dispstr, "%d [ max %d", currentbrkt, MaxNumBrkts); + box_bracket->copy_label(dispstr); + } + else + box_bracket->label(""); +box_bracket->redraw();} {} + } + Function {add_left_bracket()} {private + } { + code {if (currentbrkt < MaxNumBrkts) + { + currentbrkt++; + startbrkt[currentbrkt] = top; + ready = 1; + set_brktdisp(); + }} {} + } + Function {add_right_bracket()} {private + } { + code {int i; + + if (currentbrkt > 0) + { + for (i = top; i > startbrkt[currentbrkt]; i--) calc(i-1); + top = startbrkt[currentbrkt]; + currentbrkt--; + ready = 1; + } + set_display(value[top],NORM); + set_brktdisp();} {} + } + Function {factorial()} {open + } { + code {double lg, alpha; + + /* uses gamma functions to get result for non-integer values */ + + alpha = value[top] + 1.0; + if ((floor(alpha) == alpha)&&(alpha <= 0.0)) + { + init_value(0); + leddisplay->label("Error: -ve integer "); + leddisplay->redraw(); + } + else + if (alpha > 32) + { + lg = exp(gammaln(alpha)); + value[top] = lg; + set_display(value[top],NORM); + ready = 1; + } + else + if (alpha > 1.0) + { + int n = (int)truncf(alpha); + lg = 1.0; + for (int i = 1; i startbrkt[currentbrkt]) { + temp = value[top]; + value[top] = value[top-1]; + value[top-1] = temp; + + set_display(value[top],NORM); + ready = 1; + }} {} + } + Function {exponent_pi()} {} { + code {if ((value[top] == 0.0) || (ready)) { + value[top] = M_PI; + set_display(value[top],NORM); + ready = 1; + } + else if ((! emode) && (base == 10)) { + emode = 1; + exponent = 0; + mantissa = value[top]; + set_display(mantissa,EXP); + }} {} + } + Function {calc(int i)} {} { + code {switch (oper[i]) + { + case PLUS: value[i] += value[i+1]; break; + case MINUS: value[i] -= value[i+1]; break; + case MULT: value[i] *= value[i+1]; break; + case DIV: value[i] /= value[i+1]; break; + case POW: value[i] = pow(value[i], value[i+1]); break; + case INVPOW: value[i] = pow(value[i], 1.0/value[i+1]); break; + }} {} + } + Function {init_value(int lev)} {open private + } { + code {top = lev; + value[top] = 0.0; + ready = 0; + emode = 0; + dot = 0; + diver = 1.0; + behind = 0; + if (inv) + { + inv = 0; + check_inv->value(0); + setnormlabels(); + }} {} + } + Function {cvttobase(double num,int base,mode behind,char *str)} {private + } { + code {double sign, div; +int place, digit, i; +char digstr[2]; + + sign = copysign(1.0, num); + num *= sign; + if (sign == -1.0) + sprintf(str, "-"); + else + str[0] = 0; + + if (num == 0.0) + { + sprintf(str, "0"); + if (behind > 0) + { + strcat(str, "."); + for(i = 0; i < behind; i++) strcat(str, "0"); + } + return; + } + place = (int)( log(num)/log((double)base) ); + if (place < 0) place = 0; + do + { + div = pow((double)base, (double)place); + digit = (int)(num/div); + num -= (double)digit*div; + if (place == -1) strcat(str, "."); + place--; + sprintf(digstr, "%x", digit); + strcat(str, digstr); + if (strlen(str) > 18) + { + sprintf(str, "can't display"); + return; + } + } while ((place >= 0) || ((place >= -9) && (num != 0.0))); + + if ((place == -1) && ((behind == DOT) || (behind > 0))) + strcat(str, "."); + while ((behind > 0) && (behind >= -place)) + { + strcat(str, "0"); + place--; + }} {} + } + Function {setnormlabels()} {open private + } { + code {if (base <= 10) + { + but_sqrt->label("sqrt"); but_sqrt->shortcut(0); + but_pow->label("x^y"); but_pow->shortcut(0); + but_sin->label("sin"); but_sin->shortcut(0); + but_cos->label("cos"); but_cos->shortcut(0); + but_tan->label("tan"); but_tan->shortcut(0); + but_log->label("log"); but_log->shortcut(0); + but_sqrt->labelcolor(FL_BLUE); + but_pow->labelcolor(FL_BLUE); + but_sin->labelcolor(FL_BLUE); + but_cos->labelcolor(FL_BLUE); + but_tan->labelcolor(FL_BLUE); + but_log->labelcolor(FL_BLUE); + } + else + { + but_sqrt->label("a"); but_sqrt->shortcut('a'); + but_pow->label("b"); but_pow->shortcut('b'); + but_sin->label("c"); but_sin->shortcut('c'); + but_cos->label("d"); but_cos->shortcut('d'); + but_tan->label("e"); but_tan->shortcut('e'); + but_log->label("f"); but_log->shortcut('f'); + but_sqrt->labelcolor(FL_BLACK); + but_pow->labelcolor(FL_BLACK); + but_sin->labelcolor(FL_BLACK); + but_cos->labelcolor(FL_BLACK); + but_tan->labelcolor(FL_BLACK); + but_log->labelcolor(FL_BLACK); + } + but_ln->label("ln"); + but_int->label("int"); + but_dr->label("d->r"); + but_Mplus->label("M+"); + but_Mmult->label("M*"); + but_Mclear->label("MC"); + but_sqrt->redraw(); + but_pow->redraw(); + but_sin->redraw(); + but_cos->redraw(); + but_tan->redraw(); + but_log->redraw(); + but_ln->redraw(); + but_int->redraw(); + but_dr->redraw(); + but_Mplus->redraw(); + but_Mmult->redraw(); + but_Mclear->redraw();} {} + } + Function {setinvlabels()} {private + } { + code {if (base <= 10) + { + but_sqrt->label("x^2"); + but_pow->label("x^1/y"); + but_sin->label("asin"); + but_cos->label("acos"); + but_tan->label("atan"); + but_log->label("10^x"); + but_sqrt->labelcolor(FL_BLUE); + but_pow->labelcolor(FL_BLUE); + but_sin->labelcolor(FL_BLUE); + but_cos->labelcolor(FL_BLUE); + but_tan->labelcolor(FL_BLUE); + but_log->labelcolor(FL_BLUE); + } + else + { + but_sqrt->label("a"); + but_pow->label("b"); + but_sin->label("c"); + but_cos->label("d"); + but_tan->label("e"); + but_log->label("f"); + but_sqrt->labelcolor(FL_BLACK); + but_pow->labelcolor(FL_BLACK); + but_sin->labelcolor(FL_BLACK); + but_cos->labelcolor(FL_BLACK); + but_tan->labelcolor(FL_BLACK); + but_log->labelcolor(FL_BLACK); + } + but_ln->label("e^x"); + but_int->label("frac"); + but_dr->label("r->d"); + but_Mplus->label("M-"); + but_Mmult->label("M/"); + but_Mclear->label("Mex"); + but_sqrt->redraw(); + but_pow->redraw(); + but_sin->redraw(); + but_cos->redraw(); + but_tan->redraw(); + but_log->redraw(); + but_ln->redraw(); + but_int->redraw(); + but_dr->redraw(); + but_Mplus->redraw(); + but_Mmult->redraw(); + but_Mclear->redraw();} {} + } + Function {mem_exchange()} {private + } { + code {double temp; + + temp = mem; + mem = value[top]; + value[top] = temp; + + set_display(value[top],NORM); + ready = 1; + set_memdisp();} {} + code {printf("Hello, World!\\n");} {} + } + Function {to_drg(double angle)} {private return_type double + } { + code {if (drgmode == 0) + return (M_PI*angle/180.0); + else + if (drgmode == 2) + return (M_PI*angle/100.0); + else + return (angle);} {} + } + Function {from_drg(double angle)} {private return_type double + } { + code {if (drgmode == 0) + return (180.0*angle/M_PI); + else + if (drgmode == 2) + return (100.0*angle/M_PI); + else + return (angle);} {} + } + Function {memexch()} {open + } { + code {double temp; + + temp = mem; + mem = value[top]; + value[top] = temp; + set_display(value[top],NORM); + ready = 1; + set_memdisp();} {} + } +} diff --git a/ecalc/SciCalc.h b/ecalc/SciCalc.h new file mode 100644 index 0000000..aa94062 --- /dev/null +++ b/ecalc/SciCalc.h @@ -0,0 +1,217 @@ +// generated by Fast Light User Interface Designer (fluid) version 1.0108 + +#ifndef SciCalc_h +#define SciCalc_h +#include +#include +#include +#include +#include + +class SciCalc { + enum {MaxNumBrkts=10}; + enum Operator {PLUS,MINUS,MULT,DIV,POW,INVPOW,EVAL}; + enum mode {NONE=0,DOT=-1,NORM=-2,EXP=-3}; + double value[4*(MaxNumBrkts+1)]; /* The values on the stack */; + int priority[6]; /* the priorities of each operator */; + int oper[3*(MaxNumBrkts+1)]; /* the operators between them */; + int top; /* the top of the stack */; + int startbrkt[(MaxNumBrkts+1)]; /* the positions of the left brackets */; + int currentbrkt; /* bracketing we are in */; + double mem; /* The memory value */; + int ready; /* Whether last number is ready. + if "ready" is set, then typing another number + overwrites the current number. */; + int dot; /* Whether the dot has been typed */; + double diver; /* The divider when behind the dot */; + int behind; /* Number of digits behind dot */; + int inv; /* Whether inverse key is depressed */; + int emode; /* Whether we are entering the exponent */; + int exponent; /* the exponent value whilst entering exponent */; + double mantissa; /* the mantissa value whilst entering exponent */; + int base; /* the base we are working in (2,8,10 or 16) */; + int drgmode; /* whether we are in deg, rad or grad mode */; +public: + SciCalc(); +private: + Fl_Double_Window *win; + Fl_Box *leddisplay; + Fl_Box *box_DEGRAD; + Fl_Box *box_bracket; + Fl_Box *box_M; + Fl_Button *radio_2; + void cb_radio_2_i(Fl_Button*, void*); + static void cb_radio_2(Fl_Button*, void*); + Fl_Button *radio_8; + void cb_radio_8_i(Fl_Button*, void*); + static void cb_radio_8(Fl_Button*, void*); + Fl_Button *radio_10; + void cb_radio_10_i(Fl_Button*, void*); + static void cb_radio_10(Fl_Button*, void*); + Fl_Button *radio_16; + void cb_radio_16_i(Fl_Button*, void*); + static void cb_radio_16(Fl_Button*, void*); + Fl_Button *but_7; + void cb_but_7_i(Fl_Button*, void*); + static void cb_but_7(Fl_Button*, void*); + Fl_Button *but_8; + void cb_but_8_i(Fl_Button*, void*); + static void cb_but_8(Fl_Button*, void*); + Fl_Button *but_9; + void cb_but_9_i(Fl_Button*, void*); + static void cb_but_9(Fl_Button*, void*); + Fl_Button *but_4; + void cb_but_4_i(Fl_Button*, void*); + static void cb_but_4(Fl_Button*, void*); + Fl_Button *but_5; + void cb_but_5_i(Fl_Button*, void*); + static void cb_but_5(Fl_Button*, void*); + Fl_Button *but_6; + void cb_but_6_i(Fl_Button*, void*); + static void cb_but_6(Fl_Button*, void*); + Fl_Button *but_1; + void cb_but_1_i(Fl_Button*, void*); + static void cb_but_1(Fl_Button*, void*); + Fl_Button *but_2; + void cb_but_2_i(Fl_Button*, void*); + static void cb_but_2(Fl_Button*, void*); + Fl_Button *but_3; + void cb_but_3_i(Fl_Button*, void*); + static void cb_but_3(Fl_Button*, void*); + Fl_Button *but_0; + void cb_but_0_i(Fl_Button*, void*); + static void cb_but_0(Fl_Button*, void*); + Fl_Button *but_dot; + void cb_but_dot_i(Fl_Button*, void*); + static void cb_but_dot(Fl_Button*, void*); +public: + Fl_Button *but_sign; +private: + void cb_but_sign_i(Fl_Button*, void*); + static void cb_but_sign(Fl_Button*, void*); + Fl_Button *but_C; + void cb_but_C_i(Fl_Button*, void*); + static void cb_but_C(Fl_Button*, void*); + Fl_Button *but_AC; + void cb_but_AC_i(Fl_Button*, void*); + static void cb_but_AC(Fl_Button*, void*); + Fl_Button *but_X; + void cb_but_X_i(Fl_Button*, void*); + static void cb_but_X(Fl_Button*, void*); + Fl_Button *but_div; + void cb_but_div_i(Fl_Button*, void*); + static void cb_but_div(Fl_Button*, void*); + Fl_Button *but_plus; + void cb_but_plus_i(Fl_Button*, void*); + static void cb_but_plus(Fl_Button*, void*); + Fl_Button *but_minus; + void cb_but_minus_i(Fl_Button*, void*); + static void cb_but_minus(Fl_Button*, void*); + Fl_Button *but_pi; + void cb_but_pi_i(Fl_Button*, void*); + static void cb_but_pi(Fl_Button*, void*); + Fl_Button *but_eval; + void cb_but_eval_i(Fl_Button*, void*); + static void cb_but_eval(Fl_Button*, void*); + Fl_Button *but_eval_hidden; + void cb_but_eval_hidden_i(Fl_Button*, void*); + static void cb_but_eval_hidden(Fl_Button*, void*); + Fl_Button *but_eval_hidden2; + void cb_but_eval_hidden2_i(Fl_Button*, void*); + static void cb_but_eval_hidden2(Fl_Button*, void*); + Fl_Button *but_sqrt; + void cb_but_sqrt_i(Fl_Button*, void*); + static void cb_but_sqrt(Fl_Button*, void*); + Fl_Button *but_pow; + void cb_but_pow_i(Fl_Button*, void*); + static void cb_but_pow(Fl_Button*, void*); + Fl_Button *but_sin; + void cb_but_sin_i(Fl_Button*, void*); + static void cb_but_sin(Fl_Button*, void*); + Fl_Button *but_cos; + void cb_but_cos_i(Fl_Button*, void*); + static void cb_but_cos(Fl_Button*, void*); + Fl_Button *but_tan; + void cb_but_tan_i(Fl_Button*, void*); + static void cb_but_tan(Fl_Button*, void*); + Fl_Button *but_log; + void cb_but_log_i(Fl_Button*, void*); + static void cb_but_log(Fl_Button*, void*); + Fl_Button *but_ln; + void cb_but_ln_i(Fl_Button*, void*); + static void cb_but_ln(Fl_Button*, void*); + Fl_Button *but_int; + void cb_but_int_i(Fl_Button*, void*); + static void cb_but_int(Fl_Button*, void*); + Fl_Button *but_dr; + void cb_but_dr_i(Fl_Button*, void*); + static void cb_but_dr(Fl_Button*, void*); + Fl_Button *but_drg; + void cb_but_drg_i(Fl_Button*, void*); + static void cb_but_drg(Fl_Button*, void*); + Fl_Button *but_leftbr; + void cb_but_leftbr_i(Fl_Button*, void*); + static void cb_but_leftbr(Fl_Button*, void*); + Fl_Button *but_rightbr; + void cb_but_rightbr_i(Fl_Button*, void*); + static void cb_but_rightbr(Fl_Button*, void*); + Fl_Button *but_exch; + void cb_but_exch_i(Fl_Button*, void*); + static void cb_but_exch(Fl_Button*, void*); + Fl_Button *but_invx; + void cb_but_invx_i(Fl_Button*, void*); + static void cb_but_invx(Fl_Button*, void*); + Fl_Button *but_fact; + void cb_but_fact_i(Fl_Button*, void*); + static void cb_but_fact(Fl_Button*, void*); + Fl_Button *but_Mplus; + void cb_but_Mplus_i(Fl_Button*, void*); + static void cb_but_Mplus(Fl_Button*, void*); + Fl_Button *but_Mmult; + void cb_but_Mmult_i(Fl_Button*, void*); + static void cb_but_Mmult(Fl_Button*, void*); + Fl_Button *but_Mclear; + void cb_but_Mclear_i(Fl_Button*, void*); + static void cb_but_Mclear(Fl_Button*, void*); + Fl_Button *but_Mst; + void cb_but_Mst_i(Fl_Button*, void*); + static void cb_but_Mst(Fl_Button*, void*); + Fl_Button *but_Mrc; + void cb_but_Mrc_i(Fl_Button*, void*); + static void cb_but_Mrc(Fl_Button*, void*); + Fl_Button *check_inv; + void cb_check_inv_i(Fl_Button*, void*); + static void cb_check_inv(Fl_Button*, void*); + Fl_Button *but_quit; + void cb_but_quit_i(Fl_Button*, void*); + static void cb_but_quit(Fl_Button*, void*); +public: + ~SciCalc(); + void run(int px=-1,int py=-1); +private: + void handle_number(double numb); + void handle_operator(Operator op); + void change_base(int newbase); + void set_display(double val,mode behind); + void set_memdisp(); + void set_drgdisp(); + void set_brktdisp(); + void add_left_bracket(); + void add_right_bracket(); +public: + void factorial(); + void exchange(); + void exponent_pi(); + void calc(int i); +private: + void init_value(int lev); + void cvttobase(double num,int base,mode behind,char *str); + void setnormlabels(); + void setinvlabels(); + void mem_exchange(); + double to_drg(double angle); + double from_drg(double angle); +public: + void memexch(); +}; +#endif diff --git a/ecolorconf/EDE_FontChooser.cpp b/ecolorconf/EDE_FontChooser.cpp new file mode 100644 index 0000000..1ddf777 --- /dev/null +++ b/ecolorconf/EDE_FontChooser.cpp @@ -0,0 +1,357 @@ +/* + * $Id$ + * + * Font chooser widget + * Part of Equinox Desktop Environment (EDE). + * Copyright (c) 2000-2006 EDE Authors. + * + * Based on: + * Font demo program for the Fast Light Tool Kit (FLTK). + * Copyright 1998-2006 by Bill Spitzak and others. + * + * This program is licenced under terms of the + * GNU General Public Licence version 2 or newer. + * See COPYING for details. + */ + +#include "EDE_FontChooser.h" + +#define MAXSIZE 64 + +static fltk::Window *form = (fltk::Window *)0; +static fltk::Widget* id_box; + + +// class for font preview window + +class FontDisplay : public fltk::Widget { + void draw(); +public: + fltk::Font* font; + unsigned size; + const char* encoding; + FontDisplay(fltk::Box* B, int X, int Y, int W, int H, const char* L = 0) : + fltk::Widget(X,Y,W,H,L) {box(B); font = 0; size = 14;} +}; + +void FontDisplay::draw() { + draw_box(); + fltk::push_clip(2,2,w()-2,h()-2); + const char* saved_encoding = fltk::get_encoding(); + fltk::set_encoding(encoding); + fltk::setfont(font, (float) size); + id_box->label(fltk::Font::current_name()); + id_box->redraw(); + fltk::setcolor(fltk::BLACK); + char buffer[32]; + for (int Y = 1; Y < 8; Y++) { + for (int X = 0; X < 32; X++) buffer[X] = (32*Y+X); + fltk::drawtext(buffer, 32, 3, 3+(size+leading())*Y); + } + fltk::set_encoding(saved_encoding); + fltk::pop_clip(); +} + + + +// other variables + +static FontDisplay *textobj; + +static fltk::Browser *fontobj, *sizeobj, *encobj; + +static fltk::Font** all_fonts; // list returned by fltk +static int numfonts=0; + +static fltk::Group *button_group; +static fltk::CheckButton* bold_button, *italic_button; +static fltk::Button *ok_button, *cancel_button; + +bool return_value = false; + + + +// callback functions + + +// callback for list of fonts + +void font_cb(fltk::Widget *, long) +{ + int fn = fontobj->value(); +//DEBUG +//printf("font: %d name: %s bigname: %s\n", fn, fonts[fn]->name(), fonts[fn]->system_name()); + fltk::Font* f = all_fonts[fn]; + + // are bold and italic available? + if (f->bold() == f) + bold_button->deactivate(); + else + bold_button->activate(); + if (f->italic() == f) + italic_button->deactivate(); + else + italic_button->activate(); + if (bold_button->value()) f = f->bold(); + if (italic_button->value()) f = f->italic(); + + textobj->font = f; + + // Populate the encobj (browser for font encodings) + char saved[30]; + if (textobj->encoding) + strncpy(saved, textobj->encoding, 29); + else + saved[0] = 0; + encobj->clear(); + + const char** encodings; + int ne = f->encodings(encodings); + int picked = -1; + int iso8859 = 0; + + // On XFT encoding is always Unicode, so encodings() will return 0 + if (ne==0) + { + encobj->add("Unicode"); + encobj->deselect(); + encobj->deactivate(); + textobj->encoding=0; + } + else + { + encobj->activate(); + for (int i = 0; i < ne; i++) { + encobj->add(encodings[i]); + if (!strcmp(encodings[i], saved)) picked = i; + if (!strcmp(encodings[i], fltk::get_encoding())) iso8859 = i; + } + if (picked < 0) picked = iso8859; + textobj->encoding = encodings[picked]; + encobj->value(picked); + } + + // Populate the sizeobj (browser for font sizes) + int pickedsize; + if (sizeobj->value() > 0) { + pickedsize = atoi(sizeobj->child(sizeobj->value())->label()); + } else { + pickedsize = 14; + } + sizeobj->clear(); + + int *s; + int n = f->sizes(s); + if(!n) { + // no sizes (this only happens on X) + for (int i = 1; iadd(buf); + } + sizeobj->value((int)fltk::getsize()-1); //pickedsize + textobj->size = (int)fltk::getsize(); + + // fl_font(f, pickedsize); lets fix this... + } else if (s[0] == 0) { + // many sizes; + int j = 1; + for (int i = 1; iadd(buf); + if (j < n && i==s[j]) { + w->labelfont(w->labelfont()->bold()); + w->labelcolor(fltk::RED); + j++; + } + //if (j < n && i==s[j]) {sprintf(buf,"@b;%d",i); j++;} + } + sizeobj->value(pickedsize-1); + textobj->size = pickedsize; + } else { + // some sizes -- when is this used? + int w = 0; + for (int i = 0; i < n; i++) { + if (s[i]<=pickedsize) w = i; + char buf[20]; + sprintf(buf,"%d",s[i]); + fltk::Widget *w = sizeobj->add(buf); + w->labelfont(w->labelfont()->bold()); + //sprintf(buf,"@b;%d",s[i]); + } + sizeobj->value(w); + textobj->size = s[w]; + } + + encobj->redraw(); + sizeobj->redraw(); + textobj->redraw(); +// encobj->relayout(); +// sizeobj->relayout(); +// textobj->relayout(); + +// id_box->label(textobj->font->system_name()); +// id_box->redraw(); + button_group->redraw(); // needed? +} + +void encoding_cb(fltk::Widget *, long) { + if (encobj->children() < 2) return; // XFT + int i = encobj->value(); +// textobj->encoding = encobj->text(i); + textobj->encoding = encobj->child(i)->label(); + textobj->redraw(); + id_box->redraw(); +} + +void size_cb(fltk::Widget *, long) { + int i = sizeobj->value(); + //const char *c = sizeobj->text(i); + const char *c = sizeobj->child(i)->label(); + while (*c < '0' || *c > '9') c++; + textobj->size = atoi(c); + textobj->redraw(); +// id_box->redraw(); +} + +void return_cb(fltk::Widget *, long ret) { + return_value = ret; + form->hide(); +} + + +// TODO: rewrite this in fluid... +void create_the_forms() +{ + if(form) return; + form = new fltk::Window(550, 420, _("Select font...")); + form->set_double_buffer(); + form->begin(); + + textobj = new FontDisplay(fltk::ENGRAVED_BOX,10,10,530,160); + textobj->clear_flag(fltk::ALIGN_MASK); + textobj->set_flag(fltk::ALIGN_TOP|fltk::ALIGN_LEFT|fltk::ALIGN_INSIDE|fltk::ALIGN_CLIP); + id_box = new fltk::Widget(10, 172, 530, 15); + id_box->box(fltk::ENGRAVED_BOX); + id_box->labelsize(10); + id_box->set_flag(fltk::ALIGN_INSIDE|fltk::ALIGN_CLIP); + button_group = new fltk::Group(10, 190, 140, 20); + button_group->begin(); + bold_button = new fltk::CheckButton(0, 0, 70, 20, "Bold"); + bold_button->labelfont(bold_button->labelfont()->bold()); + bold_button->callback(font_cb, 1); + italic_button = new fltk::CheckButton(70, 0, 70, 20, "Italic"); + italic_button->labelfont(italic_button->labelfont()->italic()); + italic_button->callback(font_cb, 1); + button_group->end(); + fontobj = new fltk::Browser(10, 210, 280, 170); + fontobj->when(fltk::WHEN_CHANGED); + fontobj->callback(font_cb); + form->resizable(fontobj); + encobj = new fltk::Browser(300, 210, 100, 170); + encobj->when(fltk::WHEN_CHANGED); + encobj->callback(encoding_cb, 1); + sizeobj = new fltk::Browser(410, 210, 130, 170); + sizeobj->when(fltk::WHEN_CHANGED); + sizeobj->callback(size_cb); + + ok_button = new fltk::Button(380, 390, 80, 25, _("&OK")); + ok_button->callback(return_cb, 1); + + cancel_button = new fltk::Button(465, 390, 80, 25, _("&Cancel")); + cancel_button->callback(return_cb, 0); + + form->end(); +} + + +// search for largest <= selected size: +int find_best_size(fltk::Font* font, int selected) +{ + int *allsizes; + int numsizes = font->sizes(allsizes); + +// This is a bug in efltk + if (numsizes <= 1) return selected; + + for (int i=1; i selected) + return allsizes[i-1]; + } + + return allsizes[numsizes-1]; +} + + +EDEFont font_chooser(EDEFont current_font) +{ + EDEFont return_font; + create_the_forms(); + if(!numfonts) numfonts = fltk::list_fonts(all_fonts); + + // populate list of fonts + fontobj->clear(); + for(int i = 0; i < numfonts; i++) { + fontobj->add(all_fonts[i]->name()); + if (current_font.font && (strcasecmp(current_font.font->name(),all_fonts[i]->name())==0)) + // it's a substring + fontobj->value(i); + } + /*char* currentname = strdup(current_font.font->name()); + fsor(int i = 0; i < numfonts; i++) { + char* fontname = strdup(all_fonts[i]->name()); + fontobj->add(fontname); + if (currentname.lower_case().pos(fontname.lower_case())==0) // it's a substring + fontobj->value(i); + }*/ + + // set bold, italic + /*if (currentname.pos(" bold italic") == currentname.length()-12) { + bold_button->value(true); + italic_button->value(true); + } else if (currentname.pos(" italic") == currentname.length()-7) { + italic_button->value(true); + } else if (currentname.pos(" bold") == currentname.length()-5) { + bold_button->value(true); + }*/ + + // populate other lists + textobj->encoding = current_font.encoding; // TODO: what if we're using XFT? + font_cb(fontobj,0); + for (int i=0; i < sizeobj->children(); i++) { + if (atoi(sizeobj->child(i)->label()) == current_font.size) { + sizeobj->value(i); + size_cb(sizeobj,0); + } + } + + // + form->show(); + form->exec(); + + // we have to construct a proper EDEFont to return + return_font.defined = false; + if (return_value) + { + return_font.font = fltk::font(fontobj->child(fontobj->value())->label()); //Style.h + if (bold_button->value()) return_font.font = return_font.font->bold(); + if (italic_button->value()) return_font.font = return_font.font->italic(); + + int size = atoi(sizeobj->child(sizeobj->value())->label()); + return_font.size = find_best_size(return_font.font, size); + + // on XFT encoding is always Unicode, so this field can be blank + if (encobj->children() > 1) + return_font.encoding = strdup(encobj->child(encobj->value())->label()); + else + return_font.encoding = 0; + + return_font.defined = true; + } + return return_font; +} + +// +// End of "$Id$". +// diff --git a/ecolorconf/EDE_FontChooser.h b/ecolorconf/EDE_FontChooser.h new file mode 100644 index 0000000..5e95019 --- /dev/null +++ b/ecolorconf/EDE_FontChooser.h @@ -0,0 +1,51 @@ +/* + * $Id$ + * + * Font chooser widget + * Part of Equinox Desktop Environment (EDE). + * Copyright (c) 2000-2006 EDE Authors. + * + * Based on: + * Font demo program for the Fast Light Tool Kit (FLTK). + * Copyright 1998-2006 by Bill Spitzak and others. + * + * This program is licenced under terms of the + * GNU General Public Licence version 2 or newer. + * See COPYING for details. + */ + +#ifndef _EDE_FONTCHOOSER_H_ +#define _EDE_FONTCHOOSER_H_ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/*#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include */ + +#include "ecolorutils.h" + +EDEFont font_chooser(EDEFont); + + +#endif diff --git a/ecolorconf/Jamfile b/ecolorconf/Jamfile new file mode 100644 index 0000000..85042ac --- /dev/null +++ b/ecolorconf/Jamfile @@ -0,0 +1,19 @@ +# +# $Id$ +# +# Part of Equinox Desktop Environment (EDE). +# Copyright (c) 2000-2007 EDE Authors. +# +# This program is licenced under terms of the +# GNU General Public Licence version 2 or newer. +# See COPYING for details. + + +SubDir TOP ecolorconf ; + +SOURCE = ecolorconf.cpp + ecolorutils.cpp + EDE_FontChooser.cpp ; + +MakeProgram ecolorconf : $(SOURCE) ; +ExtractStrings locale : $(SOURCE) ; diff --git a/ecolorconf/Makefile b/ecolorconf/Makefile new file mode 100644 index 0000000..4415b4d --- /dev/null +++ b/ecolorconf/Makefile @@ -0,0 +1,21 @@ + +CPPFILES = ecolorconf.cpp ecolorutils.cpp EDE_FontChooser.cpp ../edelib2/Util.cpp ../edelib2/Config.cpp ../edelib2/Run.cpp ../edelib2/process.cpp ../edelib2/pty.cpp +TARGET = ecolorconf + +POFILES = locale/ru.po\ + locale/sr.po\ + locale/sk.po\ + locale/hu.po\ + +include ../makeinclude + +install: + $(INSTALL_PROGRAM) $(TARGET) $(bindir) + $(INSTALL_LOCALE) + +uninstall: + $(RM) $(bindir)/$(TARGET) + +clean: + $(RM) $(TARGET) + $(RM) *.o diff --git a/ecolorconf/ecolorconf.cpp b/ecolorconf/ecolorconf.cpp new file mode 100644 index 0000000..45abe24 --- /dev/null +++ b/ecolorconf/ecolorconf.cpp @@ -0,0 +1,308 @@ +// generated by Fast Light User Interface Designer (fluid) version 2.0100 + +#include "ecolorconf.h" +/* + * $Id$ + * + * Colors and fonts settings + * Part of Equinox Desktop Environment (EDE). + * Copyright (c) 2000-2006 EDE Authors. + * + * This program is licenced under terms of the + * GNU General Public Licence version 2 or newer. + * See COPYING for details. + */ +#include "../edeconf.h" +#include +#include "ecolorutils.h" + +fltk::Window *windowColorSettings=(fltk::Window *)0; + +static void cb_windowColorSettings(fltk::Window*, void*) { + exit(0); +} + +fltk::Button *colorBox=(fltk::Button *)0; + +fltk::Button *labelColorBox=(fltk::Button *)0; + +fltk::Button *selectionColorBox=(fltk::Button *)0; + +fltk::Button *selectionTextColorBox=(fltk::Button *)0; + +fltk::Button *highlightColorBox=(fltk::Button *)0; + +fltk::Button *highlightLabelColorBox=(fltk::Button *)0; + +fltk::Button *textColorBox=(fltk::Button *)0; + +fltk::Button *backgroundBox=(fltk::Button *)0; + +fltk::Button *textBackgroundBox=(fltk::Button *)0; + +fltk::Button *tooltipBox=(fltk::Button *)0; + +fltk::Button *tooltipTextColorButton=(fltk::Button *)0; + +fltk::CheckButton *tooltipsEnableEffects=(fltk::CheckButton *)0; + +fltk::CheckButton *tooltipsEnable=(fltk::CheckButton *)0; + +fltk::Choice *tooltipsEffectType=(fltk::Choice *)0; + +fltk::ValueInput *tooltipsDelay=(fltk::ValueInput *)0; + +fltk::Button *setLabelFont=(fltk::Button *)0; + +static void cb_setLabelFont(fltk::Button*, void*) { + labelfont_cb(); +} + +fltk::Button *setTextFont=(fltk::Button *)0; + +static void cb_setTextFont(fltk::Button*, void*) { + textfont_cb(); +} + +fltk::InvisibleBox *labelFontInput=(fltk::InvisibleBox *)0; + +fltk::InvisibleBox *textFontInput=(fltk::InvisibleBox *)0; + +fltk::CheckButton *menusEnableEffects=(fltk::CheckButton *)0; + +fltk::CheckButton *menusEnableSubwindowEffects=(fltk::CheckButton *)0; + +fltk::Choice *menusEffectType=(fltk::Choice *)0; + +fltk::ValueInput *menusSpeed=(fltk::ValueInput *)0; + +fltk::ValueInput *menusDelay=(fltk::ValueInput *)0; + +fltk::CheckButton *mdiAnimation=(fltk::CheckButton *)0; + +fltk::CheckButton *mdiOpaqueAnimation=(fltk::CheckButton *)0; + +fltk::CheckButton *imagesStateEffect=(fltk::CheckButton *)0; + +static void cb_Save(fltk::Button*, void*) { + saveSchemeAs(); +} + +fltk::CheckButton *allApplyRadioButton=(fltk::CheckButton *)0; + +fltk::InputBrowser *schemeListBox=(fltk::InputBrowser *)0; + +static void cb_schemeListBox(fltk::InputBrowser*, void*) { + getSchemeColors(); +} + +static void cb_OK(fltk::Button*, void*) { + //windowColorSettings->hide(); + saveActiveScheme(); + applyColors(); + saveEfltkConfig(); + exit(0); +} + +static void cb_Apply(fltk::Button*, void*) { + saveActiveScheme(); + applyColors(); + saveEfltkConfig(); +} + +static void cb_Cancel(fltk::Button*, void*) { + exit(0); +} + +#include + +int main (int argc, char **argv) { + + fltk::Window* w; + //fl_init_locale_support("ecolorconf", PREFIX"/share/locale"); + {fltk::Window* o = windowColorSettings = new fltk::Window(330, 360, "Colors and fonts settings"); + w = o; + o->set_vertical(); + o->callback((fltk::Callback*)cb_windowColorSettings); + o->begin(); + {fltk::TabGroup* o = new fltk::TabGroup(5, 5, 318, 200); + o->color((fltk::Color)0xfffffffe); + o->begin(); + {fltk::Group* o = new fltk::Group(0, 25, 318, 175, "Default colors"); + o->begin(); + {fltk::Button* o = colorBox = new fltk::Button(90, 30, 65, 20, "Widgets"); + o->buttonbox(fltk::DOWN_BOX); + o->callback((fltk::Callback*)ChangeBoxColor); + o->align(fltk::ALIGN_TOP|fltk::ALIGN_LEFT); + } + {fltk::Button* o = labelColorBox = new fltk::Button(15, 75, 65, 20, "Label"); + o->buttonbox(fltk::DOWN_BOX); + o->callback((fltk::Callback*)ChangeBoxColor); + o->align(fltk::ALIGN_TOP|fltk::ALIGN_LEFT); + } + {fltk::Button* o = selectionColorBox = new fltk::Button(240, 120, 65, 20, "Sel. back."); + o->buttonbox(fltk::DOWN_BOX); + o->callback((fltk::Callback*)ChangeBoxColor); + o->align(fltk::ALIGN_TOP|fltk::ALIGN_LEFT); + } + {fltk::Button* o = selectionTextColorBox = new fltk::Button(165, 120, 65, 20, "Selection"); + o->buttonbox(fltk::DOWN_BOX); + o->callback((fltk::Callback*)ChangeBoxColor); + o->align(fltk::ALIGN_TOP|fltk::ALIGN_LEFT); + } + {fltk::Button* o = highlightColorBox = new fltk::Button(165, 30, 65, 20, "Highlight"); + o->buttonbox(fltk::DOWN_BOX); + o->callback((fltk::Callback*)ChangeBoxColor); + o->align(fltk::ALIGN_TOP|fltk::ALIGN_LEFT); + } + {fltk::Button* o = highlightLabelColorBox = new fltk::Button(165, 75, 65, 20, "Highlight"); + o->buttonbox(fltk::DOWN_BOX); + o->callback((fltk::Callback*)ChangeBoxColor); + o->align(fltk::ALIGN_TOP|fltk::ALIGN_LEFT); + } + {fltk::Button* o = textColorBox = new fltk::Button(15, 120, 65, 20, "Text"); + o->buttonbox(fltk::DOWN_BOX); + o->callback((fltk::Callback*)ChangeBoxColor); + o->align(fltk::ALIGN_TOP|fltk::ALIGN_LEFT); + } + {fltk::Button* o = backgroundBox = new fltk::Button(15, 30, 65, 20, "Background"); + o->buttonbox(fltk::DOWN_BOX); + o->callback((fltk::Callback*)ChangeBoxColor); + o->align(fltk::ALIGN_TOP|fltk::ALIGN_LEFT); + } + {fltk::Button* o = textBackgroundBox = new fltk::Button(90, 120, 65, 20, "Background"); + o->buttonbox(fltk::DOWN_BOX); + o->callback((fltk::Callback*)ChangeBoxColor); + o->align(fltk::ALIGN_TOP|fltk::ALIGN_LEFT); + } + o->end(); + } + {fltk::Group* o = new fltk::Group(0, 26, 318, 169, "Tooltips"); + o->hide(); + o->begin(); + {fltk::Button* o = tooltipBox = new fltk::Button(156, 44, 65, 20, "Tooltip color"); + o->buttonbox(fltk::DOWN_BOX); + o->callback((fltk::Callback*)ChangeBoxColor); + o->align(fltk::ALIGN_TOP|fltk::ALIGN_LEFT|fltk::ALIGN_WRAP); + } + {fltk::Button* o = tooltipTextColorButton = new fltk::Button(236, 44, 65, 20, "Tooltip text color"); + o->buttonbox(fltk::DOWN_BOX); + o->callback((fltk::Callback*)ChangeBoxColor); + o->align(fltk::ALIGN_TOP|fltk::ALIGN_LEFT|fltk::ALIGN_WRAP); + } + tooltipsEnableEffects = new fltk::CheckButton(10, 39, 145, 25, "Enable effects"); + tooltipsEnable = new fltk::CheckButton(10, 14, 145, 25, "Enabled"); + {fltk::Choice* o = tooltipsEffectType = new fltk::Choice(75, 80, 115, 23, "Effect type:"); + o->align(fltk::ALIGN_CENTER); + o->begin(); + new fltk::Item("None"); + new fltk::Item("Animation"); + new fltk::Item("Fading"); + o->end(); + } + tooltipsDelay = new fltk::ValueInput(75, 119, 50, 25, "Delay:"); + o->end(); + } + {fltk::Group* o = new fltk::Group(0, 26, 318, 169, "Fonts"); + o->hide(); + o->begin(); + {fltk::Button* o = setLabelFont = new fltk::Button(275, 14, 30, 25, "..."); + o->callback((fltk::Callback*)cb_setLabelFont); + } + {fltk::Button* o = setTextFont = new fltk::Button(275, 49, 30, 25, "..."); + o->callback((fltk::Callback*)cb_setTextFont); + } + {fltk::InvisibleBox* o = labelFontInput = new fltk::InvisibleBox(75, 14, 190, 25, "label"); + o->box(fltk::DOWN_BOX); + o->align(fltk::ALIGN_LEFT|fltk::ALIGN_INSIDE); + } + {fltk::InvisibleBox* o = textFontInput = new fltk::InvisibleBox(75, 50, 190, 24, "label"); + o->box(fltk::DOWN_BOX); + o->align(fltk::ALIGN_LEFT|fltk::ALIGN_INSIDE); + } + {fltk::InvisibleBox* o = new fltk::InvisibleBox(15, 14, 65, 25, "Label font:"); + o->align(fltk::ALIGN_RIGHT|fltk::ALIGN_INSIDE); + } + {fltk::InvisibleBox* o = new fltk::InvisibleBox(15, 49, 65, 25, "Text font:"); + o->align(fltk::ALIGN_RIGHT|fltk::ALIGN_INSIDE); + } + o->end(); + o->label(_(o->label())); + } + {fltk::Group* o = new fltk::Group(0, 26, 318, 174, "Menus"); + o->hide(); + o->begin(); + menusEnableEffects = new fltk::CheckButton(10, 14, 305, 25, "Enable effects"); + menusEnableSubwindowEffects = new fltk::CheckButton(10, 39, 305, 25, "Enable subwindow effects"); + {fltk::Choice* o = menusEffectType = new fltk::Choice(75, 80, 115, 23, "Effect type:"); + o->align(fltk::ALIGN_CENTER); + o->begin(); + new fltk::Item("None"); + new fltk::Item("Animation"); + new fltk::Item("Fading"); + o->end(); + } + menusSpeed = new fltk::ValueInput(75, 119, 45, 25, "Speed:"); + menusDelay = new fltk::ValueInput(211, 119, 50, 25, "Delay:"); + o->end(); + } + {fltk::Group* o = new fltk::Group(0, 26, 318, 174, "Others"); + o->hide(); + o->begin(); + mdiAnimation = new fltk::CheckButton(11, 14, 300, 25, "Enable MDI animation"); + mdiOpaqueAnimation = new fltk::CheckButton(11, 44, 300, 25, "MDI opaque animation"); + imagesStateEffect = new fltk::CheckButton(11, 74, 300, 25, "Enable images state effect"); + o->end(); + } + o->end(); + } + {fltk::Group* o = new fltk::Group(3, 210, 320, 110); + o->box(fltk::DOWN_BOX); + o->begin(); + {fltk::Button* o = new fltk::Button(194, 25, 80, 25, "&Save as..."); + o->callback((fltk::Callback*)cb_Save); + } + {fltk::CheckButton* o = allApplyRadioButton = new fltk::CheckButton(6, 65, 299, 25, "Ap&ply colors to all programs"); + o->when(fltk::WHEN_CHANGED); + } + {fltk::InputBrowser* o = schemeListBox = new fltk::InputBrowser(9, 27, 175, 23, "Schemes:"); + o->callback((fltk::Callback*)cb_schemeListBox); + o->align(fltk::ALIGN_TOP|fltk::ALIGN_LEFT); + o->when(fltk::WHEN_CHANGED); + o->type(1); + o->begin(); + fillItems(); + o->end(); + } + o->end(); + } + {fltk::Button* o = new fltk::Button(75, 328, 80, 25, "&OK"); + o->callback((fltk::Callback*)cb_OK); + } + {fltk::Button* o = new fltk::Button(160, 328, 80, 25, "&Apply"); + o->callback((fltk::Callback*)cb_Apply); + } + {fltk::Button* o = new fltk::Button(245, 328, 80, 25, "&Cancel"); + o->callback((fltk::Callback*)cb_Cancel); + } + o->end(); + o->resizable(o); + } + //updateFontAll(); + loadEfltkConfig(); + w->show(argc, argv); + return fltk::run(); +} + +void ChangeBoxColor(fltk::Button *box, void *) { + //Fl_Button *colorBox = box; + fltk::Color oldColor = box->color(); + fltk::Color defColor = oldColor; + fltk::color_chooser(_("Choose color"), defColor); + if (defColor != oldColor) + { + box->color(defColor); + box->highlight_color(defColor); + box->redraw(); + } +} diff --git a/ecolorconf/ecolorconf.fl b/ecolorconf/ecolorconf.fl new file mode 100644 index 0000000..60550bb --- /dev/null +++ b/ecolorconf/ecolorconf.fl @@ -0,0 +1,276 @@ +# data file for the FLTK User Interface Designer (FLUID) +version 2.0100 +images_dir ./ +header_name {.h} +code_name {.cpp} +gridx 5 +gridy 5 +snap 3 +decl {/* + * $Id$ + * + * Colors and fonts settings + * Part of Equinox Desktop Environment (EDE). + * Copyright (c) 2000-2006 EDE Authors. + * + * This program is licenced under terms of the + * GNU General Public Licence version 2 or newer. + * See COPYING for details. + */} {} + +decl {\#include "../edeconf.h"} {} + +decl {\#include } {} + +decl {\#include "ecolorutils.h"} {} + +Function {} {open +} { + code {//fl_init_locale_support("ecolorconf", PREFIX"/share/locale");} {} + {fltk::Window} windowColorSettings { + label {Colors and fonts settings} + callback {exit(0);} open + xywh {507 139 330 360} resizable visible + } { + {fltk::TabGroup} {} {open + private xywh {5 5 318 200} color 0xfffffffe + } { + {fltk::Group} {} { + label {Default colors} open + xywh {0 25 318 175} + } { + {fltk::Button} colorBox { + label Widgets + callback ChangeBoxColor + xywh {90 30 65 20} align 5 buttonbox DOWN_BOX + } + {fltk::Button} labelColorBox { + label Label + callback ChangeBoxColor + xywh {15 75 65 20} align 5 buttonbox DOWN_BOX + } + {fltk::Button} selectionColorBox { + label {Sel. back.} + callback ChangeBoxColor + xywh {240 120 65 20} align 5 buttonbox DOWN_BOX + } + {fltk::Button} selectionTextColorBox { + label Selection + callback ChangeBoxColor + xywh {165 120 65 20} align 5 buttonbox DOWN_BOX + } + {fltk::Button} highlightColorBox { + label Highlight + callback ChangeBoxColor + xywh {165 30 65 20} align 5 buttonbox DOWN_BOX + } + {fltk::Button} highlightLabelColorBox { + label Highlight + callback ChangeBoxColor + xywh {165 75 65 20} align 5 buttonbox DOWN_BOX + } + {fltk::Button} textColorBox { + label Text + callback ChangeBoxColor + xywh {15 120 65 20} align 5 buttonbox DOWN_BOX + } + {fltk::Button} backgroundBox { + label Background + callback ChangeBoxColor + xywh {15 30 65 20} align 5 buttonbox DOWN_BOX + } + {fltk::Button} textBackgroundBox { + label Background + callback ChangeBoxColor + xywh {90 120 65 20} align 5 buttonbox DOWN_BOX + } + } + {fltk::Group} {} { + label Tooltips open + xywh {0 26 318 169} hide + } { + {fltk::Button} tooltipBox { + label {Tooltip color} + callback ChangeBoxColor + xywh {156 44 65 20} align 133 buttonbox DOWN_BOX + } + {fltk::Button} tooltipTextColorButton { + label {Tooltip text color} + callback ChangeBoxColor + xywh {236 44 65 20} align 133 buttonbox DOWN_BOX + } + {fltk::CheckButton} tooltipsEnableEffects { + label {Enable effects} + xywh {10 39 145 25} + } + {fltk::CheckButton} tooltipsEnable { + label Enabled + xywh {10 14 145 25} + } + {fltk::Choice} tooltipsEffectType { + label {Effect type:} open + xywh {75 80 115 23} align 0 + } { + {fltk::Item} {} { + label None + } + {fltk::Item} {} { + label Animation + } + {fltk::Item} {} { + label Fading + } + } + {fltk::ValueInput} tooltipsDelay { + label {Delay:} + xywh {75 119 50 25} + } + } + {fltk::Group} {} { + label Fonts open + xywh {0 26 318 169} hide + extra_code {o->label(_(o->label()));} + } { + {fltk::Button} setLabelFont { + label {...} + callback {labelfont_cb();} + xywh {275 14 30 25} + } + {fltk::Button} setTextFont { + label {...} + callback {textfont_cb();} + xywh {275 49 30 25} + } + {fltk::InvisibleBox} labelFontInput { + label label + xywh {75 14 190 25} align 36 box DOWN_BOX + } + {fltk::InvisibleBox} textFontInput { + label label + xywh {75 50 190 24} align 36 box DOWN_BOX + } + {fltk::InvisibleBox} {} { + label {Label font:} + xywh {15 14 65 25} align 40 + } + {fltk::InvisibleBox} {} { + label {Text font:} + xywh {15 49 65 25} align 40 + } + } + {fltk::Group} {} { + label Menus open + xywh {0 26 318 174} hide + } { + {fltk::CheckButton} menusEnableEffects { + label {Enable effects} + xywh {10 14 305 25} + } + {fltk::CheckButton} menusEnableSubwindowEffects { + label {Enable subwindow effects} + xywh {10 39 305 25} + } + {fltk::Choice} menusEffectType { + label {Effect type:} + xywh {75 80 115 23} align 0 + } { + {fltk::Item} {} { + label None + } + {fltk::Item} {} { + label Animation + } + {fltk::Item} {} { + label Fading + } + } + {fltk::ValueInput} menusSpeed { + label {Speed:} + xywh {75 119 45 25} + } + {fltk::ValueInput} menusDelay { + label {Delay:} + xywh {211 119 50 25} + } + } + {fltk::Group} {} { + label Others open + xywh {0 26 318 174} hide + } { + {fltk::CheckButton} mdiAnimation { + label {Enable MDI animation} + xywh {11 14 300 25} + } + {fltk::CheckButton} mdiOpaqueAnimation { + label {MDI opaque animation} + xywh {11 44 300 25} + } + {fltk::CheckButton} imagesStateEffect { + label {Enable images state effect} + xywh {11 74 300 25} + } + } + } + {fltk::Group} {} {open + xywh {3 210 320 110} box DOWN_BOX + } { + {fltk::Button} {} { + label {&Save as...} + callback {saveSchemeAs();} + private xywh {194 25 80 25} + } + {fltk::CheckButton} allApplyRadioButton { + label {Ap&ply colors to all programs} + xywh {6 65 299 25} when CHANGED + } + {fltk::Choice} schemeListBox { + label {Schemes:} + callback {getSchemeColors();} open selected + xywh {9 27 175 23} align 5 when CHANGED + extra_code {\#include +o->type(1); +o->begin(); +fillItems(); +o->end();} + class {fltk::InputBrowser} + } {} + } + {fltk::Button} {} { + label {&OK} + callback {//windowColorSettings->hide(); +saveActiveScheme(); +applyColors(); +saveEfltkConfig(); +exit(0);} + private xywh {75 328 80 25} + } + {fltk::Button} {} { + label {&Apply} + callback {saveActiveScheme(); +applyColors(); +saveEfltkConfig();} + private xywh {160 328 80 25} + } + {fltk::Button} {} { + label {&Cancel} + callback {exit(0);} + private xywh {245 328 80 25} + } + } + code {//updateFontAll(); +loadEfltkConfig();} {} +} + +Function {ChangeBoxColor(fltk::Button *box, void *)} {open return_type void +} { + code {//Fl_Button *colorBox = box; +fltk::Color oldColor = box->color(); +fltk::Color defColor = oldColor; +fltk::color_chooser(_("Choose color"), defColor); +if (defColor != oldColor) +{ + box->color(defColor); + box->highlight_color(defColor); + box->redraw(); +}} {} +} diff --git a/ecolorconf/ecolorconf.fld b/ecolorconf/ecolorconf.fld new file mode 100644 index 0000000..69ebf2d --- /dev/null +++ b/ecolorconf/ecolorconf.fld @@ -0,0 +1,275 @@ +# data file for the eFLTK User Interface Designer (eFLUID) +version 2,0003 +images_dir ./ +i18n +header_name {.h} +code_name {.cpp} +gridx 5 +gridy 5 +snap 3 +decl {// EControl applet for colors and fonts} {} + +decl {// Copyright (c) 2000. - 2005. EDE Authors} {} + +decl {// This program is licenced under terms of the} {} + +decl {// GNU General Public Licence version 2 or newer.} {} + +decl {// See COPYING for details} {} + +decl {//} {} + +decl {\#include } {} + +decl {\#include } {} + +decl {\#include "ecolorutils.h"} {} + +Function {} {open +} { + code {fl_init_locale_support("ecolorconf", PREFIX"/share/locale");} {} + Fl_Window windowColorSettings { + label {Colors and fonts settings} + callback {exit(0);} open + xywh {507 139 330 360} resizable visible + } { + Fl_Tabs {} {open + private xywh {3 5 320 195} color 0xfffffffe + } { + Fl_Group {} { + label {Default colors} open + xywh {1 24 318 170} align FL_ALIGN_TOP|FL_ALIGN_LEFT hide + } { + Fl_Button colorBox { + label Widgets + callback ChangeBoxColor + xywh {91 31 65 20} align FL_ALIGN_TOP|FL_ALIGN_LEFT|FL_ALIGN_WRAP box DOWN_BOX + } + Fl_Button labelColorBox { + label Label + callback ChangeBoxColor + xywh {16 76 65 20} align FL_ALIGN_TOP|FL_ALIGN_LEFT|FL_ALIGN_WRAP box DOWN_BOX + } + Fl_Button selectionColorBox { + label {Sel. back.} + callback ChangeBoxColor + xywh {241 121 65 20} align FL_ALIGN_TOP|FL_ALIGN_LEFT|FL_ALIGN_WRAP box DOWN_BOX + } + Fl_Button selectionTextColorBox { + label Selection + callback ChangeBoxColor + xywh {166 121 65 20} align FL_ALIGN_TOP|FL_ALIGN_LEFT|FL_ALIGN_WRAP box DOWN_BOX + } + Fl_Button highlightColorBox { + label Highlight + callback ChangeBoxColor + xywh {166 31 65 20} align FL_ALIGN_TOP|FL_ALIGN_LEFT|FL_ALIGN_WRAP box DOWN_BOX + } + Fl_Button highlightLabelColorBox { + label Highlight + callback ChangeBoxColor + xywh {166 76 65 20} align FL_ALIGN_TOP|FL_ALIGN_LEFT|FL_ALIGN_WRAP box DOWN_BOX + } + Fl_Button textColorBox { + label Text + callback ChangeBoxColor + xywh {16 121 65 20} align FL_ALIGN_TOP|FL_ALIGN_LEFT|FL_ALIGN_WRAP box DOWN_BOX + } + Fl_Button backgroundBox { + label Background + callback ChangeBoxColor + xywh {16 31 65 20} align FL_ALIGN_TOP|FL_ALIGN_LEFT|FL_ALIGN_WRAP box DOWN_BOX + } + Fl_Button textBackgroundBox { + label Background + callback ChangeBoxColor + xywh {91 121 65 20} align FL_ALIGN_TOP|FL_ALIGN_LEFT|FL_ALIGN_WRAP box DOWN_BOX + } + } + Fl_Group {} { + label Tooltips open + xywh {1 24 318 170} align FL_ALIGN_TOP|FL_ALIGN_LEFT hide + } { + Fl_Button tooltipBox { + label {Tooltip color} + callback ChangeBoxColor + xywh {157 45 65 20} align FL_ALIGN_TOP|FL_ALIGN_LEFT|FL_ALIGN_WRAP box DOWN_BOX + } + Fl_Button tooltipTextColorButton { + label {Tooltip text color} + callback ChangeBoxColor + xywh {237 45 65 20} align FL_ALIGN_TOP|FL_ALIGN_LEFT|FL_ALIGN_WRAP box DOWN_BOX + } + Fl_Check_Button tooltipsEnableEffects { + label {Enable effects} + xywh {7 45 145 25} + } + Fl_Check_Button tooltipsEnable { + label Enabled + xywh {7 15 145 25} + } + Fl_Choice tooltipsEffectType { + label {Effect type:} + xywh {77 82 115 23} align FL_ALIGN_LEFT|FL_ALIGN_WRAP + } { + Fl_Item {} { + label None + } + Fl_Item {} { + label Animation + } + Fl_Item {} { + label Fading + } + } + Fl_Value_Input tooltipsDelay { + label {Delay:} + xywh {77 120 50 25} + } + } + Fl_Group {} { + label Fonts open + xywh {1 24 318 170} align FL_ALIGN_TOP|FL_ALIGN_LEFT + extra_code {o->label(_(o->label()));} + } { + Fl_Button setLabelFont { + label {...} + callback {labelfont_cb();} + xywh {276 16 30 25} + } + Fl_Button setTextFont { + label {...} + callback {textfont_cb();} + xywh {276 51 30 25} + } + Fl_Box labelFontInput { + label label + xywh {76 16 190 25} align FL_ALIGN_TOP|FL_ALIGN_LEFT|FL_ALIGN_INSIDE|FL_ALIGN_WRAP box DOWN_BOX + } + Fl_Box textFontInput { + label label + xywh {76 52 190 24} align FL_ALIGN_TOP|FL_ALIGN_LEFT|FL_ALIGN_INSIDE|FL_ALIGN_WRAP box DOWN_BOX + } + Fl_Box {} { + label {Label font:} + xywh {11 16 65 25} align FL_ALIGN_RIGHT|FL_ALIGN_INSIDE + } + Fl_Box {} { + label {Text font:} + xywh {11 51 65 25} align FL_ALIGN_RIGHT|FL_ALIGN_INSIDE + } + } + Fl_Group {} { + label Menus open + xywh {1 24 318 170} hide + } { + Fl_Check_Button menusEnableEffects { + label {Enable effects} + xywh {7 5 305 25} + } + Fl_Check_Button menusEnableSubwindowEffects { + label {Enable subwindow effects} + xywh {7 30 305 25} + } + Fl_Choice menusEffectType { + label {Effect type:} open + xywh {77 60 115 23} align FL_ALIGN_LEFT|FL_ALIGN_WRAP + } { + Fl_Item {} { + label None + } + Fl_Item {} { + label Animation + } + Fl_Item {} { + label Fading + } + } + Fl_Value_Input menusSpeed { + label {Speed:} + xywh {77 95 45 25} + } + Fl_Value_Input menusDelay { + label {Delay:} + xywh {212 95 50 25} + } + } + Fl_Group {} { + label Others open + xywh {1 24 318 170} hide + } { + Fl_Check_Button mdiAnimation { + label {Enable MDI animation} + xywh {12 10 300 25} + } + Fl_Check_Button mdiOpaqueAnimation { + label {MDI opaque animation} + xywh {12 40 300 25} + } + Fl_Check_Button imagesStateEffect { + label {Enable images state effect} + xywh {12 70 300 25} + } + } + } + Fl_Group {} {open + xywh {3 210 320 100} box DOWN_BOX + } { + Fl_Button {} { + label {&Save as...} + callback {saveSchemeAs();} + private xywh {197 20 80 25} + } + Fl_Check_Button allApplyRadioButton { + label {Ap&ply colors to all programs} + xywh {9 60 299 25} align FL_ALIGN_LEFT|FL_ALIGN_INSIDE|FL_ALIGN_WRAP when CHANGED + } + Fl_Choice schemeListBox { + label {Schemes:} + callback {getSchemeColors();} open + xywh {12 22 175 23} align FL_ALIGN_TOP|FL_ALIGN_LEFT when CHANGED + extra_code {\#include +o->type(1); +fillItems();} + class Fl_Input_Browser + } {} + } + Fl_Button {} { + label {&OK} + callback {//windowColorSettings->hide(); +saveActiveScheme(); +applyColors(); +saveEfltkConfig(); +exit(0);} + private xywh {75 328 80 25} + } + Fl_Button {} { + label {&Apply} + callback {saveActiveScheme(); +applyColors(); +saveEfltkConfig();} + private xywh {160 328 80 25} + } + Fl_Button {} { + label {&Cancel} + callback {exit(0);} + private xywh {245 328 80 25} + } + } + code {//updateFontAll(); +loadEfltkConfig();} {} +} + +Function {ChangeBoxColor(Fl_Button *box, void *)} {open return_type void +} { + code {Fl_Button *colorBox = box; +Fl_Color oldColor = colorBox->color(); +Fl_Color defColor = oldColor; +fl_color_chooser(_("Choose color"), defColor); +if (defColor != oldColor) +{ + colorBox->color(defColor); + colorBox->highlight_color(defColor); + colorBox->redraw(); +}} {} +} diff --git a/ecolorconf/ecolorconf.h b/ecolorconf/ecolorconf.h new file mode 100644 index 0000000..5677534 --- /dev/null +++ b/ecolorconf/ecolorconf.h @@ -0,0 +1,47 @@ +// generated by Fast Light User Interface Designer (fluid) version 2.0100 + +#ifndef ecolorconf_h +#define ecolorconf_h +#include +extern fltk::Window* windowColorSettings; +#include +#include +#include +extern void ChangeBoxColor(fltk::Button*, void*); +extern fltk::Button* colorBox; +extern fltk::Button* labelColorBox; +extern fltk::Button* selectionColorBox; +extern fltk::Button* selectionTextColorBox; +extern fltk::Button* highlightColorBox; +extern fltk::Button* highlightLabelColorBox; +extern fltk::Button* textColorBox; +extern fltk::Button* backgroundBox; +extern fltk::Button* textBackgroundBox; +extern fltk::Button* tooltipBox; +extern fltk::Button* tooltipTextColorButton; +#include +extern fltk::CheckButton* tooltipsEnableEffects; +extern fltk::CheckButton* tooltipsEnable; +#include +extern fltk::Choice* tooltipsEffectType; +#include +#include +extern fltk::ValueInput* tooltipsDelay; +extern fltk::Button* setLabelFont; +extern fltk::Button* setTextFont; +#include +extern fltk::InvisibleBox* labelFontInput; +extern fltk::InvisibleBox* textFontInput; +extern fltk::CheckButton* menusEnableEffects; +extern fltk::CheckButton* menusEnableSubwindowEffects; +extern fltk::Choice* menusEffectType; +extern fltk::ValueInput* menusSpeed; +extern fltk::ValueInput* menusDelay; +extern fltk::CheckButton* mdiAnimation; +extern fltk::CheckButton* mdiOpaqueAnimation; +extern fltk::CheckButton* imagesStateEffect; +extern fltk::CheckButton* allApplyRadioButton; +#include +extern fltk::InputBrowser* schemeListBox; +void ChangeBoxColor(fltk::Button *box, void *); +#endif diff --git a/ecolorconf/ecolorutils.cpp b/ecolorconf/ecolorutils.cpp new file mode 100644 index 0000000..f5fdf23 --- /dev/null +++ b/ecolorconf/ecolorutils.cpp @@ -0,0 +1,701 @@ +/* + * $Id$ + * + * Colors and fonts settings + * Part of Equinox Desktop Environment (EDE). + * Copyright (c) 2000-2006 EDE Authors. + * + * This program is licenced under terms of the + * GNU General Public Licence version 2 or newer. + * See COPYING for details. + */ + +#include +#include + +//#include +#include //#include +#include "../edelib2/Run.h" //#include +//#include + +#include "ecolorutils.h" +#include "ecolorconf.h" +#include "EDE_FontChooser.h" + + + +using namespace fltk; +using namespace edelib; + +//////////////////////// +// Useful functions from efltk +//////////////////////// + +char *my_get_homedir() { + char *path = new char[PATH_MAX]; + const char *str1; + + str1=getenv("HOME"); + if (str1) { + memcpy(path, str1, strlen(str1)+1); + return path; + } + + return 0; +} + + +//////////////////////// + + + +//////////////////////// +// Useful functions that should be in fltk +//////////////////////// + +char *filename_noext(char *buf) +{ + char *p=buf, *q=0; + while (*p++) + { + if (*p == '/') q = 0; +#if defined(_WIN32) || defined(__EMX__) + else if (*p == '\\') q = 0; +#endif + else if (*p == '.') q = p; + } + if (q) *q='\0'; + return buf; +} + + +//////////////////////// + + + +EDEFont labelfont, textfont; + +static void sendClientMessage(Window w, Atom a, long x) +{ +// no worky +/* XEvent ev; + long mask; + + memset(&ev, 0, sizeof(ev)); + ev.xclient.type = ClientMessage; + ev.xclient.window = w; + ev.xclient.message_type = a; + ev.xclient.format = 32; + ev.xclient.data.l[0] = x; + ev.xclient.data.l[1] = CurrentTime; + mask = 0L; + if (w == RootWindow(fl_display, fl_screen)) + mask = SubstructureRedirectMask; + XSendEvent(fl_display, w, False, mask, &ev);*/ +} + +void sendUpdateInfo(Atom what) +{ +// no worky +/* unsigned int i, nrootwins; + Window dw1, dw2, *rootwins = 0; + int screen_count = ScreenCount(fl_display); + for (int s = 0; s < screen_count; s++) { + Window root = RootWindow(fl_display, s); + XQueryTree(fl_display, root, &dw1, &dw2, &rootwins, &nrootwins); + for (i = 0; i < nrootwins; i++) { + if (rootwins[i]!=RootWindow(fl_display, fl_screen)) { + sendClientMessage(rootwins[i], what, 0); + } + } + }*/ +} + +// Comment from before +/* +void updateSizes(Fl_Input_Browser *font_sizes) +{ + int *sizes; + int cnt = fl_font()->sizes(sizes); + + font_sizes->clear(); + font_sizes->begin(); + + char tmp[8]; + for(int n=0; ncopy_label(tmp); + } + font_sizes->end(); +} + +void updateEncodings(Fl_Input_Browser *font_combo) +{ + int encs; + const char **array; + encs = fl_font()->encodings(array); + + fontEncoding->clear(); + fontEncoding->begin(); + for(int n=0; nend(); +} + +void updateFontChange(Fl_Input_Browser *font_combo, Fl_Input_Browser *font_sizes) +{ + //Fl_Font f = fl_find_font(font_combo->value()); + Fl_Font f = fl_create_font(font_combo->value()); + int s = (int)atoi(font_sizes->value()); + + if(!f) return; + + fl_font(f,s); + + updateSizes(font_sizes); + updateEncodings(font_combo); +} + +void updateFontAll() +{ + updateFontChange(labelFontInput, labelSize); + updateFontChange(textFontInput, textSize); +}*/ + + +void apply_colors_apps(Color fg, Color bg, Color text, const char* font) +{ + uchar r, g, b, r1, g1, b1, r2, g2, b2; + split_color(bg, r, g, b); + split_color(fg, r1, g1, b1); + split_color(text, r2, g2, b2); + + char filePath[PATH_MAX]; + snprintf(filePath,PATH_MAX,"%s/.Xdefaults",my_get_homedir()); + + char *backgroundTypes[34] = + { + "*XmList.background" , "*XmLGrid.background", + "Netscape*XmList.background" , "Netscape*XmLGrid.background", + "*text*background", "*list*background", + "*Text*background", "*List*background", + "*textBackground", "*XmTextField.background", + "*XmText.background", "Netscape*XmTextField.background", + "Netscape*XmText.background", "*background", + "*Background", "nscal*Background", + "*Menu*background", "OpenWindows*WindowColor", + "Window.Color.Background", "netscape*background", + "Netscape*background", ".netscape*background", + "Ddd*background", "Emacs*Background", + "Emacs*backgroundToolBarColor",//25 + "*XmList.selectBackground" , "*XmLGrid.selectBackground", + "Netscape*XmList.selectBackground" , "Netscape*XmLGrid.selectBackground", + "*XmTextField.selectBackground", "*XmText.selectBackground", + "Netscape*XmTextField.selectBackground", "Netscape*XmText.selectBackground", + "*selectBackground" //34 + + }; + + FILE *colorFile = fopen(filePath, "w"); + for (int i = 0 ; i < 34; i++) + { + fprintf(colorFile, "%s: #%02X%02X%02X\n", backgroundTypes[i],(short int) r, (short int) g, (short int) b); + } + fprintf(colorFile, "foreground: #%02X%02X%02X\n", r1, g1, b1); + fprintf(colorFile, "xterm*background: #FFFFFF\n"); //especialy for Xterm + fclose(colorFile); + + char runString[PATH_MAX]; + snprintf(runString,PATH_MAX,"xrdb -merge -all %s/.Xdefaults",my_get_homedir()); + +// if (fl_start_child_process(runString)==-1) + if (run_program(runString)>255) + alert("Error executing xrdb program."); +} + + +void apply_colors_gtk(Color fg, + Color bg, + Color selection, + Color selection_text, + Color tooltip, + Color tooltip_text, + + Color text, + const char* font) +{ + uchar r, g, b; + uchar text_r, text_g, text_b; + //, b1, r2, g2, b2; + + uchar selection_r, selection_g, selection_b; + uchar selection_text_r, selection_text_g, selection_text_b; + uchar tooltip_r, tooltip_g, tooltip_b; + uchar tooltip_text_r, tooltip_text_g, tooltip_text_b; + + split_color(bg, r, g, b); + split_color(fg, text_r, text_g, text_b); + + split_color(selection, selection_r, selection_g, selection_b); + split_color(selection_text, selection_text_r, selection_text_g, selection_text_b); + split_color(tooltip, tooltip_r, tooltip_g, tooltip_b); + split_color(tooltip_text, tooltip_text_r, tooltip_text_g, tooltip_text_b); + +// fl_get_color(text, r2, g2, b2); + + char filePath[PATH_MAX]; + snprintf(filePath,PATH_MAX,"%s/.gtkrc",my_get_homedir()); + + FILE *gtkFile = fopen(filePath, "w"); + + fprintf(gtkFile, "style \"default\" \n"); + fprintf(gtkFile, "{\n"); + fprintf(gtkFile, "fontset = \"%s\" \n", font); + fprintf(gtkFile, "bg[NORMAL] = \"#%02X%02X%02X\"\n", r, g, b); + fprintf(gtkFile, "fg[NORMAL] = \"#%02X%02X%02X\"\n", text_r, text_g, text_b); + fprintf(gtkFile, "bg[PRELIGHT] = \"#%02X%02X%02X\"\n", r, g, b); + fprintf(gtkFile, "fg[PRELIGHT] = \"#%02X%02X%02X\"\n", text_r, text_g, text_b); + fprintf(gtkFile, "bg[ACTIVE] = \"#%02X%02X%02X\"\n", r, g, b); + fprintf(gtkFile, "fg[ACTIVE] = \"#%02X%02X%02X\"\n", text_r, text_g, text_b); + fprintf(gtkFile, "bg[SELECTED] = \"#%02X%02X%02X\"\n", selection_r, selection_g, selection_b); + fprintf(gtkFile, "fg[SELECTED] = \"#%02X%02X%02X\"\n", selection_text_r, selection_text_g, selection_text_b); + fprintf(gtkFile, "}\n"); + + fprintf(gtkFile, "style \"menu\" \n"); + fprintf(gtkFile, "{\n"); + fprintf(gtkFile, "bg[PRELIGHT] = \"#%02X%02X%02X\"\n", selection_r, selection_g, selection_b); + fprintf(gtkFile, "fg[PRELIGHT] = \"#%02X%02X%02X\"\n", selection_text_r, selection_text_g, selection_text_b); + fprintf(gtkFile, "}\n"); + + fprintf(gtkFile, "style \"tooltip\" \n"); + fprintf(gtkFile, "{\n"); + fprintf(gtkFile, "bg[NORMAL] = \"#%02X%02X%02X\"\n", tooltip_r, tooltip_g, tooltip_b); + fprintf(gtkFile, "fg[NORMAL] = \"#%02X%02X%02X\"\n", tooltip_text_r, tooltip_text_g, tooltip_text_b); + fprintf(gtkFile, "}\n"); + + fprintf(gtkFile, "class \"*\" style \"default\"\n"); + fprintf(gtkFile, "widget_class \"*Menu*\" style \"menu\" \n"); + fprintf(gtkFile, "widget \"gtk-tooltips\" style \"tooltip\" \n"); + + + fclose(gtkFile); +} + + +void apply_colors_qt(Color fg, Color bg, Color text, const char* font) +{ + uchar r, g, b, r1, g1, b1, r2, g2, b2; + split_color(bg, r, g, b); + split_color(fg, r1, g1, b1); + split_color(text, r2, g2, b2); + + char filePath[PATH_MAX]; + snprintf(filePath,PATH_MAX,"%s/.qt/qtrc",my_get_homedir()); + + FILE *qtfile = fopen(filePath, "w"); + + fprintf(qtfile, "[General]\n"); + fprintf(qtfile, "GUIEffects=none^e\n"); + fprintf(qtfile, "style=Windows\n\n"); + fprintf(qtfile, "[Palette]\n"); + fprintf(qtfile, "active=#000000^e#%02x%02x%02x^e#ffffff^e#%02x%02x%02x^e#000000^e" + "#%02x%02x%02x^e#000000^e#ffffff^e#000000^e#ffffff^e#%02x%02x%02x^e#000000^e" + "#7783bd^e#ffffff^e#0000ff^e#ff00ff^e\n", + r,g,b, r,g,b, r,g,b, r,g,b); + fprintf(qtfile, "disabled=#808080^e#%02x%02x%02x^e#ffffff^e#f2f2f2^e#%02x%02x%02x^e" + "#b7b7b7^e#b7b7b7^e#ffffff^e#000000^e#ffffff^e#dcdcdc^e#000000^e" + "#000080^e#ffffff^e#0000ff^e#ff00ff^e\n", + r,g,b, r,g,b); + fprintf(qtfile, "inactive=#000000^e#%02x%02x%02x^e#ffffff^e#f2f2f2^e#%02x%02x%02x^e" + "#b7b7b7^e#000000^e#ffffff^e#000000^e#ffffff^e#dcdcdc^e" + "#000000^e#7783bd^e#ffffff^e#0000ff^e#ff00ff^e\n", + r,g,b, r,g,b); + + fclose(qtfile); +} + + +void apply_colors_kde(Color fg, Color bg, Color text, const char* font) +{ + uchar r, g, b, r1, g1, b1, r2, g2, b2; + split_color(bg, r, g, b); + split_color(fg, r1, g1, b1); + split_color(text, r2, g2, b2); + + char filePath[PATH_MAX]; + snprintf (filePath,PATH_MAX,"%s/.kderc",my_get_homedir()); + + FILE *kdefile = fopen(filePath, "w"); + + fprintf(kdefile, "[General]\n"); + fprintf(kdefile, "background=%d,%d,%d\n", r, g, b); + fprintf(kdefile, "foreground=%d,%d,%d\n", r1, g1, b1); + + fclose(kdefile); +} + +void saveScheme(char *scheme) +{ + char *keys[] = + { + "color", "label color", "selection color", + "selection text color", "highlight color", "text color", + "highlight label color", + }; + Button *colorBoxes[7] = + { + colorBox, labelColorBox, selectionColorBox, selectionTextColorBox, + highlightColorBox, textColorBox, highlightLabelColorBox + }; + +// We can save new scheme even if there is no existing +// if (schemeListBox->size() > 1) +// { + if (colorBox->color() == labelColorBox->color()) + { alert(_("Color and label color are the same. Edit colors first.")); + } + else + { + Config colorConfig(scheme); //save to "active".scheme + + colorConfig.set_section("widgets/default"); + for (int boxIndex=0; boxIndex<7; boxIndex++) { + colorConfig.write(keys[boxIndex], (int)colorBoxes[boxIndex]->color()); + } + + colorConfig.write("text background", (int)textBackgroundBox->color()); + + // we don't want to lose leading space... + char tr[128]; + strncpy (tr, labelfont.font->system_name(), 128); + if (tr[0] == ' ') tr[0] = '_'; + colorConfig.write("label font", tr); + strncpy (tr, textfont.font->system_name(), 128); + if (tr[0] == ' ') tr[0] = '_'; + colorConfig.write("text font", tr); + + colorConfig.write("label size", labelfont.size); + colorConfig.write("text size", textfont.size); + colorConfig.write("font encoding", textfont.encoding); + + colorConfig.set_section("widgets/tooltip"); + colorConfig.write("color", (int)tooltipBox->color()); + colorConfig.write("label color", (int)tooltipTextColorButton->color()); + + colorConfig.set_section("global colors"); + colorConfig.write("background", (int)backgroundBox->color()); + } +// } +} + +void saveActiveScheme() +{ + char pathActive[PATH_MAX]; + snprintf(pathActive,PATH_MAX,"%s/.ede/schemes/Active.scheme",my_get_homedir()); + + saveScheme(pathActive); +} + +void saveSchemeAs() +{ + const char *schemeName = input(_("Save scheme as:"), _("New scheme")); + if (schemeName) + { + char pathScheme[PATH_MAX]; + //pathScheme.printf("%s/.ede/schemes/%s.scheme", fl_homedir().c_str(), schemeName); + snprintf(pathScheme, PATH_MAX, "%s/.ede/schemes/%s.scheme", my_get_homedir(), schemeName); + saveScheme(pathScheme); + schemeListBox->add(filename_noext(filename_name(pathScheme))); + } +} + +void applyColors() +{ +// sendUpdateInfo(FLTKChangeScheme); + + if (allApplyRadioButton->value()==1) + { + apply_colors_apps(labelColorBox->color(), backgroundBox->color(), + textBackgroundBox->color(), labelFontInput->label()); + apply_colors_gtk(labelColorBox->color(), backgroundBox->color(), + selectionColorBox->color(), selectionTextColorBox->color(), + tooltipBox->color(), tooltipTextColorButton->color(), + textBackgroundBox->color(), labelFontInput->label() + ); + apply_colors_qt(labelColorBox->color(), backgroundBox->color(), + textBackgroundBox->color(), labelFontInput->label()); + apply_colors_kde(labelColorBox->color(), backgroundBox->color(), + textBackgroundBox->color(), labelFontInput->label()); + } +} + +void fillItems() +{ + char *file; + + char path[PATH_MAX]; + snprintf(path,PATH_MAX,"%s/.ede/schemes",my_get_homedir()); + + if (access(path,0)) { mkdir( path, 0777 ); } + + dirent **files; + int count = filename_list(path, &files); + +// We should always have an "active" scheme, even if directory is empty +// if (count > 0) +// { + new Item("Active"); + schemeListBox->text("Active"); + + + for(int n=0; nd_name; + if( strcmp(file, ".")!=0 && strcmp(file, "..")!=0) + { + char filename[PATH_MAX]; + snprintf(filename,PATH_MAX,"%s/%s", path, file); + if (!filename_isdir(filename) && + filename_match(file, "*.scheme") && strcmp(file, "Active.scheme")!=0) + { + new Item(strdup(filename_noext(filename_name(filename)))); + } + } + free(files[n]); + } + free(files); + getSchemeColors(); //we apply first scheme - active.scheme +// } + +} + +void getSchemeColors() +{ +// Hardcoded defaults are below, inside read() calls + + char tr[128]; + int ir = 0; + char *keys[] = + { + "color", "label color", "selection color", + "selection text color", "highlight color", "text color", + "highlight label color", + }; + long keys_defaults[] = + { + 7, 32, 796173568, 7, 49, 32, 32 + }; + Button *colorBoxes[7] = + { + colorBox, labelColorBox, selectionColorBox, selectionTextColorBox, + highlightColorBox, textColorBox, highlightLabelColorBox + }; +// We always have at least "Active" on the list +// if (schemeListBox->size() > 1) +// { + Config *colorConfig; + + const char *ai = schemeListBox->text(); + if (strcmp(ai, "Active")==0) + { + char pathActive[PATH_MAX]; + snprintf(pathActive, sizeof(pathActive)-1, "%s/.ede/schemes/Active.scheme", my_get_homedir()); + colorConfig = new Config(pathActive); + } else { + char pathScheme[PATH_MAX]; + snprintf(pathScheme, sizeof(pathScheme)-1, "%s/.ede/schemes/%s.scheme", my_get_homedir(), ai); + // However, sometimes a bogus entry is selected: + if (!filename_exist(pathScheme)) return; + colorConfig = new Config(pathScheme); + } + + for(int boxIndex = 0; boxIndex < 7; boxIndex++) + { + colorConfig->set_section("widgets/default"); + colorConfig->read(keys[boxIndex], ir, keys_defaults[boxIndex]); + colorBoxes[boxIndex]->color((Color)ir); + colorBoxes[boxIndex]->highlight_color((Color)ir); + } + + colorConfig->set_section("widgets/tooltip"); + colorConfig->read("color", ir, -16784896); + tooltipBox->color((Color)ir); + tooltipBox->highlight_color((Color)ir); + + colorConfig->read("label color",ir, 32); + tooltipTextColorButton->color((Color)ir); + tooltipTextColorButton->highlight_color((Color)ir); + + colorConfig->set_section("widgets/default"); + colorConfig->read("text background", ir, 7); + textBackgroundBox->color((Color)ir); + textBackgroundBox->highlight_color((Color)ir); + + char tmpencoding[PATH_MAX]; + colorConfig->read("font encoding", tr, "iso8859-2", sizeof(tr)); strncpy(tmpencoding,tr,PATH_MAX); + + colorConfig->read("label font", tr, fltk::HELVETICA->name(), sizeof(tr)); + { + if (tr[0] == '_') tr[0] = ' '; // converted leading space + fltk::Font* thefont = font(tr); //Style.h + labelfont.font = thefont; + if (labelfont.encoding) free(labelfont.encoding); + labelfont.encoding = strdup(tmpencoding); + labelfont.defined = true; + + colorConfig->read("label size", ir, 12); + labelfont.size = ir; + } + + colorConfig->read("text font", tr, fltk::HELVETICA->name(), sizeof(tr)); + { + if (tr[0] == '_') tr[0] = ' '; + fltk::Font* thefont = font(tr); + textfont.font = thefont; + if (textfont.encoding) free(textfont.encoding); + textfont.encoding = strdup(tmpencoding); + textfont.defined = true; + + colorConfig->read("text size", ir, 12); + textfont.size = ir; + } + + labelFontInput->label(font_nice_name(labelfont)); + textFontInput->label(font_nice_name(textfont)); + + colorConfig->set_section("global colors"); + colorConfig->read("background", ir, -673724416); + backgroundBox->color((Color)ir); + + colorBox->parent()->parent()->redraw(); + + delete colorConfig; +// } +} + +void loadEfltkConfig() +{ + char *file = 0; + file = Config::find_file("efltk.conf", false, Config::USER); + if(!file) file = Config::find_file("efltk.conf", false, Config::SYSTEM); + + Config cfg(file, true, false); + if(!cfg.error()) + { + bool b_val; + float f_val; + int i_val; + + // Read Fl_Image defaults: + cfg.get("Images", "State Effects", b_val, true); + imagesStateEffect->value(b_val); + + // Read Fl_Menu_Window defaults: + cfg.get("Menus", "Effects", b_val, true); + menusEnableEffects->value(b_val); + cfg.get("Menus", "Subwindow Effect", b_val, true); + menusEnableSubwindowEffects->value(b_val); + cfg.get("Menus", "Effect Type", i_val, 1); + menusEffectType->value(i_val); + cfg.get("Menus", "Speed", f_val, 1.5f); + menusSpeed->value(f_val); + cfg.get("Menus", "Delay", f_val, 0.2f); + menusDelay->value(f_val); + + + // Read Fl_Tooltip defaults: + cfg.get("Tooltips", "Effects", b_val, true); + tooltipsEnableEffects->value(b_val); + cfg.get("Tooltips", "Effect Type", i_val, 2); + tooltipsEffectType->value(i_val); + cfg.get("Tooltips", "Enabled", b_val, true); + tooltipsEnable->value(b_val); + cfg.get("Tooltips", "Delay", f_val, 1.0f); + tooltipsDelay->value(f_val); + + // Read Fl_MDI_Window defaults: + cfg.get("MDI", "Animate", b_val, true); + mdiAnimation->value(b_val); + cfg.get("MDI", "Opaque", b_val, false); + mdiOpaqueAnimation->value(b_val); + } +} + +void saveEfltkConfig() +{ + char *file = 0; + file = Config::find_file("efltk.conf", false, Config::USER); + if(!file) file = Config::find_file("efltk.conf", false, Config::SYSTEM); + + Config cfg(file, true, true); + if(!cfg.error()) + { + cfg.set("Images", "State Effects", imagesStateEffect->value()); + + cfg.set("Menus", "Effects", menusEnableEffects->value()); + cfg.set("Menus", "Subwindow Effect", menusEnableSubwindowEffects->value()); + cfg.set("Menus", "Effect Type", menusEffectType->value()); + cfg.set("Menus", "Speed", (float)menusSpeed->value()); + cfg.set("Menus", "Delay", (float)menusDelay->value()); + + cfg.set("Tooltips", "Effects", tooltipsEnableEffects->value()); + cfg.set("Tooltips", "Effect Type", tooltipsEffectType->value()); + cfg.set("Tooltips", "Enabled", tooltipsEnable->value()); + cfg.set("Tooltips", "Delay", (float)tooltipsDelay->value()); + + cfg.set("MDI", "Animate", mdiAnimation->value()); + cfg.set("MDI", "Opaque", mdiOpaqueAnimation->value()); + + // sendUpdateInfo(FLTKChangeSettings); + } +} + + +// FONT STUFF: +// returns nice name for a font +const char* font_nice_name(EDEFont font) { + if (!font.defined) + return "Unknown"; + + char nicename[PATH_MAX]; + snprintf (nicename, PATH_MAX, "%s (%d)", font.font->name(), font.size); + + // capitalize bold, italic +// nicename.sub_replace("bold","Bold"); +// nicename.sub_replace("italic","Italic"); + +// nicename = nicename + " ("; +// nicename = nicename + Fl_String(font.size); +// nicename = nicename + ")"; + + const char* n = strdup(nicename); + return n; +} + + +// callback for button to set label font +void labelfont_cb() { + EDEFont ret = font_chooser(labelfont); + + if (ret.defined) { + labelfont = ret; + labelFontInput->label(font_nice_name(labelfont)); + labelFontInput->redraw(); + } +} + + +// callback for button to set label font +void textfont_cb() { + EDEFont ret = font_chooser(textfont); + + if (ret.defined) { + textfont = ret; + textFontInput->label(font_nice_name(textfont)); + textFontInput->redraw(); + } +} diff --git a/ecolorconf/ecolorutils.h b/ecolorconf/ecolorutils.h new file mode 100644 index 0000000..20f7b99 --- /dev/null +++ b/ecolorconf/ecolorutils.h @@ -0,0 +1,71 @@ +// Colors settings for EDE +// Copyright (C) 2000-2002 Martin Pekar +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// This program 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 General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +#ifndef ecolorutils_h +#define ecolorutils_h + +/*#include +#include +#include +#include +#include */ +#include //#include +#include //#include +/*#include +#include +#include +#include +#include +#include +#include +#include +#include */ +#include //#include +//#include +//#include +#include //#include +//#include +#include //#include +//#include +#include "../edelib2/Config.h" //#include +#include "../edelib2/NLS.h" //#include + +// this struct can hold slightly more information than Fl_Font +typedef struct { + fltk::Font* font; + char* encoding; + int size; + bool defined; +} EDEFont; + + + +extern void updateFontAll(); +extern void getSchemeColors(); +extern void saveActiveScheme(); +extern void saveSchemeAs(); +extern void applyColors(); +extern void fillItems(); +extern void loadEfltkConfig(); +extern void saveEfltkConfig(); + +// font stuff +const char* font_nice_name(EDEFont); +extern void labelfont_cb(); +extern void textfont_cb(); + +#endif diff --git a/ecolorconf/edetheme.cpp b/ecolorconf/edetheme.cpp new file mode 100644 index 0000000..3f5634d --- /dev/null +++ b/ecolorconf/edetheme.cpp @@ -0,0 +1,315 @@ +// +// "$Id$" +// +// Startup, scheme and theme handling code for the Fast Light +// Tool Kit (FLTK). +// +// Copyright 1998-1999 by Bill Spitzak and others. +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Library General Public +// License as published by the Free Software Foundation; either +// version 2 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 +// Library General Public License for more details. +// +// You should have received a copy of the GNU Library General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 +// USA. +// +// + +// The "scheme" theme. This reads an earlier design for configuring fltk, +// a text-based "scheme" file, which described exactly what to put into +// the style structures for each widget class. We rejected this design +// because it was apparent that all interesting themes were completely +// defined by plugin code and thus the only part that was being used was +// the "themes" line from the file. + +// The scheme argument (set by Fl_Style::scheme() or by the -scheme +// switch when Fl::arg() is used) is used to choose the scheme file to +// read, by adding ".scheme" to the end. If not specified or null, +// "default" is used. There are some sample scheme files provided for +// your amusement, such as OldMotif.scheme. +// +// Modified for use with EDE by Martin Pekar 07/02/2002 + + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#ifndef _WIN32 +#include +#else +#include +#define access(a,b) _access(a,b) +#define R_OK 04 +#endif + +#ifndef PATH_MAX +#define PATH_MAX 128 +#endif + +static Fl_Color grok_color(FLE_Config* cf, const char *colstr) +{ + char *val=0; + const char *p = colstr; + val = cf->read_string("aliases", colstr); + if(val) p = val; + char* q; + long l = strtoul(p, &q, 0); + if(!*q) return (Fl_Color)l; + //if(val) delete []val; //LEAK!! + return fl_rgb(p); +} + +static Fl_Font grok_font(FLE_Config *cf, const char* fontstr) +{ + char *val; + const char *p = fontstr; + val = cf->read_string("aliases", fontstr); + if(val) p = val; + char* q; + long l = strtoul(p, &q, 0); + if(!*q) return fl_fonts+l; + //if(val) delete []val; //LEAK!! + return fl_find_font(p); +} + +//////////////////////////////////////////////////////////////// + +extern "C" +bool fltk_theme() +{ + char temp[PATH_MAX]; + /* const char* scheme = Fl_Style::scheme(); + if (!scheme || !*scheme) scheme = "default"; + + char temp[PATH_MAX]; + snprintf(temp, PATH_MAX, "%s.scheme", scheme); + char sfile_buf[PATH_MAX];*/ + const char* sfile = fle_find_config_file("schemes/Active.scheme", 0); + if (!sfile) { + fprintf(stderr, "Cannot find default scheme \"%s\"\n", sfile); + return false; + } + + static bool recurse=false; + if (recurse) { + fprintf(stderr, "%s recusively loaded scheme.theme\n", sfile); + return false; + } + + //conf_clear_cache(); + FLE_Config conf(sfile); + + //if (!::getconf(sfile, "general/themes", temp, sizeof(temp))) + char *themefile = conf.read_string("general", "themes"); + if(themefile && !conf.error()) + { + recurse = true; + Fl_Theme f = Fl_Style::load_theme(themefile); + if(f) f(); + else fprintf(stderr,"Unable to load %s theme\n", themefile); + recurse = false; + delete []themefile; + } + + char *valstr; + Fl_Color col; + + //if(!::getconf(sfile, "global colors/background", valstr, sizeof(valstr))) { + valstr = conf.read_string("global colors", "background"); + if(valstr && !conf.error()) { + col = grok_color(&conf, valstr); + fl_background(fl_get_color(col)); + delete []valstr; + } + + static struct { const char* key; Fl_Color col; } colors[] = { + { "DARK1", FL_DARK1 }, + { "DARK2", FL_DARK2 }, + { "DARK3", FL_DARK3 }, + { "LIGHT1", FL_LIGHT1 }, + { "LIGHT2", FL_LIGHT2 }, + { "LIGHT3", FL_LIGHT3 }, + { 0, 0 } + }; + + for (int i = 0; colors[i].key; i++) { + snprintf(temp, sizeof(temp)-1, "%s", colors[i].key); + //int res = ::getconf(sfile, temp, valstr, sizeof(valstr)); + valstr = conf.read_string("global colors", temp); + int res = conf.error(); + if(!res && valstr) { + col = grok_color(&conf, valstr); + fl_set_color(colors[i].col, col); + delete []valstr; + } + } + + //conf_list section_list = 0, key_list = 0; + //conf_entry* cent; + SectionList *section_list; + Section *cent=0; + + Fl_Font font; + Fl_Labeltype labeltype; + Fl_Boxtype boxtype; + + //if(!getconf_sections(sfile, "widgets", §ion_list)) + section_list = conf.section_list("widgets"); + if(section_list) + { + //for (cent = section_list; cent; cent = cent->next) + for(cent = section_list->first(); cent; cent=section_list->next()) + { + //Fl_Style* style = Fl_Style::find(cent->key); + Fl_Style* style = Fl_Style::find(cent->name); + if(!style) continue; + + conf.set_section(cent); + + // box around widget + //if(!getconf_list(key_list, "box", valstr, sizeof(valstr))) + if( (valstr=conf.read_string("box")) ) { + if ( (boxtype = Fl_Boxtype_::find(valstr)) ) style->box = boxtype; + delete []valstr; + } + + // box around buttons within widget + //if (!getconf_list(key_list, "button box", valstr, sizeof(valstr))) + if( (valstr=conf.read_string("button box")) ) { + if ( (boxtype = Fl_Boxtype_::find(valstr)) ) style->button_box = boxtype; + delete []valstr; + } + + // color of widget background + //if (!getconf_list(key_list, "color", valstr, sizeof(valstr))) + if( (valstr=conf.read_string("color")) ) { + style->color = grok_color(&conf, valstr); + delete []valstr; + } + + // color of widget's label + //if (!getconf_list(key_list, "label color", valstr, sizeof(valstr))) + if( (valstr=conf.read_string("label color")) ) { + style->label_color = grok_color(&conf, valstr); + delete []valstr; + } + + // color of widget's background when widget is selected + //if (!getconf_list(key_list, "selection color", valstr, sizeof(valstr))) + if( (valstr=conf.read_string("selection color" )) ) { + style->selection_color = grok_color(&conf, valstr); + delete []valstr; + } + + // color of widget's text when text selected + // color of widget's label when widget selected + // color of widget's glyph when widget selected and no glyph box + //if (!getconf_list(key_list, "selection text color", valstr, sizeof(valstr))) + if( (valstr=conf.read_string("selection text color")) ) { + style->selection_text_color = grok_color(&conf, valstr); + delete []valstr; + } + + // color of widget's background when widget is highlighted + //if (!getconf_list(key_list, "highlight color", valstr, sizeof(valstr))) + if( (valstr=conf.read_string("highlight color" ))) { + style->highlight_color = grok_color(&conf, valstr); + delete []valstr; + } + + // color of widget's label when widget highlighted + // color of widget's glyph/text when widget highlighted and no text/glyph box + //if (!getconf_list(key_list, "highlight label color", valstr, sizeof(valstr))) + if( (valstr=conf.read_string("highlight label color" ))) { + style->highlight_label_color = grok_color(&conf, valstr); + delete []valstr; + } + + // color of text/glyph within widget + //if (!getconf_list(key_list, "text color", valstr, sizeof(valstr))) + if( (valstr=conf.read_string("text color")) ) { + style->text_color = grok_color(&conf, valstr); + delete []valstr; + } + + // font used for widget's label + //if (!getconf_list(key_list, "label font", valstr, sizeof(valstr))) + if( (valstr=conf.read_string("label font")) ) { + if ( (font = grok_font(&conf, valstr)) ) style->label_font = font; + delete []valstr; + } + + // font used for text within widget + //if (!getconf_list(key_list, "text font", valstr, sizeof(valstr))) + if( (valstr=conf.read_string("text font" )) ) { + if ( (font = grok_font(&conf, valstr)) ) style->text_font = font; + delete []valstr; + } + + // type of widget's label + //if (!getconf_list(key_list, "label type", valstr, sizeof(valstr))) + if( (valstr=conf.read_string("label type" )) ) { + if ( (labeltype = Fl_Labeltype_::find(valstr)) ) style->label_type = labeltype; + delete []valstr; + } + + // font size of widget's label + //if (!getconf_list(key_list, "label size", valstr, sizeof(valstr))) + if( (valstr=conf.read_string("label size")) ) { + style->label_size = (int)strtol(valstr,0,0); + delete []valstr; + } + + // font size of text within widget + //if (!getconf_list(key_list, "text size", valstr, sizeof(valstr))) + if( (valstr=conf.read_string("text size")) ) { + style->text_size = (int)strtol(valstr,0,0); + delete []valstr; + } + + // leading + //if (!getconf_list(key_list, "leading", valstr, sizeof(valstr))) + if( (valstr=conf.read_string("leading")) ) { + style->leading = (int)strtol(valstr,0,0); + delete []valstr; + } + + // font encoding + //if (!getconf_list(key_list, "font encoding", valstr, sizeof(valstr))) + if( (valstr=conf.read_string("font encoding")) ) { + fl_encoding(valstr); + //delete []valstr; //LEAK?? + } + + //conf_list_free(&key_list); + } + //conf_list_free(§ion_list); + } + + return true; +} + +// +// End of "$Id$". +// diff --git a/ecolorconf/locale/hu.po b/ecolorconf/locale/hu.po new file mode 100644 index 0000000..23367f1 --- /dev/null +++ b/ecolorconf/locale/hu.po @@ -0,0 +1,208 @@ +msgid "" +msgstr "" +"Project-Id-Version: \n" +"POT-Creation-Date: \n" +"PO-Revision-Date: 2005-02-09 11:21+0100\n" +"Last-Translator: Nemeth Otto \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: ecolorconf.cpp:131 +msgid "Colors and fonts settings" +msgstr "Szín és font beállítások" + +#: ecolorconf.cpp:136 +msgid "Default colors" +msgstr "Színek" + +#: ecolorconf.cpp:138 +msgid "Color" +msgstr "Háttér szín" + +#: ecolorconf.cpp:143 +msgid "Label color" +msgstr "Felirat szín" + +#: ecolorconf.cpp:148 +msgid "Selection color" +msgstr "Kiválasztás háttere" + +#: ecolorconf.cpp:153 +msgid "Selection text color" +msgstr "Kiválasztott szöveg" + +#: ecolorconf.cpp:158 +msgid "Off color" +msgstr "Off szín" + +#: ecolorconf.cpp:163 +msgid "Highlight color" +msgstr "Kiemelés háttere" + +#: ecolorconf.cpp:168 +msgid "Highlight label color" +msgstr "Kiemelt szöveg" + +#: ecolorconf.cpp:173 +msgid "Text color" +msgstr "Szöveg szín" + +#: ecolorconf.cpp:178 +msgid "Background" +msgstr "Háttér" + +#: ecolorconf.cpp:183 +msgid "Text background" +msgstr "Szöveg háttér" + +#: ecolorconf.cpp:190 +msgid "Tooltips" +msgstr "Buborékok" + +#: ecolorconf.cpp:193 +msgid "Tooltip color" +msgstr "Buborékok színe" + +#: ecolorconf.cpp:198 +msgid "Tooltip text color" +msgstr "Buborék szövegszín" + +#: ecolorconf.cpp:203 +#: ecolorconf.cpp:252 +msgid "Enable effects" +msgstr "Effektek" + +#: ecolorconf.cpp:204 +msgid "Enabled" +msgstr "Engedélyez" + +#: ecolorconf.cpp:205 +#: ecolorconf.cpp:254 +msgid "Effect type:" +msgstr "Effekt típus:" + +#: ecolorconf.cpp:207 +#: ecolorconf.cpp:256 +msgid "None" +msgstr "Egyik sem" + +#: ecolorconf.cpp:208 +#: ecolorconf.cpp:257 +msgid "Animation" +msgstr "Animáció" + +#: ecolorconf.cpp:209 +#: ecolorconf.cpp:258 +msgid "Fading" +msgstr "Fokozatos" + +#: ecolorconf.cpp:212 +#: ecolorconf.cpp:262 +msgid "Delay:" +msgstr "Késleltetés:" + +#: ecolorconf.cpp:215 +msgid "Fonts" +msgstr "Betűtípusok" + +#: ecolorconf.cpp:218 +msgid "Label font:" +msgstr "Felirat font:" + +#: ecolorconf.cpp:226 +msgid "Text font:" +msgstr "Szöveg font:" + +#: ecolorconf.cpp:233 +msgid "Label size:" +msgstr "Felirat méret:" + +#: ecolorconf.cpp:236 +msgid "Text size:" +msgstr "Szöveg méret:" + +#: ecolorconf.cpp:239 +msgid "Encoding:" +msgstr "Kódolás:" + +#: ecolorconf.cpp:241 +#: ecolorconf.cpp:244 +msgid "..." +msgstr "..." + +#: ecolorconf.cpp:250 +msgid "Menus" +msgstr "Menük" + +#: ecolorconf.cpp:253 +msgid "Enable subwindow effects" +msgstr "Almenü effektek" + +#: ecolorconf.cpp:261 +msgid "Speed:" +msgstr "Sebesség:" + +#: ecolorconf.cpp:265 +msgid "Others" +msgstr "Egyéb" + +#: ecolorconf.cpp:267 +msgid "Enable MDI animation" +msgstr "MDI animáció engedélyezése" + +#: ecolorconf.cpp:268 +msgid "MDI opaque animation" +msgstr "MDI opaque animation" + +#: ecolorconf.cpp:269 +msgid "Enable images state effect" +msgstr "Képállapot váltás" + +#: ecolorconf.cpp:276 +msgid "&Save as..." +msgstr "Menté&s..." + +#: ecolorconf.cpp:279 +msgid "Ap&ply colors to all programs" +msgstr "Színbeállítások &alkalmazása az összes programra" + +#: ecolorconf.cpp:283 +msgid "Schemes:" +msgstr "Témák:" + +#: ecolorconf.cpp:293 +#: efontdialog.cpp:226 +msgid "&OK" +msgstr "&OK" + +#: ecolorconf.cpp:296 +msgid "&Apply" +msgstr "&Alkalmaz" + +#: ecolorconf.cpp:299 +#: efontdialog.cpp:229 +msgid "&Cancel" +msgstr "Mégs&em" + +#: ecolorconf.cpp:314 +msgid "Choose color" +msgstr "Szín kiválasztása" + +#: ecolorutils.cpp:306 +msgid "Color and label color are the same. Edit colors first." +msgstr "A szín és felirat szín ugyanaz. Szerkeszd először a színeket." + +#: ecolorutils.cpp:344 +msgid "Save scheme as:" +msgstr "Téma mentése:" + +#: ecolorutils.cpp:344 +msgid "New scheme" +msgstr "Új téma" + +#: efontdialog.cpp:200 +msgid "Select font..." +msgstr "Betűtípus kiválasztása..." + diff --git a/ecolorconf/locale/id.po b/ecolorconf/locale/id.po new file mode 100644 index 0000000..bd53597 --- /dev/null +++ b/ecolorconf/locale/id.po @@ -0,0 +1,203 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR Free Software Foundation, Inc. +# FIRST AUTHOR , YEAR. +# +msgid "" +msgstr "" +"Project-Id-Version: ecolorconf 1.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2005-02-04 12:37+0100\n" +"PO-Revision-Date: 202-11-29 13:31+0700\n" +"Last-Translator: Bambang Purnomosidi D. P. \n" +"Language-Team: id \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=iso-8859-2\n" +"Content-Transfer-Encoding: 8bit\n" + +#: ecolorconf.cpp:131 +msgid "Colors and fonts settings" +msgstr "Seting warna dan font" + +#: ecolorconf.cpp:136 +msgid "Default colors" +msgstr "Warna default" + +#: ecolorconf.cpp:138 +msgid "Color" +msgstr "Warna" + +#: ecolorconf.cpp:143 +msgid "Label color" +msgstr "Warna label" + +#: ecolorconf.cpp:148 +msgid "Selection color" +msgstr "Warna pilihan" + +#: ecolorconf.cpp:153 +msgid "Selection text color" +msgstr "Warna teks pilihan" + +#: ecolorconf.cpp:158 +msgid "Off color" +msgstr "Warna off" + +#: ecolorconf.cpp:163 +msgid "Highlight color" +msgstr "Warna sorot" + +#: ecolorconf.cpp:168 +msgid "Highlight label color" +msgstr "Warna label sorot" + +#: ecolorconf.cpp:173 +msgid "Text color" +msgstr "Warna teks" + +#: ecolorconf.cpp:178 +msgid "Background" +msgstr "Latar belakang" + +#: ecolorconf.cpp:183 +msgid "Text background" +msgstr "Teks latar belakang" + +#: ecolorconf.cpp:190 +msgid "Tooltips" +msgstr "Tooltip" + +#: ecolorconf.cpp:193 +msgid "Tooltip color" +msgstr "Warna tooltip" + +#: ecolorconf.cpp:198 +msgid "Tooltip text color" +msgstr "Warna teks tooltip" + +#: ecolorconf.cpp:203 ecolorconf.cpp:252 +msgid "Enable effects" +msgstr "Aktifkan efek" + +#: ecolorconf.cpp:204 +msgid "Enabled" +msgstr "Aktifkan" + +#: ecolorconf.cpp:205 ecolorconf.cpp:254 +msgid "Effect type:" +msgstr "Tipe efek:" + +#: ecolorconf.cpp:207 ecolorconf.cpp:256 +msgid "None" +msgstr "Tidak ada" + +#: ecolorconf.cpp:208 ecolorconf.cpp:257 +msgid "Animation" +msgstr "Animasi" + +#: ecolorconf.cpp:209 ecolorconf.cpp:258 +msgid "Fading" +msgstr "Fading" + +#: ecolorconf.cpp:212 ecolorconf.cpp:262 +msgid "Delay:" +msgstr "Tunda:" + +#: ecolorconf.cpp:215 +msgid "Fonts" +msgstr "Font" + +#: ecolorconf.cpp:218 +msgid "Label font:" +msgstr "Font label:" + +#: ecolorconf.cpp:226 +msgid "Text font:" +msgstr "Font teks:" + +#: ecolorconf.cpp:233 +msgid "Label size:" +msgstr "Ukuran label:" + +#: ecolorconf.cpp:236 +msgid "Text size:" +msgstr "Ukuran teks:" + +#: ecolorconf.cpp:239 +msgid "Encoding:" +msgstr "Pengkodean:" + +#: ecolorconf.cpp:241 ecolorconf.cpp:244 +msgid "..." +msgstr "" + +#: ecolorconf.cpp:250 +msgid "Menus" +msgstr "Menu" + +#: ecolorconf.cpp:253 +msgid "Enable subwindow effects" +msgstr "Aktifkan efek subwindow" + +#: ecolorconf.cpp:261 +msgid "Speed:" +msgstr "Kecepatan:" + +#: ecolorconf.cpp:265 +msgid "Others" +msgstr "Lainnya" + +#: ecolorconf.cpp:267 +msgid "Enable MDI animation" +msgstr "Aktifkan animasi MDI" + +#: ecolorconf.cpp:268 +msgid "MDI opaque animation" +msgstr "Animasi opaque MDI" + +#: ecolorconf.cpp:269 +msgid "Enable images state effect" +msgstr "Aktifkan efek keadaan citra" + +#: ecolorconf.cpp:276 +msgid "&Save as..." +msgstr "&Simpan sebagai..." + +#: ecolorconf.cpp:279 +msgid "Ap&ply colors to all programs" +msgstr "Berlakukan warna ke semua &program" + +#: ecolorconf.cpp:283 +msgid "Schemes:" +msgstr "Skema:" + +#: ecolorconf.cpp:293 efontdialog.cpp:226 +msgid "&OK" +msgstr "&OK" + +#: ecolorconf.cpp:296 +msgid "&Apply" +msgstr "Berl&akukan" + +#: ecolorconf.cpp:299 efontdialog.cpp:229 +msgid "&Cancel" +msgstr "&Batal" + +#: ecolorconf.cpp:314 +msgid "Choose color" +msgstr "Pilih warna" + +#: ecolorutils.cpp:306 +msgid "Color and label color are the same. Edit colors first." +msgstr "Warna dan warna label sama. Edit warna lebih dulu." + +#: ecolorutils.cpp:344 +msgid "Save scheme as:" +msgstr "Simpan skema sebagai:" + +#: ecolorutils.cpp:344 +msgid "New scheme" +msgstr "Skema baru" + +#: efontdialog.cpp:200 +msgid "Select font..." +msgstr "" diff --git a/ecolorconf/locale/messages.pot b/ecolorconf/locale/messages.pot new file mode 100644 index 0000000..e2a9176 --- /dev/null +++ b/ecolorconf/locale/messages.pot @@ -0,0 +1,205 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2005-02-04 12:37+0100\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=CHARSET\n" +"Content-Transfer-Encoding: 8bit\n" + +#: ecolorconf.cpp:131 +msgid "Colors and fonts settings" +msgstr "" + +#: ecolorconf.cpp:136 +msgid "Default colors" +msgstr "" + +#: ecolorconf.cpp:138 +msgid "Color" +msgstr "" + +#: ecolorconf.cpp:143 +msgid "Label color" +msgstr "" + +#: ecolorconf.cpp:148 +msgid "Selection color" +msgstr "" + +#: ecolorconf.cpp:153 +msgid "Selection text color" +msgstr "" + +#: ecolorconf.cpp:158 +msgid "Off color" +msgstr "" + +#: ecolorconf.cpp:163 +msgid "Highlight color" +msgstr "" + +#: ecolorconf.cpp:168 +msgid "Highlight label color" +msgstr "" + +#: ecolorconf.cpp:173 +msgid "Text color" +msgstr "" + +#: ecolorconf.cpp:178 +msgid "Background" +msgstr "" + +#: ecolorconf.cpp:183 +msgid "Text background" +msgstr "" + +#: ecolorconf.cpp:190 +msgid "Tooltips" +msgstr "" + +#: ecolorconf.cpp:193 +msgid "Tooltip color" +msgstr "" + +#: ecolorconf.cpp:198 +msgid "Tooltip text color" +msgstr "" + +#: ecolorconf.cpp:203 ecolorconf.cpp:252 +msgid "Enable effects" +msgstr "" + +#: ecolorconf.cpp:204 +msgid "Enabled" +msgstr "" + +#: ecolorconf.cpp:205 ecolorconf.cpp:254 +msgid "Effect type:" +msgstr "" + +#: ecolorconf.cpp:207 ecolorconf.cpp:256 +msgid "None" +msgstr "" + +#: ecolorconf.cpp:208 ecolorconf.cpp:257 +msgid "Animation" +msgstr "" + +#: ecolorconf.cpp:209 ecolorconf.cpp:258 +msgid "Fading" +msgstr "" + +#: ecolorconf.cpp:212 ecolorconf.cpp:262 +msgid "Delay:" +msgstr "" + +#: ecolorconf.cpp:215 +msgid "Fonts" +msgstr "" + +#: ecolorconf.cpp:218 +msgid "Label font:" +msgstr "" + +#: ecolorconf.cpp:226 +msgid "Text font:" +msgstr "" + +#: ecolorconf.cpp:233 +msgid "Label size:" +msgstr "" + +#: ecolorconf.cpp:236 +msgid "Text size:" +msgstr "" + +#: ecolorconf.cpp:239 +msgid "Encoding:" +msgstr "" + +#: ecolorconf.cpp:241 ecolorconf.cpp:244 +msgid "..." +msgstr "" + +#: ecolorconf.cpp:250 +msgid "Menus" +msgstr "" + +#: ecolorconf.cpp:253 +msgid "Enable subwindow effects" +msgstr "" + +#: ecolorconf.cpp:261 +msgid "Speed:" +msgstr "" + +#: ecolorconf.cpp:265 +msgid "Others" +msgstr "" + +#: ecolorconf.cpp:267 +msgid "Enable MDI animation" +msgstr "" + +#: ecolorconf.cpp:268 +msgid "MDI opaque animation" +msgstr "" + +#: ecolorconf.cpp:269 +msgid "Enable images state effect" +msgstr "" + +#: ecolorconf.cpp:276 +msgid "&Save as..." +msgstr "" + +#: ecolorconf.cpp:279 +msgid "Ap&ply colors to all programs" +msgstr "" + +#: ecolorconf.cpp:283 +msgid "Schemes:" +msgstr "" + +#: ecolorconf.cpp:293 efontdialog.cpp:226 +msgid "&OK" +msgstr "" + +#: ecolorconf.cpp:296 +msgid "&Apply" +msgstr "" + +#: ecolorconf.cpp:299 efontdialog.cpp:229 +msgid "&Cancel" +msgstr "" + +#: ecolorconf.cpp:314 +msgid "Choose color" +msgstr "" + +#: ecolorutils.cpp:306 +msgid "Color and label color are the same. Edit colors first." +msgstr "" + +#: ecolorutils.cpp:344 +msgid "Save scheme as:" +msgstr "" + +#: ecolorutils.cpp:344 +msgid "New scheme" +msgstr "" + +#: efontdialog.cpp:200 +msgid "Select font..." +msgstr "" diff --git a/ecolorconf/locale/ru.po b/ecolorconf/locale/ru.po new file mode 100644 index 0000000..15c12e9 --- /dev/null +++ b/ecolorconf/locale/ru.po @@ -0,0 +1,204 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR Free Software Foundation, Inc. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2005-02-04 12:37+0100\n" +"PO-Revision-Date: 2002-11-28 HO:MI+ZONE\n" +"Last-Translator: aabbvv \n" +"Language-Team: RUSSIAN \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=koi8-r\n" +"Content-Transfer-Encoding: 8bit\n" + +#: ecolorconf.cpp:131 +msgid "Colors and fonts settings" +msgstr " " + +#: ecolorconf.cpp:136 +msgid "Default colors" +msgstr "" + +#: ecolorconf.cpp:138 +msgid "Color" +msgstr "" + +#: ecolorconf.cpp:143 +msgid "Label color" +msgstr " " + +#: ecolorconf.cpp:148 +msgid "Selection color" +msgstr " " + +#: ecolorconf.cpp:153 +msgid "Selection text color" +msgstr " " + +#: ecolorconf.cpp:158 +msgid "Off color" +msgstr " " + +#: ecolorconf.cpp:163 +msgid "Highlight color" +msgstr "" + +#: ecolorconf.cpp:168 +msgid "Highlight label color" +msgstr " " + +#: ecolorconf.cpp:173 +msgid "Text color" +msgstr " " + +#: ecolorconf.cpp:178 +msgid "Background" +msgstr "" + +#: ecolorconf.cpp:183 +msgid "Text background" +msgstr " " + +#: ecolorconf.cpp:190 +msgid "Tooltips" +msgstr "" + +#: ecolorconf.cpp:193 +msgid "Tooltip color" +msgstr " " + +#: ecolorconf.cpp:198 +msgid "Tooltip text color" +msgstr " " + +#: ecolorconf.cpp:203 ecolorconf.cpp:252 +msgid "Enable effects" +msgstr " " + +#: ecolorconf.cpp:204 +msgid "Enabled" +msgstr "" + +#: ecolorconf.cpp:205 ecolorconf.cpp:254 +msgid "Effect type:" +msgstr " " + +#: ecolorconf.cpp:207 ecolorconf.cpp:256 +msgid "None" +msgstr "" + +#: ecolorconf.cpp:208 ecolorconf.cpp:257 +msgid "Animation" +msgstr "" + +#: ecolorconf.cpp:209 ecolorconf.cpp:258 +msgid "Fading" +msgstr "" + +#: ecolorconf.cpp:212 ecolorconf.cpp:262 +msgid "Delay:" +msgstr "" + +#: ecolorconf.cpp:215 +msgid "Fonts" +msgstr "" + +#: ecolorconf.cpp:218 +msgid "Label font:" +msgstr " :" + +#: ecolorconf.cpp:226 +msgid "Text font:" +msgstr " :" + +#: ecolorconf.cpp:233 +msgid "Label size:" +msgstr " :" + +#: ecolorconf.cpp:236 +msgid "Text size:" +msgstr " :" + +#: ecolorconf.cpp:239 +msgid "Encoding:" +msgstr ":" + +#: ecolorconf.cpp:241 ecolorconf.cpp:244 +msgid "..." +msgstr "" + +#: ecolorconf.cpp:250 +msgid "Menus" +msgstr "" + +#: ecolorconf.cpp:253 +msgid "Enable subwindow effects" +msgstr " -" + +#: ecolorconf.cpp:261 +msgid "Speed:" +msgstr ":" + +#: ecolorconf.cpp:265 +msgid "Others" +msgstr "" + +#: ecolorconf.cpp:267 +msgid "Enable MDI animation" +msgstr " -" + +#: ecolorconf.cpp:268 +msgid "MDI opaque animation" +msgstr " -" + +#: ecolorconf.cpp:269 +msgid "Enable images state effect" +msgstr " " + +#: ecolorconf.cpp:276 +msgid "&Save as..." +msgstr "..." + +#: ecolorconf.cpp:279 +msgid "Ap&ply colors to all programs" +msgstr " " + +#: ecolorconf.cpp:283 +msgid "Schemes:" +msgstr ":" + +#: ecolorconf.cpp:293 efontdialog.cpp:226 +msgid "&OK" +msgstr "&OK" + +#: ecolorconf.cpp:296 +msgid "&Apply" +msgstr "" + +#: ecolorconf.cpp:299 efontdialog.cpp:229 +msgid "&Cancel" +msgstr "" + +#: ecolorconf.cpp:314 +msgid "Choose color" +msgstr " " + +#: ecolorutils.cpp:306 +msgid "Color and label color are the same. Edit colors first." +msgstr " , " + +#: ecolorutils.cpp:344 +msgid "Save scheme as:" +msgstr " :" + +#: ecolorutils.cpp:344 +msgid "New scheme" +msgstr " " + +#: efontdialog.cpp:200 +msgid "Select font..." +msgstr "" diff --git a/ecolorconf/locale/sk.po b/ecolorconf/locale/sk.po new file mode 100644 index 0000000..15d8d83 --- /dev/null +++ b/ecolorconf/locale/sk.po @@ -0,0 +1,212 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR Free Software Foundation, Inc. +# FIRST AUTHOR , YEAR. +# +msgid "" +msgstr "" +"Project-Id-Version: ecolorconf 1.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2005-02-04 12:37+0100\n" +"PO-Revision-Date: 2002-04-21 14:50+0200\n" +"Last-Translator: Martin Pekar \n" +"Language-Team: Slovak \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: ecolorconf.cpp:131 +msgid "Colors and fonts settings" +msgstr "Nastavenie farieb a písiem" + +#: ecolorconf.cpp:136 +msgid "Default colors" +msgstr "Základné farby" + +#: ecolorconf.cpp:138 +msgid "Color" +msgstr "Farba" + +#: ecolorconf.cpp:143 +msgid "Label color" +msgstr "Farba menovky" + +#: ecolorconf.cpp:148 +msgid "Selection color" +msgstr "Farby výberu" + +#: ecolorconf.cpp:153 +msgid "Selection text color" +msgstr "Farba textu vo výbere" + +#: ecolorconf.cpp:158 +msgid "Off color" +msgstr "Farba vypnutia" + +#: ecolorconf.cpp:163 +msgid "Highlight color" +msgstr "Farba zvýraznenia" + +#: ecolorconf.cpp:168 +msgid "Highlight label color" +msgstr "Farba textu vo zvýraznení" + +#: ecolorconf.cpp:173 +msgid "Text color" +msgstr "Farba textu" + +#: ecolorconf.cpp:178 +msgid "Background" +msgstr "Pozadie" + +#: ecolorconf.cpp:183 +msgid "Text background" +msgstr "Farba pozadia textu" + +#: ecolorconf.cpp:190 +msgid "Tooltips" +msgstr "Bublinky" + +#: ecolorconf.cpp:193 +msgid "Tooltip color" +msgstr "Farba bublinky" + +#: ecolorconf.cpp:198 +msgid "Tooltip text color" +msgstr "Farba textu v bublinke" + +#: ecolorconf.cpp:203 ecolorconf.cpp:252 +msgid "Enable effects" +msgstr "Povoliť efekty" + +#: ecolorconf.cpp:204 +msgid "Enabled" +msgstr "Povolené" + +#: ecolorconf.cpp:205 ecolorconf.cpp:254 +msgid "Effect type:" +msgstr "Typ efektu:" + +#: ecolorconf.cpp:207 ecolorconf.cpp:256 +msgid "None" +msgstr "Žiadny" + +#: ecolorconf.cpp:208 ecolorconf.cpp:257 +msgid "Animation" +msgstr "Animácia" + +#: ecolorconf.cpp:209 ecolorconf.cpp:258 +msgid "Fading" +msgstr "Blednutie" + +#: ecolorconf.cpp:212 ecolorconf.cpp:262 +msgid "Delay:" +msgstr "Oneskorenie:" + +#: ecolorconf.cpp:215 +msgid "Fonts" +msgstr "Písma" + +#: ecolorconf.cpp:218 +msgid "Label font:" +msgstr "Písmo menovky:" + +#: ecolorconf.cpp:226 +msgid "Text font:" +msgstr "Písmo textu:" + +#: ecolorconf.cpp:233 +msgid "Label size:" +msgstr "Veľkosť menovky:" + +#: ecolorconf.cpp:236 +msgid "Text size:" +msgstr "Veľkosť textu" + +#: ecolorconf.cpp:239 +msgid "Encoding:" +msgstr "Kódovanie:" + +#: ecolorconf.cpp:241 ecolorconf.cpp:244 +msgid "..." +msgstr "" + +#: ecolorconf.cpp:250 +msgid "Menus" +msgstr "Ponuky" + +#: ecolorconf.cpp:253 +msgid "Enable subwindow effects" +msgstr "Použiť efekty na podokná" + +#: ecolorconf.cpp:261 +msgid "Speed:" +msgstr "Rýchlosť:" + +#: ecolorconf.cpp:265 +msgid "Others" +msgstr "Ostatné" + +#: ecolorconf.cpp:267 +msgid "Enable MDI animation" +msgstr "Povoliť MDI animáciu" + +#: ecolorconf.cpp:268 +msgid "MDI opaque animation" +msgstr "Obrysová animácia MDI" + +#: ecolorconf.cpp:269 +msgid "Enable images state effect" +msgstr "Použiť stavový efekt obrázkov" + +#: ecolorconf.cpp:276 +msgid "&Save as..." +msgstr "&Uložiť ako..." + +#: ecolorconf.cpp:279 +msgid "Ap&ply colors to all programs" +msgstr "Pou&žiť farby pre všetky programy" + +#: ecolorconf.cpp:283 +msgid "Schemes:" +msgstr "Schémy:" + +#: ecolorconf.cpp:293 efontdialog.cpp:226 +msgid "&OK" +msgstr "&OK" + +#: ecolorconf.cpp:296 +msgid "&Apply" +msgstr "&Použiť" + +#: ecolorconf.cpp:299 efontdialog.cpp:229 +msgid "&Cancel" +msgstr "&Zrušiť" + +#: ecolorconf.cpp:314 +msgid "Choose color" +msgstr "Zvoľte farbu" + +#: ecolorutils.cpp:306 +msgid "Color and label color are the same. Edit colors first." +msgstr "" + +#: ecolorutils.cpp:344 +msgid "Save scheme as:" +msgstr "Uložiť schému ako:" + +#: ecolorutils.cpp:344 +msgid "New scheme" +msgstr "Nová schéma" + +#: efontdialog.cpp:200 +msgid "Select font..." +msgstr "" + +#~ msgid "Saves active scheme under new name." +#~ msgstr "Uloží aktívnu schému pod novým menom." + +#~ msgid "Colors will be applied for all programs." +#~ msgstr "Farby budú aplikované na všetky programy." + +#~ msgid "These schemes are available." +#~ msgstr "Tieto schémy sú dostupné." diff --git a/ecolorconf/locale/sr.po b/ecolorconf/locale/sr.po new file mode 100644 index 0000000..3d22aa6 --- /dev/null +++ b/ecolorconf/locale/sr.po @@ -0,0 +1,203 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR Free Software Foundation, Inc. +# FIRST AUTHOR , YEAR. +# +msgid "" +msgstr "" +"Project-Id-Version: ECOLORCONF 1.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2005-02-04 12:37+0100\n" +"PO-Revision-Date: 2002-11-27 04:15+0100\n" +"Last-Translator: Dejan Lekic \n" +"Language-Team: LINUKS.org T.T. \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: ecolorconf.cpp:131 +msgid "Colors and fonts settings" +msgstr "Подешавање боја и фонтова" + +#: ecolorconf.cpp:136 +msgid "Default colors" +msgstr "Дифолт боје" + +#: ecolorconf.cpp:138 +msgid "Color" +msgstr "Боја" + +#: ecolorconf.cpp:143 +msgid "Label color" +msgstr "Боја наслова" + +#: ecolorconf.cpp:148 +msgid "Selection color" +msgstr "Боја селекције" + +#: ecolorconf.cpp:153 +msgid "Selection text color" +msgstr "Боја селектованог текста" + +#: ecolorconf.cpp:158 +msgid "Off color" +msgstr "Без боје" + +#: ecolorconf.cpp:163 +msgid "Highlight color" +msgstr "Боја означења" + +#: ecolorconf.cpp:168 +msgid "Highlight label color" +msgstr "Боја означеног текста" + +#: ecolorconf.cpp:173 +msgid "Text color" +msgstr "Боја текста" + +#: ecolorconf.cpp:178 +msgid "Background" +msgstr "Позадина" + +#: ecolorconf.cpp:183 +msgid "Text background" +msgstr "Позадина текста" + +#: ecolorconf.cpp:190 +msgid "Tooltips" +msgstr "Тултипси" + +#: ecolorconf.cpp:193 +msgid "Tooltip color" +msgstr "Боја тултипса" + +#: ecolorconf.cpp:198 +msgid "Tooltip text color" +msgstr "Боја текста тултипса" + +#: ecolorconf.cpp:203 ecolorconf.cpp:252 +msgid "Enable effects" +msgstr "Укључи ефекте" + +#: ecolorconf.cpp:204 +msgid "Enabled" +msgstr "Омогућен" + +#: ecolorconf.cpp:205 ecolorconf.cpp:254 +msgid "Effect type:" +msgstr "Тип ефекта:" + +#: ecolorconf.cpp:207 ecolorconf.cpp:256 +msgid "None" +msgstr "Никакав" + +#: ecolorconf.cpp:208 ecolorconf.cpp:257 +msgid "Animation" +msgstr "Анимација" + +#: ecolorconf.cpp:209 ecolorconf.cpp:258 +msgid "Fading" +msgstr "Фејдинг" + +#: ecolorconf.cpp:212 ecolorconf.cpp:262 +msgid "Delay:" +msgstr "Пауза:" + +#: ecolorconf.cpp:215 +msgid "Fonts" +msgstr "Фонтови" + +#: ecolorconf.cpp:218 +msgid "Label font:" +msgstr "Фонт наслова:" + +#: ecolorconf.cpp:226 +msgid "Text font:" +msgstr "Фонт текста:" + +#: ecolorconf.cpp:233 +msgid "Label size:" +msgstr "Величина наслова:" + +#: ecolorconf.cpp:236 +msgid "Text size:" +msgstr "Величина текста:" + +#: ecolorconf.cpp:239 +msgid "Encoding:" +msgstr "Енкодинг:" + +#: ecolorconf.cpp:241 ecolorconf.cpp:244 +msgid "..." +msgstr "" + +#: ecolorconf.cpp:250 +msgid "Menus" +msgstr "Менији" + +#: ecolorconf.cpp:253 +msgid "Enable subwindow effects" +msgstr "Укључи сабвиндов ефекте" + +#: ecolorconf.cpp:261 +msgid "Speed:" +msgstr "Брзина:" + +#: ecolorconf.cpp:265 +msgid "Others" +msgstr "Остали" + +#: ecolorconf.cpp:267 +msgid "Enable MDI animation" +msgstr "Укључи МДИ анимације" + +#: ecolorconf.cpp:268 +msgid "MDI opaque animation" +msgstr "МДИ провидна анимација" + +#: ecolorconf.cpp:269 +msgid "Enable images state effect" +msgstr "Укључи ефекат статичне слике" + +#: ecolorconf.cpp:276 +msgid "&Save as..." +msgstr "&Сними као..." + +#: ecolorconf.cpp:279 +msgid "Ap&ply colors to all programs" +msgstr "П&римени боје на све програме" + +#: ecolorconf.cpp:283 +msgid "Schemes:" +msgstr "Шеме:" + +#: ecolorconf.cpp:293 efontdialog.cpp:226 +msgid "&OK" +msgstr "&ОК" + +#: ecolorconf.cpp:296 +msgid "&Apply" +msgstr "&Примени" + +#: ecolorconf.cpp:299 efontdialog.cpp:229 +msgid "&Cancel" +msgstr "&Одустани" + +#: ecolorconf.cpp:314 +msgid "Choose color" +msgstr "Изабери боју" + +#: ecolorutils.cpp:306 +msgid "Color and label color are the same. Edit colors first." +msgstr "Боја и боја наслова су исте. Прво измените боје." + +#: ecolorutils.cpp:344 +msgid "Save scheme as:" +msgstr "Сними шему као:" + +#: ecolorutils.cpp:344 +msgid "New scheme" +msgstr "Нова шема" + +#: efontdialog.cpp:200 +msgid "Select font..." +msgstr "" diff --git a/econtrol/econtrol.conf b/econtrol/econtrol.conf new file mode 100644 index 0000000..171caba --- /dev/null +++ b/econtrol/econtrol.conf @@ -0,0 +1,71 @@ +# +# This is a default data for control panel. +# +# You can change them, and howto for this +# you can find in econtrol documentation. + + +# This is the main key, and must be present if +# you want to control panel read it +[Control Panel] + Position = true + X = 2 + Y = 3 + Width = 58 + Height = 34 + # reads econtrol.conf from user home, appending + # values to this one + ReadUserConf = true + + # main items + Items = edewmconf,ekeyconf,esvrconf,einstall,evolume, edatetime,etipconf + +[edewmconf] + Name = Window manager + Tip = This item will run window manager configuration + Exec = ewmconf + Icon = preferences-system-windows + IconPathAbsolute = false + +[ekeyconf] + Name = Keyboard configuration + Tip = This item will run keyboard configuration + Exec = konqueror + #Icon = preferences-desktop-font + Icon = accessories-character-map + IconPathAbsolute = false + +[esvrconf] + Name = Screensaver configuration + Tip = This item will configure screensaver + Exec = esvrconf + Icon = preferences-desktop-screensaver + IconPathAbsolute = false + +[einstall] + Name = Install new software + Tip = This item will run installer + Exec = einstall + Icon = system-installer + IconPathAbsolute = false + +[evolume] + Name = Sound preferences + Tip = This item will set sound preferences + Exec = evolume + Icon = multimedia-volume-control + IconPathAbsolute = false + +[edatetime] + Name = Date and time + Tip = This item will configure date and time + Exec = edatetime + Icon = preferences-date-time + IconPathAbsolute = false + +[etipconf] + Name = Tips + Tip = This item will configure tips + Exec = etipconf + Icon = preferences-user-information + IconPathAbsolute = false diff --git a/econtrol/econtrol.cpp b/econtrol/econtrol.cpp new file mode 100644 index 0000000..0283606 --- /dev/null +++ b/econtrol/econtrol.cpp @@ -0,0 +1,162 @@ + +#include "econtrol.h" + +#include +#include +#include +#include + +#include +#include +#include + +using namespace edelib; + +ControlButton::ControlButton(Fl_Box* t, String tv, int x, int y, int w, int h, const char* l) : +Fl_Button(x, y, w, h, l) { + tip = t; + tipval = tv; + box(FL_FLAT_BOX); + align(FL_ALIGN_WRAP); + color(FL_WHITE); +} + +ControlButton::~ControlButton() { +} + +int ControlButton::handle(int event) { + switch(event) { + case FL_ENTER: + tip->label(tipval.c_str()); + return 1; + case FL_LEAVE: + tip->label(""); + return 1; + case FL_PUSH: + return 1; + case FL_RELEASE: + return 1; + default: + return Fl_Button::handle(event); + } + return Fl_Button::handle(event); +} + +void close_cb(Fl_Widget*, void* w) { + ControlWin* cw = (ControlWin*)w; + cw->do_close(); +} + +ControlWin::ControlWin(const char* title, int w, int h) : Fl_Window(w, h, title) { + + IconTheme::init("edeneu"); + + fl_register_images(); + load_icons(); + init(); +} + +ControlWin::~ControlWin() { + IconTheme::shutdown(); +} + +void ControlWin::load_icons(void) { + Config c; + + if(!c.load("econtrol.conf")) { + EWARNING("Can't load config\n"); + return; + } + + char buff[1024]; + if(!c.get("Control Panel", "Items", buff, sizeof(buff))) { + EWARNING("Can't find Items key\n"); + return; + } + + vector spl; + stringtok(spl, buff, ","); + char* sect; + + ControlIcon cicon; + for(unsigned int i = 0; i < spl.size(); i++) { + sect = (char*)spl[i].c_str(); + str_trim(sect); + + if(c.get(sect, "Name", buff, sizeof(buff))) + cicon.name = buff; + else { + EWARNING("No %s, skipping...\n", spl[i].c_str()); + continue; + } + + if(c.get(sect, "Tip", buff, sizeof(buff))) + cicon.tip = buff; + if(c.get(sect, "Exec", buff, sizeof(buff))) + cicon.exec = buff; + if(c.get(sect, "Icon", buff, sizeof(buff))) { + cicon.icon = buff; + EDEBUG("setting icon (%s): %s\n", spl[i].c_str(), cicon.icon.c_str()); + } + + c.get(spl[i].c_str(), "IconPathAbsolute", cicon.abspath, false); + c.get(spl[i].c_str(), "Position", cicon.abspath, -1); + + iconlist.push_back(cicon); + } +} + +void ControlWin::init(void) { + begin(); + titlegrp = new Fl_Group(0, 0, 455, 50); + titlegrp->box(FL_FLAT_BOX); + titlegrp->color(138); + titlegrp->begin(); + title = new Fl_Box(10, 10, 435, 30, label()); + title->color(138); + title->align(FL_ALIGN_LEFT|FL_ALIGN_INSIDE); + title->labelcolor(23); + title->labelfont(FL_HELVETICA_BOLD); + title->labelsize(16); + titlegrp->end(); + titlegrp->resizable(title); + + icons = new ExpandableGroup(10, 60, 435, 225); + icons->box(FL_DOWN_BOX); + icons->color(FL_BACKGROUND2_COLOR); + icons->end(); + + tipbox = new Fl_Box(10, 295, 240, 25, _("Double click on desired item")); + tipbox->box(FL_FLAT_BOX); + tipbox->align(FL_ALIGN_LEFT|FL_ALIGN_INSIDE|FL_ALIGN_CLIP); + + for(unsigned int i = 0; i < iconlist.size(); i++) { + ControlButton* b = new ControlButton(tipbox, iconlist[i].tip, 0, 0, 80, 100); + //String iconpath = IconTheme::get(iconlist[i].icon.c_str(), ICON_SIZE_MEDIUM); + String iconpath = IconTheme::get(iconlist[i].icon.c_str(), ICON_SIZE_LARGE); + b->label(iconlist[i].name.c_str()); + + if(!iconpath.empty()) + b->image(Fl_Shared_Image::get(iconpath.c_str())); + icons->add(b); + } + + //options = new Fl_Button(260, 295, 90, 25, _("&Options")); + close = new Fl_Button(355, 295, 90, 25, _("&Close")); + close->callback(close_cb, this); + + // resizable invisible box + rbox = new Fl_Box(10, 220, 120, 65); + resizable(rbox); + end(); +} + +void ControlWin::do_close(void) { + hide(); +} + +int main() { + ControlWin cw(_("EDE Control Panel")); + cw.show(); + return Fl::run(); +} diff --git a/econtrol/econtrol.fl b/econtrol/econtrol.fl new file mode 100644 index 0000000..ab68e90 --- /dev/null +++ b/econtrol/econtrol.fl @@ -0,0 +1,38 @@ +# data file for the Fltk User Interface Designer (fluid) +version 1.0108 +header_name {.h} +code_name {.cxx} +Function {} {open +} { + Fl_Window {} {open + xywh {392 251 455 330} type Double resizable visible + } { + Fl_Group {} {open + xywh {0 0 455 50} box FLAT_BOX color 138 + } { + Fl_Box {} { + label {EDE Control Panel} + xywh {10 10 435 30} box FLAT_BOX color 138 labelfont 1 labelsize 16 labelcolor 23 align 20 resizable + } + } + Fl_Button {} { + label {&Close} + xywh {355 295 90 25} + } + Fl_Button {} { + label {&Options} + xywh {260 295 90 25} + } + Fl_Box {} { + label {This is some label } + xywh {10 295 240 25} box FLAT_BOX align 84 + } + Fl_Box {} { + xywh {10 60 435 225} box DOWN_BOX color 7 + } + Fl_Box {} {selected + xywh {10 220 120 65} resizable + code0 {/* invisible resizable box */} + } + } +} diff --git a/econtrol/econtrol.h b/econtrol/econtrol.h new file mode 100644 index 0000000..a3be9b1 --- /dev/null +++ b/econtrol/econtrol.h @@ -0,0 +1,53 @@ +#ifndef __ECONTROL_H__ +#define __ECONTROL_H__ + +#include +#include +#include +#include + +#include +#include + +struct ControlIcon { + edelib::String name; + edelib::String tip; + edelib::String exec; + edelib::String icon; + bool abspath; + int pos; +}; + +class ControlButton : public Fl_Button { + private: + Fl_Box* tip; + edelib::String tipval; + public: + ControlButton(Fl_Box* t, edelib::String tv, int x, int y, int w, int h, const char* l = 0); + ~ControlButton(); + int handle(int event); +}; + +class ControlWin : public Fl_Window { + private: + Fl_Group* titlegrp; + Fl_Box* title; + Fl_Button* close; + //Fl_Button* options; + edelib::ExpandableGroup* icons; + Fl_Box* rbox; + Fl_Box* tipbox; + + edelib::vector iconlist; + + void init(void); + void load_icons(void); + + public: + ControlWin(const char* title, int w = 455, int h = 330); + ~ControlWin(); + void do_close(void); +}; + + +#endif diff --git a/edeconf.h.in b/edeconf.h.in new file mode 100644 index 0000000..bc5b9ec --- /dev/null +++ b/edeconf.h.in @@ -0,0 +1,82 @@ +/* edeconf.h.in. Generated from configure.in by autoheader. */ + +/* Define 1 if you want native language support */ +#undef ENABLE_NLS + +/* Define to 1 if you have the header file, and it defines `DIR'. + */ +#undef HAVE_DIRENT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_INTTYPES_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_MEMORY_H + +/* Define to 1 if you have the header file, and it defines `DIR'. */ +#undef HAVE_NDIR_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDINT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDLIB_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRINGS_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRING_H + +/* Define to 1 if you have the header file, and it defines `DIR'. + */ +#undef HAVE_SYS_DIR_H + +/* Define to 1 if you have the header file, and it defines `DIR'. + */ +#undef HAVE_SYS_NDIR_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_STAT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_TYPES_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_UNISTD_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_ALSA + +/* Define to 1 if you have the header file and it defines stime() function. */ +#undef HAVE_STIME + +/* Define 1 if XWindows has Xutf extension. */ +#undef HAVE_X11_UTF_TEXT_PROP + +/* Define to the address where bug reports for this package should be sent. */ +#undef PACKAGE_BUGREPORT + +/* Define to the full name of this package. */ +#undef PACKAGE_NAME + +/* Define to the full name and version of this package. */ +#undef PACKAGE_STRING + +/* Define to the one symbol short name of this package. */ +#undef PACKAGE_TARNAME + +/* Define to the version of this package. */ +#undef PACKAGE_VERSION + +/* Default installation place. Overwrite if you like */ +#undef PREFIX + +/* Define to 1 if you have the ANSI C header files. */ +#undef STDC_HEADERS + +/* Short version number */ +#undef VERSION + +/* Define to 1 if the X Window System is missing or not being used. */ +#undef X_DISPLAY_MISSING diff --git a/edelib2/Config.cpp b/edelib2/Config.cpp new file mode 100644 index 0000000..fc5dfdd --- /dev/null +++ b/edelib2/Config.cpp @@ -0,0 +1,889 @@ +/* + * $Id$ + * + * edelib::Config - library for configuration management + * Part of Equinox Desktop Environment (EDE). + * Copyright (c) 2000-2006 EDE Authors. + * + * This program is licenced under terms of the + * GNU General Public Licence version 2 or newer. + * See COPYING for details. + */ + +/*#include "fl_internal.h" + +#include +#include +#include +#include +#include +#include */ + +#include "Config.h" +#include + +#include "NLS.h" +#include "../edeconf.h" +#include "Util.h" + +/*#include +#include */ + +#include +/*#include +#include */ +#include + +/*#ifdef _WIN32_WCE +#include +#endif +//#include + +#ifdef _WIN32 + +# include +# include +# include +# define access(a,b) _access(a,b) +# define mkdir(a,b) _mkdir(a) +# define R_OK 4 + +#else + +# include + +#endif *//* _WIN32 */ + + +#define LOCALE_TO_C() \ + char *locale = setlocale(LC_ALL, ""); \ + char *restore_locale = locale ? strdup(locale) : strdup("C"); \ + setlocale(LC_ALL, "C") + +#define RESTORE_LOCALE() \ + setlocale(LC_ALL, restore_locale); \ + free(restore_locale) + +// From Enumerations.h +#ifdef _WIN32 +# undef slash +# define slash '\\' +#else +# undef slash +# define slash '/' +#endif +// End Enumerations.h + +using namespace fltk; +using namespace edelib; + + + +// GLOBAL NOTE: asprintf() is a GNU extension - if it's unsupported on some +// platforms, use our tasprintf() instead (in Util.h) + + + + + + +// vec_from_string() - similar to explode() in PHP or split() in Perl +// adapted from Fl_String_List to use vector +std::vector vec_from_string(const char *str, const char *separator) +{ + if(!str) return std::vector (); + + uint separator_len = strlen(separator); + const char *ptr = str; + const char *s = strstr(ptr, separator); + std::vector retval; + if(s) { + do { + uint len = s - ptr; + if (len) { + retval.push_back(strndup(ptr,len)); + } else { + retval.push_back(NULL); + } + + ptr = s + separator_len; + s = strstr(ptr, separator); + } + while(s); + + if(*ptr) { + retval.push_back(strdup(ptr)); + } + } else { + retval.push_back(strdup(ptr)); + } + return retval; +} + + +// Get filename with full path of config file +// TODO: mergeing of system and user config +char* Config::find_file(const char *filename, bool create, int mode) +{ + static char path[PATH_MAX]; + + if(is_path_rooted(filename)) { + strncpy(path, filename, PATH_MAX); + return (create || !access(path, R_OK)) ? path : 0; + } + if(mode==USER) { + const char *cptr = getenv("HOME"); + char *ret=0; + if(cptr) { + snprintf(path, PATH_MAX-1, "%s%c%s%c%s", cptr, slash, ".ede", slash, filename); + if(create || !access(path, R_OK)) { + ret = path; + } + return ret; + } + return 0; + } else { + snprintf(path, sizeof(path)-1, "%s%c%s", get_sys_dir(), slash, filename); + return (create || !access(path, R_OK)) ? path : 0; + } +} + + + +////////////////////////////////////////////////////////////////////// +// Construction/Destruction +////////////////////////////////////////////////////////////////////// + +#define S(item) ((Config_Section*)item) + +Config::Config(const char *vendor, const char *application, int mode) +: Config_Section("","",0) +{ + m_vendor=m_app=m_filename=NULL; + m_cur_sec = 0; + m_changed=false; + m_error = 0; + + if(vendor) m_vendor = strdup(vendor); + if(application) m_app = strdup(application); + + if(strlen(m_app) > 0) + { + const char *file=0; + char tmp[PATH_MAX]; +#ifdef _WIN32 + if(mode==SYSTEM) + snprintf(tmp, sizeof(tmp)-1, "%s%c%s.conf", m_app, slash, m_app); + else +#endif + snprintf(tmp, sizeof(tmp)-1, "apps%c%s%c%s.conf", slash, m_app, slash, m_app); + file = find_file(tmp, true, mode); + if(file) + { + bool ret = make_path_for_file(file); + if(ret) + { + m_filename = strdup(file); + read_file(true); + } else + m_error = CONF_ERR_FILE; + } else + m_error = CONF_ERR_FILE; + } else + m_error = CONF_ERR_FILE; +} + +Config::Config(const char *filename, bool read, bool create) +: Config_Section("","",0) +{ + m_vendor=m_app=m_filename=NULL; + + if(filename) m_filename = strdup(filename); else m_filename = strdup(""); +// TODO: shouldn't we just return false if there's no filename?? +// use case: creating a new file (nonexistant) + + m_error = 0; + m_cur_sec = 0; + m_changed=false; + + if(create && strlen(m_filename)>0) { + make_path_for_file(m_filename); + } + + if(read) read_file(create); +} + +Config::~Config() +{ + flush(); + clear(); + if(m_filename) free(m_filename); + if(m_vendor) free(m_vendor); + if(m_app) free(m_app); +} + +/* get error string associated with error number */ +const char *Config::strerror(int error) +{ + switch(error) + { + case CONF_SUCCESS: return _("Successful operation"); + case CONF_ERR_FILE: return _("Could not access config file"); + case CONF_ERR_SECTION: return _("Config file section not found"); + case CONF_ERR_KEY: return _("Key not found in section"); + case CONF_ERR_MEMORY: return _("Could not allocate memory"); + case CONF_ERR_NOVALUE: return _("Invalid value associated with key"); + default: return _("Unknown error"); + } +} + +bool Config::read_file(bool create) +{ + bool error = false; + if(m_filename && strlen(m_filename)<1) { + m_error = CONF_ERR_FILE; + return false; + } + + if(create && !(access(m_filename, F_OK)==0)) { + FILE *f = fopen(m_filename, "w+"); + if(f) { + fputs(" ", f); + fclose(f); + } else error=true; + } + + if(error) { + m_error = CONF_ERR_FILE; + return false; + } + + // If somebody calls this function two times, we + // need to clean earlier section list... + clear(); + + ///// + struct stat fileStat; + stat(m_filename, &fileStat); + uint size = fileStat.st_size; + if(size == 0) { + m_error = 0; + return true; + } + + FILE *fp = fopen(m_filename, "r"); + if(!fp) { + //fprintf(stderr, "fp == 0: %s\n", m_filename); + m_error = CONF_ERR_FILE; + return false; + } + + uint bsize = size*sizeof(char); + char *buffer = (char*)malloc(bsize+1); + buffer[bsize] = 0; + if(!buffer) { + m_error = CONF_ERR_MEMORY; + return false; + } + + uint readed = fread(buffer, 1, size, fp); + if(readed <= 0) { + free((char*)buffer); + fclose(fp); + m_error = CONF_ERR_FILE; + return false; + } + fclose(fp); + + /* old parser + String_List strings(buffer, "\n"); + + free((char*)buffer); + + Config_Section *section = this; + for(uint n=0; n=0) { + line = strings[n].sub_str(comment_pos, strings[n].length()-comment_pos).trim(); + } else { + line = strings[n].trim(); + } + + if(line[0] == '[') + { + int pos = line.pos(']'); + if(pos>=0) + { + String sec(line.sub_str(1, pos-1)); + section = create_section(sec); + } + } + else if(line[0] != '#') + { + int pos = line.pos('='); + if(pos==-1) pos = line.pos(':'); + if(pos>=0) { + String key(line.sub_str(0, pos)); + pos++; + String value(line.sub_str(pos, line.length()-pos)); + section->add_entry(key, value); + } + } + } + */ + + // new parser by Vedran + // I like writing parsers + // too bad others don't like me writing parsers... + // TODO: i did some stupid things here for debugging, need to check + + int pos=0; + bool comment, iskey, issection; + const uint maxlen=4096; + char key[maxlen], value[maxlen], sectionname[maxlen]; + key[0]='\0'; value[0]='\0'; sectionname[0]='\0'; + Config_Section *section = this; + + do { + int c=buffer[pos]; + if ((c == '\n') || (c == '\0')) { + comment=false; iskey=true; issection=false; + wstrim(sectionname); + wstrim(key); + wstrim(value); + if (strlen(sectionname) > 0) + section = create_section(sectionname); + if (strlen(key) > 0) + section->add_entry(key,value); + key[0]='\0'; value[0]='\0'; sectionname[0]='\0'; + } + else if (c == '#') + comment = true; + else if (comment == false) { + if (c == '[') + issection = true; + else if (c == ']') + issection = false; + else if ((c == '=') || (c == ':')) + iskey = false; + else { + if (issection) { + if (maxlen>strlen(sectionname)+1) + strcat(sectionname, (const char*) &c); + } else if (iskey) { + if (maxlen>strlen(key)+1) + strcat(key, (const char*) &c); + } else + if (maxlen>strlen(value)+1) + strcat(value, (const char*) &c); + } + } + pos++; + } while (buffer[pos] != '\0'); + + m_error = 0; + m_changed=false; + return true; +} + +bool Config::flush() +{ + if(!m_changed) return true; + if(strlen(m_filename) < 1) return false; + + FILE *file = fopen(m_filename, "w+"); +// if(!file) +// fl_throw(::strerror(errno)); + + LOCALE_TO_C(); + + fprintf(file, "# EDE INI Version %s\n", PACKAGE_VERSION); + if(m_vendor && strlen(m_vendor)>0) fprintf(file, "# Vendor: %s\n", m_vendor); + if(m_app && strlen(m_app)>0) fprintf(file, "# Application: %s\n", m_app); + + // Flush sections + write_section(0, file); + + RESTORE_LOCALE(); + + fclose(file); + + m_error = 0; + m_changed=false; + return true; +} + + +Config_Section *Config::create_section(const char* name) +{ + if(strlen(name)<1) return 0; + + Config_Section *section = find_section(name, true); + if(section) return section; + + char *lastptr = strrchr(name,'/'); // int pos = name.rpos('/')+1; + int pos; + if(lastptr) { + pos = lastptr-name + 1; + } else { + section = new Config_Section(name, "", 0); + sections().push_back(section); + return section; + } + + //char* sec_name(name.sub_str(pos, name.length()-pos)); + char *sec_name = strndup(name+pos, strlen(name)-pos); + //char* sec_path(name.sub_str(0, pos)); + char *sec_path = strndup(name, pos); + + Config_Section *parent = find_section(sec_path, false); + Config_Sections *list = §ions(); + + if(!parent) { + // Fl_String_List sections; + std::vector sections = vec_from_string(sec_path, "/"); + + char path[PATH_MAX]; + path[0]='\0'; + for(uint n=0; nsections(); + + parent = new Config_Section(sections.at(n), path, parent); + list->push_back(parent); + + if (PATH_MAX>strlen(path)+strlen(sections.at(n))+1) { + strcat(path, sections.at(n)); + strcat(path, "/"); + } + } + } + + if(parent) list = &parent->sections(); + + section = new Config_Section(sec_name, sec_path, parent); + list->push_back(section); + + free(sec_name); free(sec_path); + m_error = 0; + return section; +} + +Config_Section *Config::find_section(const char *path, bool perfect_match) const +{ + if(!path || !*path) return 0; + + std::vector sections = vec_from_string(path, "/"); + + if(sections.size()==0) + return find(path, false); + + Config_Section *section = (Config_Section *)this; + for(uint n=0; nfind(sections.at(n), false); + if(!tmp) { + if(perfect_match) + return 0; + else + break; + } + section = tmp; + } + return section; +} + +void Config::remove_key(const char *section, const char *key) +{ + if(key) { + Config_Section *sect = find_section(section, true); + if(sect->remove_entry(key)) { + m_error = 0; + m_changed = true; + return; + } + } + m_error = CONF_ERR_KEY; +} + +// finding and removing stuff from deque +void sectremove(Config_Sections sects, Config_Section *sect) +{ + for (uint n=0; nparent()) { + sectremove(sect->parent()->sections(),sect); + } else { + sectremove(sections(),sect); + } + delete sect; + m_error = 0; + m_changed = true; + return; + } + m_error = CONF_ERR_SECTION; +} + +/* + * Read functions + */ + +int Config::_read_string(Config_Section *s, const char *key, char *ret, const char *def_value, int size) +{ + if(!key || !s) { + if(def_value) strncpy(ret, def_value, size); + else ret[0] = '\0'; + m_error = (!key ? CONF_ERR_KEY : CONF_ERR_SECTION); + return m_error; + } + + char *val = s->find_entry(key); + if(val) { + int len = strlen(val); // convert from unsigned... and now: + len = (lenfind_entry(key); + if(val && strlen(val)>0) + { + ret = strdup(val); + return (m_error = CONF_SUCCESS); + } + free(val); + + if (def_value) ret = strdup(def_value); else ret=0; + m_error = CONF_ERR_KEY; + return m_error; +} + +/*int Config::_read_string(Config_Section *s, const char *key, Fl_String &ret, const char *def_value) +{ + if(!key || !s) { + ret = def_value; + m_error = !key ? CONF_ERR_KEY : CONF_ERR_SECTION; + return m_error; + } + + Fl_String *val = s->find_entry(key); + if(val) { + ret = (*val); + return (m_error = CONF_SUCCESS); + } + + ret = def_value; + return (m_error = CONF_ERR_KEY); +}*/ + +int Config::_read_long(Config_Section *s, const char *key, long &ret, long def_value) +{ + char* tmp; + if(!_read_string(s, key, tmp, 0)) + if (tmp[0]) ret=strtol(tmp, NULL, 10); else ret=def_value; + else + ret = def_value; + return m_error; +} + +int Config::_read_int(Config_Section *s, const char *key, int &ret, int def_value) +{ + char* tmp; + if(!_read_string(s, key, tmp, 0)) { + ret = atoi(tmp); + if ((errno == ERANGE) || (ret == 0 && strcmp(tmp,"0") != 0)) ret = def_value; + } else + ret = def_value; + return m_error; +} + +int Config::_read_float (Config_Section *s, const char *key, float &ret, float def_value) +{ + char* tmp; + if(!_read_string(s, key, tmp, 0)) { + LOCALE_TO_C(); + ret = (float)strtod(tmp, 0); + RESTORE_LOCALE(); + } else + ret = def_value; + return m_error; +} + +int Config::_read_double(Config_Section *s, const char *key, double &ret, double def_value) +{ + char* tmp; + if(!_read_string(s, key, tmp, 0)) { + LOCALE_TO_C(); + ret = strtod(tmp, 0); + RESTORE_LOCALE(); + } else + ret = def_value; + return m_error; +} + +int Config::_read_bool(Config_Section *s, const char *key, bool &ret, bool def_value) +{ + char* tmp; + if(_read_string(s, key, tmp, 0)) { + ret = def_value; + return m_error; + } + if ((strncasecmp(tmp,"true",4)==0) + || (strncasecmp(tmp,"yes",3)==0) + || (strncasecmp(tmp,"on",2)==0) + || (strcasecmp(tmp,"1")==0)) { + ret = true; + } else if((strncasecmp(tmp,"false",5)==0) + || (strncasecmp(tmp,"no",2)==0) + || (strncasecmp(tmp,"off",3)==0) + || (strcasecmp(tmp,"0")==0)) { + ret = false; + } else { + m_error = CONF_ERR_NOVALUE; + ret = def_value; + } + return m_error; +} + +int Config::_read_color(Config_Section *s, const char *key, Color &ret, Color def_value) +{ + char* tmp; + if(_read_string(s, key, tmp, 0)) { + ret = def_value; + return m_error; + } + + int r=0,g=0,b=0; + if(sscanf(tmp, "RGB(%d,%d,%d)", &r, &g, &b)!=3) { + ret = def_value; + return (m_error = CONF_ERR_NOVALUE); + } + ret = color(r,g,b); + return m_error; +} + +/* + * Write functions + */ + +/*int Config::_write_string(Config_Section *s, const char *key, const char *value) +{ + char* val(value); + return _write_string(s, key, val); +}*/ + +int Config::_write_string(Config_Section *s, const char *key, const char* value) +{ + if(!s) return (m_error = CONF_ERR_SECTION); + if(!key) return (m_error = CONF_ERR_KEY); + +/* This logic is now in add_entry, cause we can't pass around pointers into structure + + char *val = s->find_entry(key); + if(val) { + strncpy(val, value, strlen(value)); + } else */ + if (value) s->add_entry(key, value); else s->add_entry(key, ""); + + m_changed=true; + return (m_error=CONF_SUCCESS); +} + +int Config::_write_long(Config_Section *s, const char *key, const long value) +{ + return _write_string(s, key, tsprintf("%ld", value)); +} + +int Config::_write_int(Config_Section *s, const char *key, const int value) +{ + return _write_string(s, key, tsprintf("%d", value)); +} + +int Config::_write_float(Config_Section *s, const char *key, const float value) +{ + LOCALE_TO_C(); + char tmp[32]; snprintf(tmp, sizeof(tmp)-1, "%g", value); + RESTORE_LOCALE(); + return _write_string(s, key, tmp); +} + +int Config::_write_double(Config_Section *s, const char *key, const double value) +{ + LOCALE_TO_C(); + char tmp[32]; snprintf(tmp, sizeof(tmp)-1, "%g", value); + RESTORE_LOCALE(); + return _write_string(s, key, tmp); +} + +int Config::_write_bool(Config_Section *s, const char *key, const bool value) +{ + if(value) return _write_string(s, key, "1"); + return _write_string(s, key, "0"); +} + +int Config::_write_color(Config_Section *s, const char *key, const Color value) +{ + unsigned char r,g,b; + split_color(value, r,g,b); + return _write_string(s, key, tsprintf("RGB(%d,%d,%d)", r,g,b)); +} + +////////////////////////////////////// +////////////////////////////////////// +////////////////////////////////////// + +Config_Section::Config_Section(const char* name, const char* path, Config_Section *par) +: m_parent(par) +{ + m_name=strdup(name); + m_path=strdup(path); +} + +Config_Section::~Config_Section() +{ + free(m_name); + free(m_path); + clear(); +} + +void Config_Section::clear() +{ + for(uint n=0; n0) + fprintf(fp, "[%s%s]\n", path(), name()); + + for(uint n=0; n 0) { + for(int a=0; awrite_section(indent+2, fp); + } +} + +void Config_Section::add_entry(const char* key, const char* value) +{ + if(!key || strlen(key)<1) return; + if(!value) return; + + char *kvpair; + char *m_key = wstrim(strdup(key)); + char *m_value = wstrim(strdup(value)); + asprintf(&kvpair,"%s=%s",m_key,m_value); + free (m_key); free (m_value); + + // if key already exists, delete + bool found = false; + for (uint i=0; i +#include // TODO: port everything to char** +#include // TODO: port everything to char** + +#include +#include +#include + +#ifdef _WIN32_WCE +#include +#endif + +using namespace fltk; + + +namespace edelib { + + +/** + * \defgroup edelib::Config edelib::Config globals + */ +/*@{*/ + +/** + * Error codes for edelib::Config + */ +enum ConfErrors { + CONF_SUCCESS = 0, ///< successful operation + CONF_ERR_FILE, ///< trouble accessing config file or directory + CONF_ERR_SECTION, ///< requested section was not found + CONF_ERR_KEY, ///< requested key was not found + CONF_ERR_MEMORY, ///< memory allocation error + CONF_ERR_NOVALUE, ///< key found, but invalid value associated with it +}; + +/** List used for sections in Fl_Config_Section */ +//FIXME +//typedef Fl_Ptr_List Fl_Config_Sections; +typedef std::deque Config_Sections; + +/** Map used for entries in Fl_Config_Section */ +//FIXME +//typedef Fl_String_String_Map Fl_Config_Lines; +//this is not exactly compatible, but that's the best we can do... +typedef std::vector Config_Lines; + +/*@}*/ + +class Config; + +/** + * The configuration section. + * Represents one section in config (ini) file. + * @see edelib::Config + */ +class Config_Section +{ + friend class Config; +public: + Config_Section(const char* name, const char* path, Config_Section *par); + virtual ~Config_Section(); + + /** + * Destroys all sections and entries. + */ + virtual void clear(); + + /** + * Returns pointer to parent section, NULL for Fl_Config (root) + */ + Config_Section *parent() const { return m_parent; } + + /** + * Returns name of section, without path. + * @see path() + */ + const char* name() const { return m_name; } + + /** + * Returns path to section, without name. + * @see name() + */ + const char* path() const { return m_path; } + + /** + * Returns const reference to entry map. + */ + const Config_Lines &lines() const { return m_lines; } + + /** + * Returns reference to entry map. + */ + Config_Lines &lines() { return m_lines; } + + /** + * Returns const reference to section list. + */ + const Config_Sections §ions() const { return m_sections; } + + /** + * Returns reference to section list. + */ + Config_Sections §ions() { return m_sections; } + + /** + * Find section named 'name'. + * @param section_name name of section to find + * @param recursive set true to perform recursive search. + */ + Config_Section *find(const char *section_name, bool recursive=false) const; + +protected: + Config_Section *m_parent; + char *m_name, *m_path; + + Config_Lines m_lines; //Line map + Config_Sections m_sections; //Section list + + void write_section(int indent, FILE *fp) const; + + void add_entry(const char* key, const char* value); + bool remove_entry(const char* key); + char* find_entry(const char *key) const; +}; + +/** + * The configuration holder. This class maybe used very easily to + * store application settings to file. Either system wide or user specific, + * depending on config type. edelib::Config is derived edelib::Config_Section, please + * take look a look at functions it provides also. + * @see edelib::Config_Section + */ +class Config : public Config_Section { +public: + + /** + * Config file modes + */ + enum ConfigType { + USER=1, ///< User specific config file + SYSTEM ///< System wide config file + }; + + /** + * Creates/reads/writes app specific config file. + * + * LINUX:
+ * File is created in ($home)/.ede/apps/($application)/($application).conf + * Or ($prefix)/share/ede/apps/($application)/($application).conf + * + *
WIN32:
+ * ($home)\Local Settings\.ede\apps\($application)/($application).conf + * Or ($common files)\($application)\($application).conf + * + * Location depends on ConfigType 'mode', USER or SYSTEM + * + * @param vendor aplication vendor, written down to file + * @param application name, written down to file + * @param mode which mode to use + */ + Config(const char *vendor, const char *application, int mode=USER); + + /** + * Access custom file in filesystem. + * + * @param filename path to config (ini) file. + * @param readfile if true, file is readed on constructor. I.e no need for read_file() + * @param createfile if true, file is created if it doesn't exists. + */ + Config(const char *filename, bool readfile=true, bool createfile=true); + + /** + * Destroys config + */ + virtual ~Config(); + + /** + * Finds config file, depending on mode. + * NOTE: User MUST NOT free returned pointer! + * + * LINUX:
+ * File is created in ($home)/.ede/apps/($application)/($application).conf + * Or ($prefix)/share/ede/apps/($application)/($application).conf + * + *
WIN32:
+ * ($home)\Local Settings\.ede\apps\($application)/($application).conf + * Or ($common files)\($application)\($application).conf + * + * @param filename Relative filename, e.g. "myapp_config.ini" + * @param create if true, path is returned even if file is not found. Otherwise NULL if path not found. + * @param mode which mode to use + */ + static char *find_file(const char *filename, bool create=true, int mode=USER); + + + /** + * (re)read file. NOTE: Deletes current entries from this Fl_Config object. + * @param create if true, file is created if it doesn't exists. + * @see filename() + */ + bool read_file(bool create = true); + + /** + * Flush entries to file. + * Returns true on success. + * @see filename() + */ + bool flush(); + + /** Returns current filename. */ + const char* filename() const { return m_filename; } + /** Set new filename. You need to call read_file() to get new entries. */ + void filename(const char *filename) { strncpy(m_filename, filename, strlen(filename)); } + /** Set new filename. You need to call read_file() to get new entries. */ +// void filename(const Fl_String &filename) { m_filename = filename; } + + /** Returns current vendor name. */ + const char* vendor() const { return m_vendor; } + /** Set new vendor name. */ + void vendor(const char *vendor) { strncpy(m_vendor, vendor, strlen(vendor)); } + /** Set new vendor name. */ +// void vendor(const Fl_String &vendor) { m_vendor = vendor; } + + /** Returns current application name. */ + const char* application() const { return m_app; } + /** Set new application name. */ + void application(const char *app) { strncpy(m_app, app, strlen(app)); } + /** Set new application name. */ +// void application(const Fl_String &app) { m_app = app; } + + /** + * Returns true, if data changed. + * call flush() to sync changes to file + * @see flush() + */ + bool is_changed() const { return m_changed; } + + /** + * Set changed, forces flush() to write file. + * Even if it is not changed. + */ + void set_changed() { m_changed = true; } + + /** + * Returns last error happened. + */ + int error() const { return m_error; } + + /** + * Reset error, normally you don't need to call this. + */ + void reset_error() { m_error = 0; } + + /** + * Return string presentation for last happened error. + */ + const char *strerror() const { return Config::strerror(m_error); } + + /** + * Return error string, associated with 'errnum' + */ + static const char *strerror(int errnum); + + /** + * Create new section. You can pass full path as section name. + * For example: create_section("/path/to/my/section"); + * All nested sections are created automatically. + * + * Returns pointer to created section, NULL if failed. + */ +// Config_Section *create_section(const char *path) { char* tmp(path); return create_section(tmp); } + + /** + * Create new section. You can pass full path as section name. + * For example: create_section("/path/to/my/section"); + * All nested sections are created automatically. + * + * Returns pointer to created section, NULL if failed. + */ + Config_Section *create_section(const char* path); + + /** + * Find section. You can pass full path as section name. + * For example: find_section("/path/to/my/section"); + * + * Returns pointer to found section, NULL if not found. + * + * @param perfect_match is true, it returns NULL if no exact section found. Otherwise it returns last found section in path. + */ + Config_Section *find_section(const char *path, bool perfect_match=true) const; + + /** + * Return child sections of section specified 'secpath' + */ + Config_Sections *section_list(const char *secpath) const { Config_Section *s=find_section(secpath); return s ? (&s->sections()) : 0; } + + /** + * Return entries of section specified 'secpath' + */ + Config_Lines *line_list(const char *secpath) const { Config_Section *s=find_section(secpath); return s ? (&s->lines()) : 0; } + + /** + * Set default section for read/write operations. + * NOTE: section is created, if it's not found.
+ * NOTE: You can pass path to section e.g "/path/to/my/section" + */ + void set_section(const char *secpath) { set_section(create_section(secpath)); } + + /** + * Set default section for read/write operations. + */ + void set_section(Config_Section *sec) { m_cur_sec = sec; } + + /** + * Remove entry associated with 'key' from section. + * NOTE: You can pass path to section e.g "/path/to/my/section" + */ + void remove_key(const char *section, const char *key); + + /** + * Remove section specified by 'section'. + * NOTE: You can pass path to section e.g "/path/to/my/section" + */ + void remove_sec(const char *section); + + + /** + * Read Fl_String entry from config. + * Returns CONF_SUCCESS on success, otherwise errorcode. + * NOTE: This function assumes that current section is set with set_section(). + * + * @param key Key to entry. + * @param ret Result is stored to this. + * @param def_value Default value for ret, if not found. + */ +// int read(const char *key, char* ret, const char *def_value) { return _read_string(m_cur_sec, key, ret, def_value); } + + /** + * Read char* entry from config. + * Returns CONF_SUCCESS on success, otherwise errorcode. + * NOTE: This function assumes that current section is set with set_section(). + * + * @param key Key to entry. + * @param ret Result is stored to this. + * @param def_value Default value for ret, if not found. + * @param size of 'ret' char* array. + */ + int read(const char *key, char *ret, const char *def_value, int size) { return _read_string(m_cur_sec, key, ret, def_value, size); } + + /** + * Read char* entry from config. + * Returns CONF_SUCCESS on success, otherwise errorcode. + * NOTE: 'ret' is allocated by Fl_Confing, user MUST free 'ret' by calling free() function. + * NOTE: This function assumes that current section is set with set_section(). + * + * @param key Key to entry. + * @param ret Result is stored to this. + * @param def_value Default value for ret, if not found. + */ + int read(const char *key, char *&ret, const char *def_value=0) { return _read_string(m_cur_sec, key, ret, def_value); } + + /** + * Read long entry from config. + * Returns CONF_SUCCESS on success, otherwise errorcode. + * NOTE: This function assumes that current section is set with set_section(). + * + * @param key Key to entry. + * @param ret Result is stored to this. + * @param def_value Default value for ret, if not found. + */ + int read(const char *key, long &ret, long def_value=0) { return _read_long(m_cur_sec, key, ret, def_value); } + + /** + * Read int entry from config. + * Returns CONF_SUCCESS on success, otherwise errorcode. + * NOTE: This function assumes that current section is set with set_section(). + * + * @param key Key to entry. + * @param ret Result is stored to this. + * @param def_value Default value for ret, if not found. + */ + int read(const char *key, int &ret, int def_value=0) { return _read_int(m_cur_sec, key, ret, def_value); } + + /** + * Read float entry from config. + * Returns CONF_SUCCESS on success, otherwise errorcode. + * NOTE: This function assumes that current section is set with set_section(). + * + * @param key Key to entry. + * @param ret Result is stored to this. + * @param def_value Default value for ret, if not found. + */ + int read(const char *key, float &ret, float def_value=0) { return _read_float(m_cur_sec, key, ret, def_value); } + + /** + * Read double entry from config. + * Returns CONF_SUCCESS on success, otherwise errorcode. + * NOTE: This function assumes that current section is set with set_section(). + * + * @param key Key to entry. + * @param ret Result is stored to this. + * @param def_value Default value for ret, if not found. + */ + int read(const char *key, double &ret, double def_value=0) { return _read_double(m_cur_sec, key, ret, def_value); } + + /** + * Read bool entry from config. + * Returns CONF_SUCCESS on success, otherwise errorcode. + * NOTE: This function assumes that current section is set with set_section(). + * + * @param key Key to entry. + * @param ret Result is stored to this. + * @param def_value Default value for ret, if not found. + */ + int read(const char *key, bool &ret, bool def_value=0) { return _read_bool(m_cur_sec, key, ret, def_value); } + + /** + * Read Fl_Color entry from config. + * Returns CONF_SUCCESS on success, otherwise errorcode. + * NOTE: This function assumes that current section is set with set_section(). + * + * @param key Key to entry. + * @param ret Result is stored to this. + * @param def_value Default value for ret, if not found. + */ + int read(const char *key, Color &ret, Color def_value=0) { return _read_color(m_cur_sec, key, ret, def_value); } + + + /** + * Write Fl_String entry to config. You must call flush() to sunc changes to file. + * Returns CONF_SUCCESS on success, otherwise errorcode. + * NOTE: This function assumes that current section is set with set_section(). + * + * @param key Key to entry. + * @param value value to set. if entry with 'key' exists, value is replaced. + */ +// int write(const char *key, const Fl_String &value) { return _write_string(m_cur_sec, key, value); } + + /** + * Write const char* entry to config. You must call flush() to sunc changes to file. + * Returns CONF_SUCCESS on success, otherwise errorcode. + * NOTE: This function assumes that current section is set with set_section(). + * + * @param key Key to entry. + * @param value value to set. if entry with 'key' exists, value is replaced. + */ + int write(const char *key, const char *value) { return _write_string(m_cur_sec, key, value); } + + /** + * Write long entry to config. You must call flush() to sunc changes to file. + * Returns CONF_SUCCESS on success, otherwise errorcode. + * NOTE: This function assumes that current section is set with set_section(). + * + * @param key Key to entry. + * @param value value to set. if entry with 'key' exists, value is replaced. + */ + int write(const char *key, const long value) { return _write_long(m_cur_sec, key, value); } + + /** + * Write int entry to config. You must call flush() to sunc changes to file. + * Returns CONF_SUCCESS on success, otherwise errorcode. + * NOTE: This function assumes that current section is set with set_section(). + * + * @param key Key to entry. + * @param value value to set. if entry with 'key' exists, value is replaced. + */ + int write(const char *key, const int value) { return _write_int(m_cur_sec, key, value); } + + /** + * Write float entry to config. You must call flush() to sunc changes to file. + * Returns CONF_SUCCESS on success, otherwise errorcode. + * NOTE: This function assumes that current section is set with set_section(). + * + * @param key Key to entry. + * @param value value to set. if entry with 'key' exists, value is replaced. + */ + int write(const char *key, const float value) { return _write_float(m_cur_sec, key, value); } + + /** + * Write double entry to config. You must call flush() to sunc changes to file. + * Returns CONF_SUCCESS on success, otherwise errorcode. + * NOTE: This function assumes that current section is set with set_section(). + * + * @param key Key to entry. + * @param value value to set. if entry with 'key' exists, value is replaced. + */ + int write(const char *key, const double value) { return _write_double(m_cur_sec, key, value); } + + /** + * Write bool entry to config. You must call flush() to sunc changes to file. + * Returns CONF_SUCCESS on success, otherwise errorcode. + * NOTE: This function assumes that current section is set with set_section(). + * + * @param key Key to entry. + * @param value value to set. if entry with 'key' exists, value is replaced. + */ + int write(const char *key, const bool value) { return _write_bool(m_cur_sec, key, value); } + + /** + * Write Fl_Color entry to config. You must call flush() to sunc changes to file. + * Returns CONF_SUCCESS on success, otherwise errorcode. + * NOTE: This function assumes that current section is set with set_section(). + * + * @param key Key to entry. + * @param value value to set. if entry with 'key' exists, value is replaced. + */ + int write(const char *key, const Color value) { return _write_color(m_cur_sec, key, value); } + + + /** + * Read Fl_String entry from config. + * Returns CONF_SUCCESS on success, otherwise errorcode. + * NOTE: section must be set as first parameter! + * + * @param section Section for entry + * @param key Key to entry. + * @param ret Result is stored to this. + * @param def_value Default value for ret, if not found. + */ +// int get(const char *section, const char *key, Fl_String &ret, const char *def_value) { return _read_string(find_section(section), key, ret, def_value); } + + /** + * Read char* entry from config. + * Returns CONF_SUCCESS on success, otherwise errorcode. + * NOTE: section must be set as first parameter! + * + * @param section Section for entry + * @param key Key to entry. + * @param ret Result is stored to this. + * @param def_value Default value for ret, if not found. + */ + int get(const char *section, const char *key, char *ret, const char *def_value, int size) { return _read_string(find_section(section), key, ret, def_value, size); } + + /** + * Read char* entry from config. + * Returns CONF_SUCCESS on success, otherwise errorcode. + * NOTE: 'ret' is allocated by Fl_Confing, user MUST free 'ret' by calling free() function. + * NOTE: section must be set as first parameter! + * + * @param section Section for entry + * @param key Key to entry. + * @param ret Result is stored to this. + * @param def_value Default value for ret, if not found. + */ + int get(const char *section, const char *key, char *&ret, const char *def_value=0) { return _read_string(find_section(section), key, ret, def_value); } + + /** + * Read long entry from config. + * Returns CONF_SUCCESS on success, otherwise errorcode. + * NOTE: section must be set as first parameter! + * + * @param section Section for entry + * @param key Key to entry. + * @param ret Result is stored to this. + * @param def_value Default value for ret, if not found. + */ + int get(const char *section, const char *key, long &ret, long def_value=0) { return _read_long(find_section(section), key, ret, def_value); } + + /** + * Read int entry from config. + * Returns CONF_SUCCESS on success, otherwise errorcode. + * NOTE: section must be set as first parameter! + * + * @param section Section for entry + * @param key Key to entry. + * @param ret Result is stored to this. + * @param def_value Default value for ret, if not found. + */ + int get(const char *section, const char *key, int &ret, int def_value=0) { return _read_int(find_section(section), key, ret, def_value); } + + /** + * Read float entry from config. + * Returns CONF_SUCCESS on success, otherwise errorcode. + * NOTE: section must be set as first parameter! + * + * @param section Section for entry + * @param key Key to entry. + * @param ret Result is stored to this. + * @param def_value Default value for ret, if not found. + */ + int get(const char *section, const char *key, float &ret, float def_value=0) { return _read_float(find_section(section), key, ret, def_value); } + + /** + * Read double entry from config. + * Returns CONF_SUCCESS on success, otherwise errorcode. + * NOTE: section must be set as first parameter! + * + * @param section Section for entry + * @param key Key to entry. + * @param ret Result is stored to this. + * @param def_value Default value for ret, if not found. + */ + int get(const char *section, const char *key, double &ret, double def_value=0) { return _read_double(find_section(section), key, ret, def_value); } + + /** + * Read bool entry from config. + * Returns CONF_SUCCESS on success, otherwise errorcode. + * NOTE: section must be set as first parameter! + * + * @param section Section for entry + * @param key Key to entry. + * @param ret Result is stored to this. + * @param def_value Default value for ret, if not found. + */ + int get(const char *section, const char *key, bool &ret, bool def_value=0) { return _read_bool(find_section(section), key, ret, def_value); } + + /** + * Read Fl_Color entry from config. + * Returns CONF_SUCCESS on success, otherwise errorcode. + * NOTE: section must be set as first parameter! + * + * @param section Section for entry + * @param key Key to entry. + * @param ret Result is stored to this. + * @param def_value Default value for ret, if not found. + */ + int get(const char *section, const char *key, Color &ret, Color def_value=0) { return _read_color(find_section(section), key, ret, def_value); } + + + /** + * Write Fl_String entry to config. You must call flush() to sunc changes to file. + * Returns CONF_SUCCESS on success, otherwise errorcode. + * NOTE: section must be set as first parameter! + * + * @param section Section for entry + * @param key Key to entry. + * @param value value to set. if entry with 'key' exists, value is replaced. + */ +// int set(const char *section, const char *key, const Fl_String &value) { return _write_string(create_section(section), key, value); } + + /** + * Write const char *entry to config. You must call flush() to sunc changes to file. + * Returns CONF_SUCCESS on success, otherwise errorcode. + * NOTE: section must be set as first parameter! + * + * @param section Section for entry + * @param key Key to entry. + * @param value value to set. if entry with 'key' exists, value is replaced. + */ + int set(const char *section, const char *key, const char *value) { return _write_string(create_section(section), key, value); } + + /** + * Write long entry to config. You must call flush() to sunc changes to file. + * Returns CONF_SUCCESS on success, otherwise errorcode. + * NOTE: section must be set as first parameter! + * + * @param section Section for entry + * @param key Key to entry. + * @param value value to set. if entry with 'key' exists, value is replaced. + */ + int set(const char *section, const char *key, const long value) { return _write_long(create_section(section), key, value); } + + /** + * Write int entry to config. You must call flush() to sunc changes to file. + * Returns CONF_SUCCESS on success, otherwise errorcode. + * NOTE: section must be set as first parameter! + * + * @param section Section for entry + * @param key Key to entry. + * @param value value to set. if entry with 'key' exists, value is replaced. + */ + int set(const char *section, const char *key, const int value) { return _write_int(create_section(section), key, value); } + + /** + * Write float entry to config. You must call flush() to sunc changes to file. + * Returns CONF_SUCCESS on success, otherwise errorcode. + * NOTE: section must be set as first parameter! + * + * @param section Section for entry + * @param key Key to entry. + * @param value value to set. if entry with 'key' exists, value is replaced. + */ + int set(const char *section, const char *key, const float value) { return _write_float(create_section(section), key, value); } + + /** + * Write bool entry to config. You must call flush() to sunc changes to file. + * Returns CONF_SUCCESS on success, otherwise errorcode. + * NOTE: section must be set as first parameter! + * + * @param section Section for entry + * @param key Key to entry. + * @param value value to set. if entry with 'key' exists, value is replaced. + */ + int set(const char *section, const char *key, const bool value) { return _write_double(create_section(section), key, value); } + + /** + * Write Fl_Color entry to config. You must call flush() to sunc changes to file. + * Returns CONF_SUCCESS on success, otherwise errorcode. + * NOTE: section must be set as first parameter! + * + * @param section Section for entry + * @param key Key to entry. + * @param value value to set. if entry with 'key' exists, value is replaced. + */ + int set(const char *section, const char *key, const Color value) { return _write_color(create_section(section), key, value); } + +private: + int m_error; + char* m_filename; + char *m_vendor, *m_app; + + Config_Section *m_cur_sec; + bool m_changed; + + //int _read_string(Fl_Config_Section *s, const char *key, Fl_String &ret, const char *def_value); + int _read_string(Config_Section *s, const char *key, char *ret, const char *def_value, int size); + int _read_string(Config_Section *s, const char *key, char *&ret, const char *def_value); + int _read_long (Config_Section *s, const char *key, long &ret, long def_value); + int _read_int (Config_Section *s, const char *key, int &ret, int def_value); + int _read_float (Config_Section *s, const char *key, float &ret, float def_value); + int _read_double(Config_Section *s, const char *key, double &ret, double def_value); + int _read_bool (Config_Section *s, const char *key, bool &ret, bool def_value); + int _read_color (Config_Section *s, const char *key, Color &ret, Color def_value); + + //int _write_string(Fl_Config_Section *s, const char *key, const Fl_String &value); + int _write_string(Config_Section *s, const char *key, const char *value); + int _write_long (Config_Section *s, const char *key, const long value); + int _write_int (Config_Section *s, const char *key, const int value); + int _write_float (Config_Section *s, const char *key, const float value); + int _write_double(Config_Section *s, const char *key, const double value); + int _write_bool (Config_Section *s, const char *key, const bool value); + int _write_color (Config_Section *s, const char *key, const Color value); +}; + +// Backward compatibility... +static inline const char* find_config_file(const char *filename, bool create=true) { + return Config::find_file(filename, create, Config::USER); +} + +} + +#endif diff --git a/edelib2/Icon.cpp b/edelib2/Icon.cpp new file mode 100644 index 0000000..3624c94 --- /dev/null +++ b/edelib2/Icon.cpp @@ -0,0 +1,141 @@ +/* + * $Id$ + * + * edelib::Icon - General icon library with support for Icon themes + * Part of Equinox Desktop Environment (EDE). + * Copyright (c) 2000-2006 EDE Authors. + * + * This program is licenced under terms of the + * GNU General Public Licence version 2 or newer. + * See COPYING for details. + */ + +#include +#include +#include +#include + +#include "Icon.h" +#include "Config.h" +#include "../edeconf.h" + +using namespace fltk; +using namespace edelib; + +// FIXME: use an EDE internal default theme +const char* Icon::iconspath = PREFIX"/share/icons"; +const char* Icon::defaulttheme = "crystalsvg"; +char* Icon::theme = 0; + + + +// Read configuration to detect currently active theme +void Icon::read_theme_config() +{ + char temp_value[PATH_MAX]; + if (theme) free(theme); + + Config cfg(find_config_file("ede.conf", 0)); + cfg.set_section("Icons"); + if (!cfg.read("IconTheme", temp_value, 0, sizeof(temp_value))) + theme = strdup(temp_value); + + if (!theme || strlen(theme)<2) + theme = strdup(defaulttheme); +} + + +// Change theme in configuration +void Icon::set_theme(const char *t) +{ + if (theme) free(theme); + theme = strdup(t); + + Config cfg(find_config_file("ede.conf", true)); + cfg.set_section("Icons"); + cfg.write("IconTheme", theme); +} + + + +// Search theme directory for icon file of given name + +// Icon names are unique, regardless of subdirectories. The +// "actions", "apps", "devices" etc. are just an idea that +// never lived. So we simply flatten the KDE directory +// structure. + +// Alternatively, if there are different icons in subdirs with +// same name, you can provide e.g. subdir/filename and it will +// work. + +const char *find_icon(const char *name, const char *directory) +{ + dirent **files; + static char filename[PATH_MAX]; + + snprintf (filename, PATH_MAX, "%s/%s", directory, name); + if (filename_exist(filename)) return filename; + snprintf (filename, PATH_MAX, "%s/%s.png", directory, name); + if (filename_exist(filename)) return filename; + snprintf (filename, PATH_MAX, "%s/%s.xpm", directory, name); + if (filename_exist(filename)) return filename; + + // Look in subdirectories + const int num_files = filename_list(directory, &files); + char dirname[PATH_MAX]; + for (int i=0; id_name,"./") == 0) || strcmp(files[i]->d_name,"../") == 0) continue; + snprintf (dirname, PATH_MAX, "%s/%s", directory, files[i]->d_name); + if (filename_isdir(dirname)) { + // Cut last slash + if (dirname[strlen(dirname)-1] == '/') + dirname[strlen(dirname)-1] = '\0'; + const char *tmp = find_icon(name, dirname); + if (tmp) return tmp; + } + } + + // Not found + return 0; +} + +// Create icon with given "standard" name +Icon* Icon::get(const char *name, int size) +{ + char directory[PATH_MAX]; + + // FIXME: rescale icon from other sizes + if (size!=TINY && size!=SMALL && size!=MEDIUM && size!=LARGE && size!=HUGE) + { + fprintf (stderr, "Edelib: ERROR: We don't support icon size %d... using %dx%d\n", size, MEDIUM, MEDIUM); + size=MEDIUM; + } + + snprintf (directory, PATH_MAX, "%s/%s/%dx%d", iconspath, get_theme(), size, size); + + const char *icon = find_icon(name, directory); + + if (!icon) // Fallback to icon from default theme, if not found + { + snprintf (directory, sizeof(directory), "%s/%s/%dx%d", iconspath, defaulttheme, size, size); + icon = find_icon(name, directory); + } + if (!icon && size!=TINY) // No default icon in this size + { + snprintf (directory, sizeof(directory), "%s/%s/%dx%d", iconspath, defaulttheme, TINY, TINY); + icon = find_icon(name, directory); + // TODO: scale icon from tiny to requested size + } + if (!icon) + return 0; // sorry + else + { + //fprintf(stderr,"Ikona: %s\n",icon); + Icon* i = (Icon*)pngImage::get(icon); + // free(icon); // no need to free icon + //i->transp_index(255); + //fprintf (stderr, "Name: %s Transp_index: %d Pixel type: %d\n", name, i->transp_index(), i->pixel_type()); + return i; + } +} diff --git a/edelib2/Icon.h b/edelib2/Icon.h new file mode 100644 index 0000000..e7fa61e --- /dev/null +++ b/edelib2/Icon.h @@ -0,0 +1,91 @@ +/* + * $Id$ + * + * edelib::Icon - General icon library with support for Icon themes + * Part of Equinox Desktop Environment (EDE). + * Copyright (c) 2000-2006 EDE Authors. + * + * This program is licenced under terms of the + * GNU General Public Licence version 2 or newer. + * See COPYING for details. + */ + + +/*! \class edelib::Icon + +This class gives support for KDE-compatible icon themes. +Icons are identified with their standard names, and the class +will fetch corresponding image from its standard location. +User can easily change all icons at once by setting the icon +theme. + +There should be a freedesktop.org standard for icon names, +but I'm not aware of one so we will implement a sort of KDE +compatibility. Please refer to Icon theme documentation for +details. + +*/ + +#ifndef _edelib_Icon_h_ +#define _edelib_Icon_h_ + +#include + +using namespace fltk; + +namespace edelib { + +// This class builds on pngImage, which is a subclass of SharedImage. +// SharedImage.h code suggests that this will be dropped in favor of +// Image class. + +class Icon : public pngImage +{ +public: + /*! Icon sizes: + TINY - 16x16 + SMALL - 32x32 + MEDIUM - 48x48 + LARGE - 64x64 + HUGE - 128x128 + At the moment we only support and use TINY and MEDIUM sizes.*/ + enum IconSize { + TINY = 16, + SMALL = 32, + MEDIUM = 48, + LARGE = 64, + HUGE = 128, + }; + + // Silence compiler warning + virtual ~Icon(); + + /*! Return edelib::Icon with given standard name and size. Adding + path or .png extension is not necessary - just name is fine. + Example: + o->image(edelib::Icon::get("fileopen", edelib::Icon::TINY)); */ + static Icon* get(const char *name, int size = MEDIUM); + + /*! Give currently active theme and its directory. */ + static const char* get_theme() { if (!theme) read_theme_config(); return theme; } + + /*! Set theme as currently active. */ + static void set_theme(const char *t); + + int get_size() { return my_size; } + +// In future, we might add methods for retrieving theme metadata +// (name, author, URL, copyright and such) + +private: + static void read_theme_config(); + static const char* iconspath; + static const char* defaulttheme; + static char* theme; + int my_size; + char *my_theme; +}; + +} + +#endif diff --git a/edelib2/Jamfile b/edelib2/Jamfile new file mode 100644 index 0000000..fa8b30c --- /dev/null +++ b/edelib2/Jamfile @@ -0,0 +1,10 @@ +SubDir TOP edelib2 ; + +MakeLibrary libedelib : about_dialog.cpp + Config.cpp + Icon.cpp + MimeType.cpp + process.cpp + pty.cpp + Run.cpp + Util.cpp ; diff --git a/edelib2/Makefile b/edelib2/Makefile new file mode 100644 index 0000000..48da25f --- /dev/null +++ b/edelib2/Makefile @@ -0,0 +1,15 @@ + +CPPFILES = about_dialog.cpp Config.cpp Icon.cpp MimeType.cpp process.cpp pty.cpp Run.cpp Util.cpp +TARGET = + +include ../makeinclude + +all: about_dialog.o Config.o Icon.o MimeType.o process.o pty.o Run.o Util.o + +install: + +uninstall: + +clean: + $(RM) *.o + diff --git a/edelib2/MimeType.cpp b/edelib2/MimeType.cpp new file mode 100644 index 0000000..4bc89dc --- /dev/null +++ b/edelib2/MimeType.cpp @@ -0,0 +1,377 @@ +/* + * $Id$ + * + * edelib::MimeType - Detection of file types and handling + * Part of Equinox Desktop Environment (EDE). + * Copyright (c) 2000-2006 EDE Authors. + * + * This program is licenced under terms of the + * GNU General Public Licence version 2 or newer. + * See COPYING for details. + */ + +#include "MimeType.h" + +#include + +#include "Run.h" +#include "Config.h" +#include "Util.h" +#include +#include +#include +#include +#include + +#include + +// I made this icon because on KDE there are stupidly two icons with same name +#define DEFAULT_ICON "mimetypes/misc" +#define FOLDER_ICON "folder" +#define RECYCLED_ICON "recycled" +#define LOCKED_ICON "lockoverlay" +#define FOLDERLOCKED_ICON "folder_locked" +// to be defined in separate file: +#define FILE_MANAGER "efiler" + + +using namespace fltk; +using namespace edelib; + + +// GLOBAL NOTE: asprintf() is a GNU extension - if it's unsupported on some +// platforms, use our tasprintf() instead (in Util.h) + + + +// File format: +// id|description|handler program|icon|wildcard for filename (extension)|wildcard for file command output|classic mime type +// +// - id - short string; to setup subtypes, just use slash (/) as separator in ID +// - description - what is shown in gui +// - handler program - filename will be appended, specify any needed parameters for opening - THIS WILL BE MOVED INTO SEPARATE FILE (for handling multiple programs etc.) +// - icon - just name, don't give extension or path +// - extension - will be used only if multiple types have same file command match. You don't need to give asterisk (*) i.e. .png. If there are multiple extensions, separate them with slash (/). Actually, "extension" can be any part of filename, but I can't think of use for this +// - file output - relevant part of output from `file -bLnNp $filename` +// - classic mime type - what is used for interchange i.e. text/plain - may be used for matching if other methods fail +// +// This is how mimetype resolving is supposed to work: if there is exactly one match for `file` +// output, this is what we use. If there are multiple, the largest match is used. If there are +// no results or several results with same size we look at extension, then at classic mime type +// (using -i parameter to `file`). +// NOTE: not sure about this last thing, since -i parameter appears to just be alias + + + +// queue/tree of mimetype data +static struct MimeData { + char *id, *typestr, *program, *iconname, *extension, *file_output, *classic_mime; + MimeData *next; +} *mime_first=0; + + +// This is used instead of strstrmulti to check if filename ends with any of extensions +char *test_extension(const char *file, const char *ext) { + if (!file || !ext || (strlen(file)==0) || (strlen(ext)==0)) + return (char*)file; // this means that empty search returns true + char *copy = strdup(ext); + char *token = strtok(copy, "/"); + char *result = 0; + do { + int k = strlen(file)-strlen(token); + if (strcmp(file+k,token) == 0) { return strdup(file+k); break; } + } while ((token = strtok(NULL, "/"))); // double braces to silence compiler warnings :( + free (copy); + if (!result && (ext[strlen(ext)-1] == '/')) + return (char*)file; // again + return result; +} + + + +// Read mime data from file + +void get_mimedata() { + // TODO: currently all mimes are on the same level... + mime_first = (MimeData*) malloc(sizeof(MimeData)+1); + MimeData *m = mime_first; + + char line[256]; + char* mime_filename = Config::find_file("mimetypes.conf"); + FILE *f = fopen(mime_filename,"r"); + bool first=true; + while (!feof(f) && (fgets(line,255,f))) { + if (feof(f)) break; + + // delete comments + if (char* p=strchr(line,'#')) { *p = '\0'; } + // delete spaces + wstrim(line); + // if there's nothing left, skip + if (strlen(line)<1) continue; + char *p1,*p2; + if (!(p1 = strchr(line,'|'))) continue; // likewise + + // Allocate next element if this is not first pass + if (!first) { + m->next = (MimeData*) malloc(sizeof(MimeData)+1); + m = m->next; + } + first=false; + + // parse line + m->id = wstrim(strndup(line,p1-line)); + if (p1 && (p2 = strchr(++p1,'|'))) m->typestr = wstrim(strndup(p1,p2-p1)); else m->typestr=0; + if (p2 && (p1 = strchr(++p2,'|'))) m->program = wstrim(strndup(p2,p1-p2)); else m->program=0; + if (p1 && (p2 = strchr(++p1,'|'))) m->iconname = wstrim(strndup(p1,p2-p1)); else m->iconname=0; + if (p2 && (p1 = strchr(++p2,'|'))) m->extension = wstrim(strndup(p2,p1-p2)); else m->extension=0; + if (p1 && (p2 = strchr(++p1,'|'))) m->file_output = wstrim(strndup(p1,p2-p1)); else m->file_output=0; + if (p2 && (p1 = strchr(++p2,'|'))) m->classic_mime = wstrim(strndup(p2,p1-p2)); else m->classic_mime=0; + } + m->next = 0; + fclose(f); +} + + +void free_mimedata() { + MimeData *m, *n; + m = mime_first; + while ((n = m->next)) { free(m); m=n; } + mime_first=0; +} + + +void print_mimedata() { // for debugging + MimeData *m = mime_first; + while (m != 0) { + fprintf(stderr, "ID: '%s' Name: '%s' Prog: '%s' Icon: '%s' Ext: '%s' File: '%s' MIME: '%s'\n", m->id, m->typestr, m->program, m->iconname, m->extension, m->file_output, m->classic_mime); + m = m->next; + } +} + + +// declare given MimeData as current +void MimeType::set_found(char *id) { + if (!id) return; + + // find id + MimeData *m = mime_first; + while (m && strcmp(m->id,id)!=0) m = m->next; + + // copy data to cur_* + cur_id = strdup(id); + if (m->typestr) cur_typestr = strdup(m->typestr); + if (m->program && (strlen(twstrim(m->program))>0)) { + asprintf (&cur_command, "%s \"%s\"", m->program, cur_filename); + } + if (m->iconname) cur_iconname = strdup(m->iconname); + else cur_iconname = strdup(DEFAULT_ICON); +} + + +void MimeType::set(const char* filename, bool usefind) { + // Drop any previous data from memory + if (cur_id) free(cur_id); + if (cur_typestr) free(cur_typestr); + if (cur_command) free(cur_command); + if (cur_iconname) free(cur_iconname); + if (cur_filename) free(cur_filename); + cur_id=cur_typestr=cur_command=cur_iconname=cur_filename=0; + + if (filename && filename_exist(filename)) { + cur_filename=strdup(filename); + + // Directory + if (filename_isdir(filename)) { + if (access(filename, R_OK || X_OK)) { + // Not readable + cur_id = strdup("directory/locked"); + cur_typestr = strdup("Directory (not accessible)"); + cur_iconname = strdup(FOLDERLOCKED_ICON); + } else { + cur_id = strdup("directory"); + cur_typestr = strdup("Directory"); + asprintf(&cur_command, "%s \"%s\"", FILE_MANAGER, filename); + cur_iconname = strdup(FOLDER_ICON); + } + return; + } + + // File not readable + if (access(filename, R_OK)) { + if (errno == EACCES) { + cur_id = strdup("locked"); + cur_typestr = strdup("Can't read file"); + cur_iconname = strdup(LOCKED_ICON); + } + // we don't handle other errors specially + return; + } + + // Backup file + if (filename[strlen(filename)-1] == '~') { + cur_id = strdup("backup"); + cur_typestr = strdup("Backup file"); + cur_iconname = strdup(RECYCLED_ICON); + return; + } + + if (!mime_first) get_mimedata(); + + // Stuff we need to declare before goto for visibility reasons + MimeData *m = mime_first; + //char buffer[256]; + char* buffer; + int found=0, foundext = 0; + MimeData *file_matches[50], *ext_matches[50] = {0}; // this is for if(!ext_matches[0]) + + if (!usefind) goto nofind; // using goto here makes less indentation ;) + + // execute file command through libmagic + buffer = strdup(magic_file(magic_cookie, filename)); + +fprintf (stderr,"(%s) File said: %s (Error: %s)\n",filename,buffer,magic_error(magic_cookie)); + + // find matches for 'file' command output + // TODO: add wildcard matching + while (m != 0) { + if (m->file_output && (strstr(buffer,m->file_output))) + file_matches[found++]=m; + m=m->next; + } + + if (found == 1) { // one result found + this->set_found(file_matches[0]->id); + free(buffer); + return; + } + + if (found > 1) { // multiple results - find best match + // We look for longest file match + uint max=0; + for (int i=0; ifile_output)>max) + max = strlen(file_matches[i]->file_output); +fprintf(stderr, "Max: %d\n",max); + // If all matches are empty, this is probably bogus + if (max == 0) goto nofind; + + // Test to see if there are multiple best choices + int j=0; + for (int i=0; ifile_output) == max) { + fprintf (stderr, "Lokalni maximum '%s'\n", file_matches[i]->id); + file_matches[j++] = file_matches[i]; + } + // Now **file_matches should contain only maximums + if (j==1) { + this->set_found(file_matches[0]->id); + free(buffer); + return; + } + + // Compare maximums on extension + for (int i=0; iextension)) + ext_matches[foundext++] = file_matches[i]; + + // No extension matches - accept first result (FIXME) + if (foundext == 0) { + this->set_found(file_matches[0]->id); + free(buffer); + return; + } + // From here we jump to comment " // continue extension matching" + } + + nofind: + free(buffer); + if (!ext_matches[0]) { + // Try extension matching on all mimetypes + // This code will be executed if: + // a) find command is disabled + // b) find command returned zero matches (not likely, + // because some mimetypes have empty 'find' field) + // c) all of find results have equal length and no extensions + // match (this is probably a misconfiguration, but its possible) + m = mime_first; + do { + // take care not to match empty extension + if (m->extension + && (strlen(m->extension)>0) + && + (m->extension[strlen(m->extension)-1] != '/') + && (test_extension(filename,m->extension))) { + fprintf (stderr, "Extenzija '%s'\n", m->id); + ext_matches[foundext++]=m; + } + } while ((m=m->next)); + } + +fprintf(stderr, "Foundext: %d\n", foundext); + // continue extension matching + if (foundext == 1) { // one result found + this->set_found(ext_matches[0]->id); + return; + } + + if (foundext > 1) { // multiple results - find best match + // Code is almost the same as above + // We look for longest extension match + uint max=0; + for (int i=0; iextension)>max && + (ext_matches[i]->extension[strlen(ext_matches[i]->extension)-1] != '/')) + max = strlen(ext_matches[i]->extension); + + // Test to see if there are multiple best choices + int j=0; + for (int i=0; iextension) == max) + ext_matches[j++] = ext_matches[i]; + // Now **ext_matches should contain only maximums + if (j==1) { this->set_found(ext_matches[0]->id); return; } + + // Now what??? we return first one whether it be the only or not! + // FIXME + this->set_found(file_matches[0]->id); + return; + } + + // No extension results found - this is unknown file type + cur_id = strdup("unknown"); + cur_typestr = strdup("Unknown"); + cur_iconname = strdup(DEFAULT_ICON); + } + +} + + +MimeType::MimeType(const char* filename, bool usefind) { + cur_id=cur_typestr=cur_command=cur_iconname=cur_filename=0; + + // Load mime settings file + if (!mime_first) get_mimedata(); + + // Have libmagic read its configuration data + magic_cookie = magic_open(MAGIC_NONE); + magic_load(magic_cookie, NULL); + + if (filename) set(filename,usefind); +} + + +MimeType::~MimeType() { + if (cur_id) free(cur_id); + if (cur_typestr) free(cur_typestr); + if (cur_command) free(cur_command); + if (cur_iconname) free(cur_iconname); + if (cur_filename) free(cur_filename); + + // Free memory used by mimetype configuration + free_mimedata(); //- should we? mimedata is static for a reason... + + // Free memory used by libmagic + magic_close(magic_cookie); + +} diff --git a/edelib2/MimeType.h b/edelib2/MimeType.h new file mode 100644 index 0000000..17eef4d --- /dev/null +++ b/edelib2/MimeType.h @@ -0,0 +1,79 @@ +/* + * $Id$ + * + * edelib::MimeType - Detection of file types and handling + * Part of Equinox Desktop Environment (EDE). + * Copyright (c) 2000-2006 EDE Authors. + * + * This program is licenced under terms of the + * GNU General Public Licence version 2 or newer. + * See COPYING for details. + */ + + +/*! \class edelib::MimeType + +This detects the type of file using "magic" (fingerprint +usualy found in the first several bytes) and, if that fails, +"extension" (part of filename after last dot). To avoid code +duplication, GNU file is used. + +Also this class suggests the command to be used for opening. + +*/ + + +#ifndef _edelib_MimeType_h_ +#define _edelib_MimeType_h_ + +// TODO: have configure script detect libmagic and don't use +// it if its not present +#include + +#include "Icon.h" + +namespace edelib { + +class MimeType +{ +public: + + /*! Constructor takes filename and all interesting data is + returned with methods listed below. filename must contain + full path. Set usefind to false to avoid using GNU/find + command. + + Note: We advise using empty constructor and set method in loops.*/ + + MimeType(const char* filename=0, bool usefind=true); + + // Silence compiler warning + virtual ~MimeType(); + + /*! Scan file with given full path and store the results until + next call of set() */ + void set(const char* filename, bool usefind=true); + + /*! Returns a string describing file type i.e. "PNG Image" */ + const char* type_string() { if (cur_typestr) return cur_typestr; else return 0;} + + /*! String that can be executed to open the given file + or perform some default action (e.g. for .desktop files, + the program that will be launched) */ + const char* command() { if (cur_command) return cur_command; else return 0; } + + /*! Returns edelib::Icon for files of this type. Parameter is + edelib::Icon::IconSize */ + Icon* icon(int size) { if(cur_iconname) return Icon::get(cur_iconname,size); else return 0; } + + const char* id() { if(cur_id) return cur_id; else return 0; } + +private: + char *cur_id, *cur_typestr, *cur_command, *cur_iconname, *cur_filename; + void set_found(char *id); + magic_t magic_cookie; //handle for libmagic +}; + +} + +#endif diff --git a/edelib2/NLS.h b/edelib2/NLS.h new file mode 100644 index 0000000..59d81ea --- /dev/null +++ b/edelib2/NLS.h @@ -0,0 +1,21 @@ +/* + * $Id$ + * + * edelib::NLS - Native language support + * Part of Equinox Desktop Environment (EDE). + * Copyright (c) 2000-2006 EDE Authors. + * + * This program is licenced under terms of the + * GNU General Public Licence version 2 or newer. + * See COPYING for details. + */ + +// Native language support - under construction +// Based on code from efltk (Fl_Locale) + +#ifndef _NLS_H_ +#define _NLS_H_ + +#define _(s) s + +#endif diff --git a/edelib2/Run.cpp b/edelib2/Run.cpp new file mode 100644 index 0000000..6b7c1da --- /dev/null +++ b/edelib2/Run.cpp @@ -0,0 +1,236 @@ +/* + * $Id$ + * + * edelib::Run - Library for executing external programs + * Part of Equinox Desktop Environment (EDE). + * Copyright (c) 2000-2006 EDE Authors. + * + * This program is licenced under terms of the + * GNU General Public Licence version 2 or newer. + * See COPYING for details. + */ + + +#define PREFIX "/usr" + +#include "Run.h" + +#include "Config.h" +#include +#include "NLS.h" +#include "process.h" + +using namespace fltk; +using namespace edelib; + + +// GLOBAL NOTE: asprintf() is a GNU extension which is also available under *BSD +// If this is considered a problem, use our tasprintf() instead (in Util.h) + + +// -------------------------------------------- +// Start a process using exec(3) +// This means that there is no handling or control over process, +// it's just forked into background. If you need to chat with +// program or use its output, see edelib::PtyProcess +// -------------------------------------------- + +int run_fork(const char *cmd, bool wait) +{ + int pid, status; + int nulldev; + extern char **environ; + + status=0; + if (cmd == NULL) + return (EDERUN_EMPTY); + + pid = fork (); + if (pid == -1) + return (EDERUN_FORK_FAILED); + if (pid == 0) + { + char *argv[4]; + // child + argv[0] = "sh"; + argv[1] = "-c"; + argv[2] = (char*)cmd; + argv[3] = NULL; + + // The following is to avoid X locking when executing + // terminal based application that requires user input + if ((nulldev = open ("/dev/null", O_RDWR))) + { + close (0); dup (nulldev); + close (1); dup (nulldev); + close (2); dup (nulldev); + } + + if (execve ("/bin/sh", argv, environ) == -1) + perror ("/bin/sh"); + _exit (EDERUN_EXECVE_FAILED); + } + do + { + if ((wait) && (waitpid (pid, &status, 0) == -1)) + { + if (errno != EINTR) + return (EDERUN_WAITPID_FAILED); + } + else { + if (status==127) status=EDERUN_NOT_FOUND; + if (status==126) status=EDERUN_NOT_EXEC; + return status; + } + } + while (1); + + return 0; +} + + +// -------------------------------------------- +// Start a process as root user +// We use edelib::PtyProcess to chat with su/sudo. Afterwards +// the program continues undisturbed +// -------------------------------------------- + +// this is our internal message: +#define CONTMSG "elauncher_ok_to_continue" +// these are part of sudo/su chat: +#define PWDQ "Password:" +#define BADPWD "/bin/su: incorrect password" +#define SUDOBADPWD "Sorry, try again." + +int run_as_root(const char *cmd, bool wait) +{ + // -- we could check for availibility of sudo, but there's no point + bool use_sudo = false; + Config pGlobalConfig(find_config_file("ede.conf", 0)); + pGlobalConfig.set_section("System"); + pGlobalConfig.read("UseSudo", use_sudo, false); + + // Prepare array as needed by exec() + char *parts[4]; + if (use_sudo) { + parts[0] = "/bin/sudo"; + parts[1] = ""; + // This "continue message" prevents accidentally exposing password + asprintf(&parts[2], "echo %s; %s", CONTMSG, cmd); + parts[3] = NULL; + } else { + parts[0] = "/bin/su"; + parts[1] = "-c"; + // This "continue message" prevents accidentally exposing password + asprintf(&parts[2], "echo %s; %s", CONTMSG, cmd); + parts[3] = NULL; + } + // the actual command is this: +// cmd_ = strtok(cmd," "); + +tryagain: + PtyProcess *child = new PtyProcess(); + child->setEnvironment((const char**)environ); + if (child->exec(parts[0], (const char**)parts) < 0) { + return EDERUN_PTY_FAILED; + } + + // Wait for process to actually start. Shouldn't last long + while (1) { + int p = child->pid(); + if (p != 0 && child->checkPid(p)) + break; + int exit = child->checkPidExited(p); + if (exit != -2) { + // Process is DOA + fprintf (stderr, "Edelib: Process has died unexpectedly! Exit status: %d\n",exit); + delete child; + goto tryagain; + } + fprintf (stderr, "Edelib: Process not started yet...\n"); + } + + // Run program as root using su or sudo + char *line; + + const char *pwd = password(_("This program requires administrator privileges.\nPlease enter your password below:")); + if (pwd == 0) return EDERUN_USER_CANCELED; + + // Chat routine + while (1) { + line = child->readLine(); + + // This covers other cases of failed process startup + // Our su command should at least produce CONTMSG + if (line == 0 && child->checkPidExited(child->pid()) != PtyProcess::NotExited) { + // TODO: capture stdout? as in sudo error? + fprintf (stderr, "Edelib: su process has died unexpectedly in chat stage!\n"); + delete child; + + if (choice_alert (_("Failed to start authentication. Try again"), 0, _("Yes"), _("No")) == 2) return 0; + goto tryagain; + } + + if (strncasecmp(line,PWDQ,strlen(PWDQ))== 0) + child->writeLine(pwd,true); + + if (strncasecmp(line,CONTMSG,strlen(CONTMSG)) == 0) + break; // program starts... + + if ((strncasecmp(line,BADPWD,strlen(BADPWD)) == 0) || (strncasecmp(line,SUDOBADPWD,strlen(SUDOBADPWD)) == 0)) { + // end process + child->waitForChild(); + delete child; + + if (choice_alert (_("The password is wrong. Try again?"), 0, _("Yes"), _("No")) == 2) return 0; + + goto tryagain; + } + } + + // Wait for program to end, discarding output + int child_val = child->waitForChild(); + if (child_val==127) child_val=EDERUN_NOT_FOUND; + if (child_val==126) child_val=EDERUN_NOT_EXEC; + + // deallocate one string we allocated + free(parts[2]); + delete child; + + return child_val; +} + + +static bool done_checks=false; +static bool elauncher_found=false; + +// Check availability of various necessary components +// For the moment just elauncher :) +void do_checks() +{ + struct stat *buf = (struct stat*)malloc(sizeof(struct stat)); + if (stat (PREFIX"/bin/elauncher", buf) == 0) + elauncher_found = true; + else + elauncher_found = false; +} + + +int edelib::run_program(const char *path, bool wait, bool root, bool use_elauncher) +{ + char *execstr; + if (!done_checks) do_checks(); + if (use_elauncher && elauncher_found) { + if (root) + asprintf(&execstr,"elauncher --root \"%s\"", path); + else + asprintf(&execstr,"elauncher \"%s\"", path); + run_fork (execstr, false); // elauncher can't wait + } else { + if (root) + return run_as_root(path, wait); + else + return run_fork(path, wait); + } + return 0; // shutup compiler! +} diff --git a/edelib2/Run.h b/edelib2/Run.h new file mode 100644 index 0000000..9f72081 --- /dev/null +++ b/edelib2/Run.h @@ -0,0 +1,73 @@ +/* + * $Id$ + * + * edelib::Run - Library for executing external programs + * Part of Equinox Desktop Environment (EDE). + * Copyright (c) 2000-2006 EDE Authors. + * + * This program is licenced under terms of the + * GNU General Public Licence version 2 or newer. + * See COPYING for details. + */ + +#ifndef _edelib_Run_h_ +#define _edelib_Run_h_ + +#include +#include +#include +#include +#include +#include +#include + +namespace edelib { + +/** \fn run_program(char *path, bool wait=true, bool root=false, bool use_elauncher=false) + Standard EDE function for running external tasks. This function is time tested + and provides a number of neat facilities. + + Parameters: + \a path - Full path to executable. If path is ommited, function will search PATH + environment variable. + \a wait - If true, parent process will be frozen until program ends. If false, + it will fork into background and parent has no way to know what happened with it. + default = true + \a root - If true, sudo will be used to run program as root, with a nice facility + to enter your root password. If sudo is not available, "su -c" will be tried. + default = false + \a use_elauncher - Program will be launched through elauncher which provides busy + cursor, information about missing executable, standard output, backtrace in case + of segfault etc. However, use of elauncher may cause some minimal overhead. + Also, since there is no way to wait with elauncher, \a wait value will be + ignored. default = false + + Return value of the function is program "exit value". Usually exit value of 0 + means successful execution, and values 1-255 have certain special meanings + per program documentation. Several special values above 255 are: + EDERUN_NOT_FOUND - \a cmd doesn't exist + EDERUN_EMPTY - \a cmd is empty + EDERUN_NOT_EXEC - \a cmd doesn't have execute permission + EDERUN_FORK_FAILED - fork() function returned a PID of -1 (see fork(2)) + EDERUN_WAITPID_FAILED - waitpid() function resulted with error (see waitpid(2)) + EDERUN_EXECVE_FAILED - execve() function returned -1 (see execve(2)) + EDERUN_PTY_FAILED - could not create pseudo-terminal (see getpt(3) and grantpt(3)) +*/ + +enum{ + EDERUN_NOT_FOUND = 65535, + EDERUN_EMPTY = 65534, + EDERUN_NOT_EXEC = 65533, + EDERUN_FORK_FAILED = 65532, + EDERUN_WAITPID_FAILED = 65531, + EDERUN_EXECVE_FAILED = 65530, + EDERUN_PTY_FAILED = 65529, + EDERUN_USER_CANCELED = 65528 +}; + + +int run_program(const char *path, bool wait=true, bool root=false, bool use_elauncher=false); + +} + +#endif diff --git a/edelib2/Util.cpp b/edelib2/Util.cpp new file mode 100644 index 0000000..b937472 --- /dev/null +++ b/edelib2/Util.cpp @@ -0,0 +1,360 @@ +/* + * $Id$ + * + * Library of useful functions + * Part of Equinox Desktop Environment (EDE). + * Copyright (c) 2000-2006 EDE Authors. + * + * This program is licenced under terms of the + * GNU General Public Licence version 2 or newer. + * See COPYING for details. + */ + +#include "Util.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +#ifdef _WIN32 + +# include +# include +# include +# define access(a,b) _access(a,b) +# define mkdir(a,b) _mkdir(a) +# define R_OK 4 + +#else + +# include + +#endif /* _WIN32 */ + + +// From Enumerations.h +#ifdef _WIN32 +# undef slash +# define slash '\\' +#else +# undef slash +# define slash '/' +#endif +// End Enumerations.h + + +using namespace fltk; +using namespace edelib; + + +// Test if path is absolute or relative +int edelib::is_path_rooted(const char *fn) +{ +#ifdef _WIN32 + if (fn[0] == '/' || fn[0] == '.' || fn[0] == '\\' || fn[1]==':') +#else + if (fn[0] == '/' || fn[0] == '.') +#endif + return 1; + return 0; +} + + +// recursively create a path in the file system +bool edelib::make_path( const char *path ) +{ + if(access(path, 0)) + { + const char *s = strrchr( path, slash ); + if ( !s ) return 0; + int len = s-path; + char *p = (char*)malloc( len+1 ); + memcpy( p, path, len ); + p[len] = 0; + make_path( (const char*)p ); + free( p ); + return ( mkdir( path, 0777 ) == 0 ); + } + return true; +} + + +// create the path needed for file using make_path +bool edelib::make_path_for_file( const char *path ) +{ + const char *s = strrchr( path, slash ); + if ( !s ) return false; + int len = s-path; + char *p = (char*)malloc( len+1 ); + memcpy( p, path, len ); + p[len] = 0; + bool ret=make_path( (const char*)p ); + free( p ); + return ret; +} + + +// Cross-platform function for system path +char* edelib::get_sys_dir() +{ +#ifndef _WIN32 + return SYSTEM_PATH; +#else + static char path[PATH_MAX]; + HKEY hKey; + if(RegOpenKeyExW(HKEY_LOCAL_MACHINE, L"Software\\Microsoft\\Windows\\CurrentVersion", 0, KEY_READ, &hKey)==ERROR_SUCCESS) + { + DWORD size=4096; + RegQueryValueExW(hKey, L"CommonFilesDir", NULL, NULL, (LPBYTE)path, &size); + RegCloseKey(hKey); + return path; + } + return "C:\\EDE\\"; +#endif +} + + + +// Cross-platform function for home directory... +// I don't see the purpose since getenv("HOME") works just fine +/*char* edelib::get_homedir() { + char *path = new char[PATH_MAX]; + const char *str1; + + str1=getenv("HOME"); + if (str1) { + memcpy(path, str1, strlen(str1)+1); + return path; + } + + return 0; +}*/ + + +// strdupcat() - it's cool to strcat with implied realloc +// -- NOTE: due to use of realloc *always* use strdupcat return value: +// dest = strdupcat(dest,src); +// and *never* use it like: +// strdupcat(dest,src); +char* edelib::strdupcat(char *dest, const char *src) +{ + if (!dest) { + dest=(char*)malloc(strlen(src)); + } else { + dest=(char*)realloc (dest, strlen(dest)+strlen(src)+1); + } + strcat(dest,src); + return dest; +} + + +// wstrim() - for trimming characters (used in parser) +// parts of former fl_trimleft and fl_trimright from Fl_Util.cpp +char* edelib::wstrim(char *string) +{ + if(!string) + return NULL; + + char *start; + int len = strlen(string); + + if (len) { + char *p = string + len; + do { + p--; + if ( !isspace(*p) ) break; + } while ( p != string ); + + if ( !isspace(*p) ) p++; + *p = 0; + } + + for(start = string; *start && isspace (*start); start++); + memmove(string, start, strlen(start) + 1); + + return string; +} + +const char* edelib::twstrim(const char* string) +{ + static char buffer[4096]; + if (strlen(string)>4095) { + strncpy(buffer,string,4095); + buffer[4095]='\0'; + } else + strcpy(buffer,string); + wstrim((char*)buffer); + return (const char*)buffer; +} + +// hmmmh? +/* +char* wstrim(const char *string) +{ + char *newstring = strdup(string); + return wstrim(newstring); +}*/ + +// Returns nicely formatted string for byte sizes +const char* edelib::nice_size(double size) { + static char buffer[256]; + if (size<1024) { + snprintf(buffer,255,"%d B",(int)size); + } else if (size<1024*10) { + snprintf(buffer,255,"%.1f kB",(float)size/1024); + } else if (size<1024*1024) { + snprintf(buffer,255,"%d kB",(int)size/1024); + } else if (size<1024*1024*10) { + snprintf(buffer,255,"%.1f MB",(float)size/(1024*1024)); + } else if (size<1024*1024*1024) { + snprintf(buffer,255,"%d MB",(int)size/(1024*1024)); + } else if (size<1024*1024*1024*10) { + snprintf(buffer,255,"%.1f GB",(float)size/(1024*1024*1024)); + } else { + snprintf(buffer,255,"%d GB",(int)size/(1024*1024*1024)); + } + return (const char*) buffer; +} + + +const char* edelib::nice_time(long int epoch) { + static char buffer[256]; + + const time_t k = (const time_t)epoch; + const struct tm *timeptr = localtime(&k); + // Date/time format should be moved to configuration + snprintf(buffer,255,"%.2d.%.2d.%.4d. %.2d:%.2d", timeptr->tm_mday, timeptr->tm_mon, 1900+timeptr->tm_year, timeptr->tm_hour, timeptr->tm_min); + + return buffer; +} + + + +// Find in haystack any of needles (divided with separator) +char* edelib::strstrmulti(const char *haystack, const char *needles, const char *separator) { + if (!haystack || !needles || (strlen(haystack)==0) || (strlen(needles)==0)) + return (char*)haystack; // this means that empty search returns true + char *copy = strdup(needles); + char *token = strtok(copy, separator); + char *result = 0; + do { + if ((result = strstr(haystack,token))) break; + } while ((token = strtok(NULL, separator))); + free (copy); + if (!result && (strcmp(separator,needles+strlen(needles)-strlen(separator))==0)) + return (char*)haystack; // again + return result; +} + + + +// vec_from_string() - similar to explode() in PHP or split() in Perl +// adapted from Fl_String_List to use vector +/*std::vector vec_from_string(const char *str, const char *separator) +{ + if(!str) return std::vector (); + + const char *ptr = str; + const char *s = strstr(ptr, separator); + std::vector retval; + if(s) { + unsigned separator_len = strlen(separator); + do { + unsigned len = s - ptr; + if (len) { + retval.push_back(strndup(ptr,len)); + } else { + retval.push_back(NULL); + } + + ptr = s + separator_len; + s = strstr(ptr, separator); + } + while(s); + + if(*ptr) { + retval.push_back(strdup(ptr)); + } + } else { + retval.push_back(strdup(ptr)); + } + return retval; +}*/ + + + + +// Print to a static char[] and return pointer +const char* edelib::tsprintf(char *format, ...) +{ + static char buffer[4096]; + va_list args; + va_start(args, format); + vsnprintf(buffer, 4095, format, args); + va_end(args); + return (const char*)buffer; +} + +char* edelib::tasprintf(char *format, ...) +{ + char buffer[4096]; + va_list args; + va_start(args, format); + vsnprintf(buffer, 4095, format, args); + va_end(args); + return strdup(buffer); +} + + +// This function exists on some OSes and is mentioned in C textbooks +// However, we can just use sprintf instead + +/* +char * +itoa(int value, char *string, int radix) +{ + char tmp[33]; + char *tp = tmp; + int i; + unsigned v; + int sign; + char *sp; + + if (radix > 36 || radix <= 1) + { + return 0; + } + + sign = (radix == 10 && value < 0); + if (sign) + v = -value; + else + v = (unsigned)value; + while (v || tp == tmp) + { + i = v % radix; + v = v / radix; + if (i < 10) + *tp++ = i+'0'; + else + *tp++ = i + 'a' - 10; + } + + if (string == 0) + string = (char *)malloc((tp-tmp)+sign+1); + sp = string; + + if (sign) + *sp++ = '-'; + while (tp > tmp) + *sp++ = *--tp; + *sp = 0; + return string; +}*/ diff --git a/edelib2/Util.h b/edelib2/Util.h new file mode 100644 index 0000000..d40c7cf --- /dev/null +++ b/edelib2/Util.h @@ -0,0 +1,92 @@ +/* + * $Id$ + * + * Library of useful functions + * Part of Equinox Desktop Environment (EDE). + * Copyright (c) 2000-2006 EDE Authors. + * + * This program is licenced under terms of the + * GNU General Public Licence version 2 or newer. + * See COPYING for details. + */ + + +#ifndef edelib_Util_h +#define edelib_Util_h + +#include "../edeconf.h" + + +namespace edelib { + + +// Constants +#define SYSTEM_PATH PREFIX"/share/ede" +#define DOC_PATH SYSTEM_PATH"/doc" + + +// Cross-platform test if path is absolute or relative +int is_path_rooted(const char *fn); + +// Recursively create a path in the file system +bool make_path( const char *path ); + +// Create the path needed for file using make_path +bool make_path_for_file( const char *path ); + +// Cross-platform function for system files location +char* get_sys_dir(); + +// strcat() that also does realloc if needed. Useful if +// e.g. you have a loop which grows string in each pass +// -- Note: due to use of realloc *always* use strdupcat return value: +// dest = strdupcat(dest,src); +// and *never* use it like: +// strdupcat(dest,src); + +// NOTE this function is not used! Its use is not recommended + +char* strdupcat(char *dest, const char *src); + +// Whitespace trim (both left and right) +char* wstrim(char *string); + +// Version with temporary results (static char[]) +const char* twstrim(const char *string); + +// Finds in haystack any of strings contained in string "needles". The substrings +// are divided with separator. +// Not actually used... +char* strstrmulti(const char *haystack, const char *needles, const char *separator); + +// Returns nicely formatted string for byte sizes e.g. "1.2 kB" for size=1284 +const char* nice_size(double size); + +// Returns nicely formatted string for date and time given in seconds since +// Epoch. This should be in config +const char* nice_time(long int epoch); + +// Create vector from string using separator +//std::vector vec_from_string(const char *str, const char *separator); + + +/*! \fn const char* edelib::tsprintf(char* format, ...) + +A useful function which executes sprintf() on a static char[] variable big enough to +hold short temporary strings. The variable remains valid until next call. + +Use: + run_program(tsprintf(PREFIX"/bin/eiconsconf %s",param)); + +When setting text values of fltk objects, instead use tasprintf which executes a strdup. +Example: + window->label(tasprintf("%s, version %s",appname,appversion)); +*/ + +const char* tsprintf(char* format, ...); + +char* tasprintf(char* format, ...); + +} + +#endif diff --git a/edelib2/about_dialog.cpp b/edelib2/about_dialog.cpp new file mode 100644 index 0000000..84b8d51 --- /dev/null +++ b/edelib2/about_dialog.cpp @@ -0,0 +1,84 @@ +/* + * $Id$ + * + * About dialog + * Part of Equinox Desktop Environment (EDE). + * Copyright (c) 2000-2006 EDE Authors. + * + * This program is licenced under terms of the + * GNU General Public Licence version 2 or newer. + * See COPYING for details. + */ + +#include "about_dialog.h" +#include +#include + +#include "../edeconf.h" +#include "NLS.h" +#include "Run.h" +#include "Util.h" + + +using namespace fltk; +using namespace edelib; + +const char* copying_file = "copying.html"; + + +static Window *aboutWindow; + +void showCopyingInfo() +{ + run_program(tsprintf("file:%s/%s", DOC_PATH, copying_file),false,false,true); +} + +void cb_Click(Button* b, void*) +{ + showCopyingInfo(); +} + +void cb_Close(Button*, void*) +{ + aboutWindow->hide(); +} + +void edelib::about_dialog(const char *progname, const char *progversion, const char *addcomment) +{ + aboutWindow = new Window(275, 190); + aboutWindow->begin(); + {InvisibleBox* o = new InvisibleBox(5, 5, 265, 44); + o->labelsize(18); + o->label(tasprintf("%s %s",progname,progversion)); // tmp will be deallocated by InvisibleBox destructor + o->box(FLAT_BOX); + } + {InvisibleBox* o = new InvisibleBox(5, 50, 265, 20); + o->label(tasprintf(_("Part of Equinox Desktop Environment %s"),PACKAGE_VERSION)); // tmp will be deallocated by InvisibleBox destructor + o->box(FLAT_BOX); + } + new InvisibleBox(5, 70, 265, 20, _("(C) Copyright 2000-2005 EDE Authors")); + {InvisibleBox* o = new InvisibleBox(5, 90, 265, 40, _("This program is licenced under terms of the GNU General Public License version 2 or newer.")); + o->labelsize(10); + o->align(ALIGN_INSIDE|ALIGN_WRAP); + } + {Button* o = new Button(65, 124, 145, 20, _("Click here for details.")); + o->box(NO_BOX); + o->buttonbox(NO_BOX); + o->labelcolor(BLUE); + o->highlight_textcolor(RED); + o->labelsize(10); + o->callback((Callback*)cb_Click); + ((Window*)(o->parent()))->hotspot(o); + } + {Button* o = new Button(95, 152, 80, 25, "&Close"); + o->callback((Callback*)cb_Close); + } + aboutWindow->end(); + + aboutWindow->label(tasprintf(_("About %s"), progname)); // tmp will be deallocated by Window destructor + aboutWindow->set_modal(); + aboutWindow->resizable(aboutWindow); + + aboutWindow->end(); + aboutWindow->show(); +} diff --git a/edelib2/about_dialog.h b/edelib2/about_dialog.h new file mode 100644 index 0000000..65ee1f3 --- /dev/null +++ b/edelib2/about_dialog.h @@ -0,0 +1,27 @@ +/* + * $Id$ + * + * About dialog + * Part of Equinox Desktop Environment (EDE). + * Copyright (c) 2000-2006 EDE Authors. + * + * This program is licenced under terms of the + * GNU General Public Licence version 2 or newer. + * See COPYING for details. + */ + +#ifndef _edelib_aboutdialog_h_ +#define _edelib_aboutdialog_h_ + +#include +#include +#include + + +namespace edelib { + +void about_dialog(const char *progname, const char *progversion, const char *addcomment = 0); + +} + +#endif diff --git a/edelib2/aboutdialog.fld b/edelib2/aboutdialog.fld new file mode 100644 index 0000000..ee59c76 --- /dev/null +++ b/edelib2/aboutdialog.fld @@ -0,0 +1,71 @@ +# data file for the eFLTK User Interface Designer (eFLUID) +version 2,0003 +images_dir ./ +i18n +header_name {.h} +code_name {.cpp} +gridx 5 +gridy 5 +snap 3 +decl {// The EDE control center.} {} + +decl {// Copyright (c) 2000. - 2005. EDE Authors} {} + +decl {// This program is licenced under terms of the} {} + +decl {// GNU General Public Licence version 2 or newer.} {} + +decl {// See COPYING for details} {} + +decl {//} {} + +decl {\#include } {} + +decl {\#include } {} + +decl {Fl_Window *aboutWindow;} {} + +class AboutDialog {open +} { + Function {AboutDialog(const char *progname, const char *progversion, const char *addcomment = 0)} {open return_type void + } { + Fl_Window aboutWindow {open + xywh {652 341 275 190} resizable + extra_code {aboutWindow->label(Fl_String(_("About"))+Fl_String(" ")+Fl_String(progname));} modal visible + } { + Fl_Box {} { + xywh {5 5 265 44} align FL_ALIGN_INSIDE|FL_ALIGN_WRAP label_size 18 + extra_code {o->label(Fl_String(progname)+Fl_String(" ")+Fl_String(progversion));} + } + Fl_Box {} { + label {Part of Equinox Desktop Environment} + xywh {5 49 265 20} align FL_ALIGN_INSIDE|FL_ALIGN_WRAP + extra_code {o->label(o->label() + Fl_String(" "PACKAGE_VERSION));} + } + Fl_Box {} { + label {(C) Copyright 2000-2005 EDE Authors} + xywh {5 74 265 20} align FL_ALIGN_INSIDE|FL_ALIGN_WRAP + } + Fl_Box {} { + label {This program is licenced under terms of the GNU General Public License version 2 or newer.} + xywh {5 98 265 30} align FL_ALIGN_TOP|FL_ALIGN_INSIDE|FL_ALIGN_WRAP label_size 10 + } + Fl_Button {} { + label {Click here for details.} + callback {showCopyingInfo();} + xywh {65 124 145 20} hotspot box NO_BOX button_box NO_BOX label_color 4 highlight_label_color 1 label_size 10 + } + Fl_Button {} { + label {&Close} + callback {aboutWindow->hide();} selected + xywh {95 152 80 25} + } + } + code {aboutWindow->end(); +aboutWindow->show();} {} + } + Function {showCopyingInfo()} {open private + } { + code {fl_start_child_process("elauncher file:/usr/share/ede/doc/copying.html",false);} {} + } +} diff --git a/edelib2/locale/messages.pot b/edelib2/locale/messages.pot new file mode 100644 index 0000000..66040bd --- /dev/null +++ b/edelib2/locale/messages.pot @@ -0,0 +1,43 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2005-02-04 12:39+0100\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=CHARSET\n" +"Content-Transfer-Encoding: 8bit\n" + +#: aboutdialog.cpp:27 +msgid "About " +msgstr "" + +#: aboutdialog.cpp:36 +msgid "Part of Equinox Desktop Environment " +msgstr "" + +#: aboutdialog.cpp:40 +msgid "(C) Copyright 2000-2005 EDE Authors" +msgstr "" + +#: aboutdialog.cpp:44 +msgid "" +"This program is licenced under terms of the GNU General Public License " +"version 2 or newer." +msgstr "" + +#: aboutdialog.cpp:49 +msgid "Click here for details." +msgstr "" + +#: aboutdialog.cpp:58 +msgid "&Close" +msgstr "" diff --git a/edelib2/process.cpp b/edelib2/process.cpp new file mode 100644 index 0000000..1bc30ba --- /dev/null +++ b/edelib2/process.cpp @@ -0,0 +1,693 @@ +/* + * $Id$ + * + * edelib::PtyProcess - This class enables us to "chat" with terminal programs synchronously + * Adapted from KDE (kdelibs/kdesu/process.cpp) - original copyright message below + * + * Part of Equinox Desktop Environment (EDE). + * Copyright (c) 2000-2006 EDE Authors. + * + * This program is licenced under terms of the + * GNU General Public Licence version 2 or newer. + * See COPYING for details. + */ + + +/* vi: ts=8 sts=4 sw=4 + * + * Id: process.cpp 439322 2005-07-27 18:49:23Z coolo + * + * This file is part of the KDE project, module kdesu. + * Copyright (C) 1999,2000 Geert Jansen + * + * This file contains code from TEShell.C of the KDE konsole. + * Copyright (c) 1997,1998 by Lars Doelle + * + * This is free software; you can use this library under the GNU Library + * General Public License, version 2. See the file "COPYING.LIB" for the + * exact licensing terms. + * + * process.cpp: Functionality to build a front end to password asking + * terminal programs. + */ + +//#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#if defined(__SVR4) && defined(sun) +#include +#include +#endif + +#ifdef HAVE_SYS_SELECT_H +#include // Needed on some systems. +#endif + +//#include +//#include + +//#include +//#include + +#include "process.h" +#include "pty.h" +//#include "kcookie.h" +#include "NLS.h" + +using namespace edelib; + + +int strpos(const char *string, char c) +{ + for (uint i=0;ienv = 0; + m_Pid = 0; + m_Inbuf = m_TTY = m_Exit = m_Command = 0; +} + + +int PtyProcess::init() +{ + delete m_pPTY; + m_pPTY = new PTY(); + m_Fd = m_pPTY->getpt(); + if (m_Fd < 0) + return -1; + if ((m_pPTY->grantpt() < 0) || (m_pPTY->unlockpt() < 0)) + { + fprintf(stderr, "Edelib: PtyProcess: Master setup failed.\n"); + m_Fd = -1; + return -1; + } + if (m_TTY) free(m_TTY); + m_TTY = strdup(m_pPTY->ptsname()); +// m_Inbuf.resize(0); + if (m_Inbuf) free(m_Inbuf); + m_Inbuf = 0; + return 0; +} + + +PtyProcess::~PtyProcess() +{ + if (m_TTY) free(m_TTY); + if (m_Inbuf) free(m_Inbuf); + delete m_pPTY; + delete d; +} + +/** Set additinal environment variables. */ +void PtyProcess::setEnvironment( const char **env ) +{ + // deallocate old environment store + int i=0; + if (d->env) + while (d->env[i] != NULL) + free(d->env[i++]); + + // count number of environment variables + int n_env=0; + while (env[n_env++] != NULL); + d->env = (char**)malloc((n_env+2)*sizeof(char *)); + + // copy env to d->env + i=0; + while (env[i] != NULL) { + d->env[i] = strdup(env[i]); + i++; // gcc insists that strdup(env[i++]) above would be ambiguous... + } + d->env[i] = NULL; +} + +char **PtyProcess::environment() const +{ + return d->env; +} + +/* + * Read one line of input. The terminal is in canonical mode, so you always + * read a line at at time + */ + +char *PtyProcess::readLine(bool block) +{ + int pos; + char *ret = 0; + + if (m_Inbuf && strlen(m_Inbuf)>0) + { + pos = strpos(m_Inbuf,'\n'); + if (pos == -1) + { + ret = strdup(m_Inbuf); + free(m_Inbuf); + m_Inbuf = 0; + } else + { + // ret = part of m_Inbuf before \n + // m_Inbuf = part of m_Inbuf after \n + ret = strdup(m_Inbuf); + free(m_Inbuf); + m_Inbuf = strdup(ret + pos + 1); + ret[pos+1] = '\0'; + } + return ret; + } + + int flags = fcntl(m_Fd, F_GETFL); + if (flags < 0) + { +// kdError(900) << k_lineinfo << "fcntl(F_GETFL): " << perror << "\n"; + fprintf (stderr, "Edelib: PtyProcess: fcntl not working - %d\n", errno); + return ret; + } + int oflags = flags; + if (block) + flags &= ~O_NONBLOCK; + else + flags |= O_NONBLOCK; + + if ((flags != oflags) && (fcntl(m_Fd, F_SETFL, flags) < 0)) + { + // We get an error here when the child process has closed + // the file descriptor already. + return ret; + } + + int nbytes; + char buf[256]; + while (1) + { + nbytes = read(m_Fd, buf, 255); + if (nbytes == -1) + { + if (errno == EINTR) + continue; + else break; + } + if (nbytes == 0) + break; // eof + + buf[nbytes] = '\000'; + if (m_Inbuf) + m_Inbuf = (char*)realloc(m_Inbuf, strlen(m_Inbuf)+nbytes+1); + else { + m_Inbuf = (char*)malloc(nbytes+1); + m_Inbuf[0] = 0; + } + strcat(m_Inbuf, buf); + + ret = strdup(m_Inbuf); + // only one line... + pos = strpos(ret,'\n'); + if (pos != -1) { + free (m_Inbuf); + m_Inbuf = strdup(ret + pos + 1); + ret[pos+1] = '\0'; + } + break; + } + + return ret; +} + + +void PtyProcess::writeLine(const char *line, bool addnl) +{ + if (line && strlen(line)>0) + write(m_Fd, line, strlen(line)); + if (addnl) + write(m_Fd, "\n", 1); +} + + +void PtyProcess::unreadLine(const char *line, bool addnl) +{ + char *tmp = (char*) malloc(strlen(line)+1); + strcpy(tmp,line); + if (addnl) + strcat(tmp, "\n"); + + if (m_Inbuf) { + char *tmp2 = (char*)malloc(strlen(m_Inbuf)+strlen(tmp)+1); + strcpy(tmp2,tmp); + strcat(tmp2,m_Inbuf); + free(m_Inbuf); + m_Inbuf=tmp2; + free(tmp); + } else + m_Inbuf = tmp; +} + +/* + * Fork and execute the command. This returns in the parent. + */ + +int PtyProcess::exec(const char *command, const char **args) +{ + fprintf(stderr, "Edelib: PtyProcess: Running `%s'\n", command); + int i; + + if (init() < 0) + return -1; + + // Open the pty slave before forking. See SetupTTY() + fprintf (stderr, "pty: %s\n", m_TTY); + int slave = open(m_TTY, O_RDWR); + if (slave < 0) + { + fprintf(stderr, "Edelib: PtyProcess: Could not open slave pty.\n"); + return -1; + } + + if ((m_Pid = fork()) == -1) + { + fprintf(stderr, "Edelib: PtyProcess: fork(): %s\n", strerror(errno)); + return -1; + } + + // Parent + if (m_Pid) + { + close(slave); + return 0; + } + + // Child + if (SetupTTY(slave) < 0) { + _exit(1); + } + + i=0; + while (d->env[i] != NULL) + putenv(d->env[i++]); +// unsetenv("KDE_FULL_SESSION"); + + // From now on, terminal output goes through the tty. + + const char *path; +// if (strchr(command,'/')) + path = command; +/* VEDRAN: This is now handled elsewhere - fully qualified path + *must* be provided*/ +// else +// { +// QString file = KStandardDirs::findExe(command); +// if (file.isEmpty()) +// { +// kdError(900) << k_lineinfo << command << " not found\n"; +// _exit(1); +// } +// path = QFile::encodeName(file); +// } + +// const char **argp = (const char **)malloc((args.count()+2)*sizeof(char *)); +/* const char **cptr = args; + int count=0; + while (cptr++) + count++; + fprintf(stderr, "G\n"); + const char **argp = (const char **)malloc((count+2)*sizeof(char *)); + fprintf(stderr, "H\n"); + + i = 0; +// argp[i++] = strdup(path); + cptr = args; + int j=0; + while (cptr[j]) + argp[i++] = strdup(cptr[j++]); +// for (QList::ConstIterator it=args.begin(); it!=args.end(); ++it) +// argp[i++] = *it; + + argp[i + 2] = 0;*/ + + execv(path, const_cast(args)); + _exit(1); + return -1; // Shut up compiler. Never reached. +} + + +/* + * Wait until the terminal is set into no echo mode. At least one su + * (RH6 w/ Linux-PAM patches) sets noecho mode AFTER writing the Password: + * prompt, using TCSAFLUSH. This flushes the terminal I/O queues, possibly + * taking the password with it. So we wait until no echo mode is set + * before writing the password. + * Note that this is done on the slave fd. While Linux allows tcgetattr() on + * the master side, Solaris doesn't. + */ + +int PtyProcess::WaitSlave() +{ + int slave = open(m_TTY, O_RDWR); + if (slave < 0) + { +// kdError(900) << k_lineinfo << "Could not open slave tty.\n"; + return -1; + } + +// kdDebug(900) << k_lineinfo << "Child pid " << m_Pid << endl; + + struct termios tio; + while (1) + { + if (!checkPid(m_Pid)) + { + close(slave); + return -1; + } + if (tcgetattr(slave, &tio) < 0) + { +// kdError(900) << k_lineinfo << "tcgetattr(): " << perror << "\n"; + close(slave); + return -1; + } + if (tio.c_lflag & ECHO) + { +// kdDebug(900) << k_lineinfo << "Echo mode still on.\n"; + waitMS(slave,100); + continue; + } + break; + } + close(slave); + return 0; +} + + +int PtyProcess::enableLocalEcho(bool enable) +{ + int slave = open(m_TTY, O_RDWR); + if (slave < 0) + { +// kdError(900) << k_lineinfo << "Could not open slave tty.\n"; + return -1; + } + struct termios tio; + if (tcgetattr(slave, &tio) < 0) + { +// kdError(900) << k_lineinfo << "tcgetattr(): " << perror << "\n"; + close(slave); return -1; + } + if (enable) + tio.c_lflag |= ECHO; + else + tio.c_lflag &= ~ECHO; + if (tcsetattr(slave, TCSANOW, &tio) < 0) + { +// kdError(900) << k_lineinfo << "tcsetattr(): " << perror << "\n"; + close(slave); return -1; + } + close(slave); + return 0; +} + + +// runChild() -- added by Vedran +// This routine will execute child process capturing all output +// +// Rationale: +// Even though most users today use window managers to run programs and not +// xterms, many XWindow programs will not display any kind of error dialog +// if there is some error that prevents them to run, but instead produce +// some sort of error message on stdout or stderr and set the exit code to +// nonzero. While this makes them easier for scripting purposes, this will +// leave a user unfamiliar with UNIX a bit baffled - they will click the +// shiny icon and nothing will happen. This function should help a window +// manager or program launcher to do something smart about it. + +#define MAXBUF 10000 + +int PtyProcess::runChild() +{ + int ret = NotExited; + int nbytes; + char buf[256]; + + const char *message = _("\n *** Further output ommitted by Edelib ***\n"); + + while (ret == NotExited) { + while (1) { + nbytes = read(m_Fd, buf, 255); + if (nbytes == -1) + { + if (errno == EINTR) + continue; + else break; + } + if (nbytes == 0) + break; // eof + + buf[nbytes] = '\0'; + + // We don't want m_Inbuf to grow too big + if (m_Inbuf && strlen(m_Inbuf)<=MAXBUF) { + m_Inbuf = (char*)realloc(m_Inbuf, strlen(m_Inbuf)+nbytes+1); + strcat(m_Inbuf, buf); + + } else if (m_Inbuf == 0) + m_Inbuf = strdup(buf); + } + ret = checkPidExited(m_Pid); + } + + if (m_Inbuf && strlen(m_Inbuf)>MAXBUF) { + // Attach message about cutting out the rest + m_Inbuf = (char*)realloc(m_Inbuf, strlen(m_Inbuf)+strlen(message)); + strcat(m_Inbuf, message); + } + return ret; +} + +/* + * Copy output to stdout until the child process exists, or a line of output + * matches `m_Exit'. + * We have to use waitpid() to test for exit. Merely waiting for EOF on the + * pty does not work, because the target process may have children still + * attached to the terminal. + */ + +int PtyProcess::waitForChild() +{ + int retval = 1; + + fd_set fds; + FD_ZERO(&fds); + + + while (1) + { + FD_SET(m_Fd, &fds); + int ret = select(m_Fd+1, &fds, 0L, 0L, 0L); + if (ret == -1) + { + if (errno != EINTR) + { +// kdError(900) << k_lineinfo << "select(): " << perror << "\n"; + return -1; + } + ret = 0; + } + + if (ret) + { + char *line = readLine(false); + while (line && strlen(line)>0) + { + if (m_Exit && strlen(m_Exit)>0 && !strncasecmp(line, m_Exit, strlen(m_Exit))) + kill(m_Pid, SIGTERM); + if (m_bTerminal) + { + fputs(line, stdout); + fputc('\n', stdout); + } + line = readLine(false); + } + } + + ret = checkPidExited(m_Pid); + if (ret == Error) + { + if (errno == ECHILD) retval = 0; + else retval = 1; + break; + } + else if (ret == Killed || ret == Crashed) + { + retval = 0; + break; + } + else if (ret == NotExited) + { + // keep checking + } + else + { + retval = ret; + break; + } + } + return retval; +} + +/* + * SetupTTY: Creates a new session. The filedescriptor "fd" should be + * connected to the tty. It is closed after the tty is reopened to make it + * our controlling terminal. This way the tty is always opened at least once + * so we'll never get EIO when reading from it. + */ + +int PtyProcess::SetupTTY(int fd) +{ + // Reset signal handlers + for (int sig = 1; sig < NSIG; sig++) + signal(sig, SIG_DFL); + signal(SIGHUP, SIG_IGN); + + // Close all file handles + struct rlimit rlp; + getrlimit(RLIMIT_NOFILE, &rlp); + for (int i = 0; i < (int)rlp.rlim_cur; i++) + if (i != fd) close(i); + + // Create a new session. + setsid(); + + // Open slave. This will make it our controlling terminal + int slave = open(m_TTY, O_RDWR); + if (slave < 0) + { + fprintf(stderr, "Edelib: PtyProcess: Could not open slave side: %s\n", strerror(errno)); + return -1; + } + close(fd); + +#if defined(__SVR4) && defined(sun) + + // Solaris STREAMS environment. + // Push these modules to make the stream look like a terminal. + ioctl(slave, I_PUSH, "ptem"); + ioctl(slave, I_PUSH, "ldterm"); + +#endif + +#ifdef TIOCSCTTY + ioctl(slave, TIOCSCTTY, NULL); +#endif + + // Connect stdin, stdout and stderr + dup2(slave, 0); dup2(slave, 1); dup2(slave, 2); + if (slave > 2) + close(slave); + + // Disable OPOST processing. Otherwise, '\n' are (on Linux at least) + // translated to '\r\n'. + struct termios tio; + if (tcgetattr(0, &tio) < 0) + { + fprintf (stderr, "Edelib: PtyProcess: tcgetattr(): %s\n", strerror(errno)); + return -1; + } + tio.c_oflag &= ~OPOST; + if (tcsetattr(0, TCSANOW, &tio) < 0) + { + fprintf(stderr, "Edelib: PtyProcess: tcsetattr(): %s\n", strerror(errno)); + return -1; + } + + return 0; +} + +void PtyProcess::virtual_hook( int, void* ) +{ /*BASE::virtual_hook( id, data );*/ } diff --git a/edelib2/process.h b/edelib2/process.h new file mode 100644 index 0000000..32c0962 --- /dev/null +++ b/edelib2/process.h @@ -0,0 +1,205 @@ +/* + * $Id$ + * + * edelib::PtyProcess - This class enables us to "chat" with terminal programs synchronously + * Adapted from KDE (kdelibs/kdesu/process.h) - original copyright message below + * + * Part of Equinox Desktop Environment (EDE). + * Copyright (c) 2000-2006 EDE Authors. + * + * This program is licenced under terms of the + * GNU General Public Licence version 2 or newer. + * See COPYING for details. + */ + + +/* vi: ts=8 sts=4 sw=4 + * + * Id: process.h 439322 2005-07-27 18:49:23Z coolo + * + * This file is part of the KDE project, module kdesu. + * Copyright (C) 1999,2000 Geert Jansen + * + * This is free software; you can use this library under the GNU Library + * General Public License, version 2. See the file "COPYING.LIB" for the + * exact licensing terms. + */ + +#ifndef _edelib_Process_h_ +#define _edelib_Process_h_ + +#include + +//#include +//#include +//#include +//#include + +//#include + +namespace edelib { + +class PTY; + +/** + * Synchronous communication with tty programs. + * + * PtyProcess provides synchronous communication with tty based programs. + * The communications channel used is a pseudo tty (as opposed to a pipe) + * This means that programs which require a terminal will work. + */ + +class PtyProcess +{ +public: + PtyProcess(); + virtual ~PtyProcess(); + + /** + * Forks off and execute a command. The command's standard in and output + * are connected to the pseudo tty. They are accessible with readLine + * and writeLine. + * @param command The command to execute. + * @param args The arguments to the command. + */ + int exec(const char *command, const char **args); + + /** + * Reads a line from the program's standard out. Depending on the @em block + * parameter, this call blocks until a single, full line is read. + * @param block Block until a full line is read? + * @return The output string. + */ + char *readLine(bool block=true); + + /** + * Writes a line of text to the program's standard in. + * @param line The text to write. + * @param addNewline Adds a '\n' to the line. + */ + void writeLine(const char *line, bool addNewline=true); + + /** + * Puts back a line of input. + * @param line The line to put back. + * @param addNewline Adds a '\n' to the line. + */ + void unreadLine(const char *line, bool addNewline=true); + + /** + * Sets the exit string. If a line of program output matches this, + * waitForChild() will terminate the program and return. + */ + void setExitString(char *exit) { m_Exit = exit; } + + /** + * Waits for the child to exit, capturing all output. + */ + int runChild(); + + /** + * Waits for the child to exit. See also setExitString. + */ + int waitForChild(); + + /** + * Waits until the pty has cleared the ECHO flag. This is useful + * when programs write a password prompt before they disable ECHO. + * Disabling it might flush any input that was written. + */ + int WaitSlave(); + + /** + * Enables/disables local echo on the pseudo tty. + */ + int enableLocalEcho(bool enable=true); + + /** + * Enables/disables terminal output. Relevant only to some subclasses. + */ + void setTerminal(bool terminal) { m_bTerminal = terminal; } + + /** + * Overwrites the password as soon as it is used. Relevant only to + * some subclasses. + */ + void setErase(bool erase) { m_bErase = erase; } + + /** + * Set additinal environment variables. + */ + void setEnvironment( const char **env ); + + /** + * Returns the filedescriptor of the process. + */ + inline int fd() const {return m_Fd;}; + + /** + * Returns the pid of the process. + */ + inline int pid() const {return m_Pid;}; + +public /* static */: + /* + ** This is a collection of static functions that can be + ** used for process control inside kdesu. I'd suggest + ** against using this publicly. There are probably + ** nicer Qt based ways to do what you want. + */ + + /* + ** Wait @p ms miliseconds (ie. 1/10th of a second is 100ms), + ** using @p fd as a filedescriptor to wait on. Returns + ** select(2)'s result, which is -1 on error, 0 on timeout, + ** or positive if there is data on one of the selected fd's. + ** + ** @p ms must be in the range 0..999 (ie. the maximum wait + ** duration is 999ms, almost one second). + */ + static int waitMS(int fd,int ms); + + + /* + ** Basic check for the existence of @p pid. + ** Returns true iff @p pid is an extant process, + ** (one you could kill - see man kill(2) for signal 0). + */ + static bool checkPid(pid_t pid); + + /* + ** Check process exit status for process @p pid. + ** On error (no child, no exit), return -1. + ** If child @p pid has exited, return its exit status, + ** (which may be zero). + ** If child @p has not exited, return -2. + */ + enum checkPidStatus { Error=-1, NotExited=-2, Killed=-3, Crashed=-4 } ; + static int checkPidExited(pid_t pid); + + +protected: + char **environment() const; + + bool m_bErase, m_bTerminal; + int m_Pid, m_Fd; + char *m_Command, *m_Exit; + +private: + int init(); + int SetupTTY(int fd); + + PTY *m_pPTY; + char *m_Inbuf, *m_TTY; + +protected: + virtual void virtual_hook( int id, void* data ); +private: + class PtyProcessPrivate; + PtyProcessPrivate *d; +}; + + +} + +#endif diff --git a/edelib2/pty.cpp b/edelib2/pty.cpp new file mode 100644 index 0000000..6f8e161 --- /dev/null +++ b/edelib2/pty.cpp @@ -0,0 +1,353 @@ +/* + * $Id$ + * + * edelib::PTY - A class for handling pseudoterminals (PTYs) + * Adapted from KDE (kdelibs/kdesu/kdesu_pty.cpp) - original copyright message below + * + * Part of Equinox Desktop Environment (EDE). + * Copyright (c) 2000-2006 EDE Authors. + * + * This program is licenced under terms of the + * GNU General Public Licence version 2 or newer. + * See COPYING for details. + */ + + +/* vi: ts=8 sts=4 sw=4 + * + * $Id$ + * + * This file is part of the KDE project, module kdesu. + * Copyright (C) 1999,2000 Geert Jansen + * + * This file contains code from TEShell.C of the KDE konsole. + * Copyright (c) 1997,1998 by Lars Doelle + * + * This is free software; you can use this library under the GNU Library + * General Public License, version 2. See the file "COPYING.LIB" for the + * exact licensing terms. + * + * pty.cpp: Access to PTY's on different systems a la UNIX98. + */ + + +#ifndef _GNU_SOURCE +#define _GNU_SOURCE /* Needed for getpt, ptsname in glibc 2.1.x systems */ +#endif + +//#include + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#if defined(__osf__) || defined(__CYGWIN__) +#include +#endif + +//#include + +//#include +//#include +#include "pty.h" + +// FIXME: Blah defines +#define HAVE_GETPT +#define HAVE_PTSNAME +#define HAVE_GRANTPT +#define HAVE_UNLOCKPT + +// stdlib.h is meant to declare the prototypes but doesn't :( +#ifndef __THROW +#define __THROW +#endif + +#ifdef HAVE_GRANTPT +extern "C" int grantpt(int fd) __THROW; +#endif + +#ifdef HAVE_PTSNAME +extern "C" char * ptsname(int fd) __THROW; +#endif + +#ifdef HAVE_UNLOCKPT +extern "C" int unlockpt(int fd) __THROW; +#endif + +#ifdef HAVE__GETPTY +extern "C" char *_getpty(int *, int, mode_t, int); +#endif + +#ifdef HAVE__PTY_H + #include +#endif + +#include + +#ifdef HAVE_LIBUTIL_H + #include +#elif defined(HAVE_UTIL_H) + #include +#endif + + +using namespace edelib; + + +void *qalloc(void *ptr, size_t size) +{ + if (ptr) + return realloc (ptr, size); + else + return malloc (size); +} + + +PTY::PTY() +{ + ptyfd = -1; + ptyname = ttyname = 0; +} + +PTY::~PTY() +{ + if (ptyfd >= 0) + close(ptyfd); + if (ptyname) free (ptyname); + if (ttyname) free (ttyname); +} + + +// Opens a pty master and returns its filedescriptor. + +int PTY::getpt() +{ + +#if defined(HAVE_GETPT) && defined(HAVE_PTSNAME) + + // 1: UNIX98: preferred way + ptyfd = ::getpt(); + ttyname = strdup(::ptsname(ptyfd)); + return ptyfd; + +#elif defined(HAVE_OPENPTY) + +#define MAXNAME 30 + + // 2: BSD interface + // More preferred than the linux hacks + char name[MAXNAME]; + int master_fd, slave_fd; + if (openpty(&master_fd, &slave_fd, name, 0L, 0L) != -1) { + ttyname = (char*)qalloc(ttyname,MAXNAME); + strncpy(ttyname, name, MAXNAME); + name[5]='p'; + ptyname = (char*)qalloc(ptyname,MAXNAME); + strncpy(ptyname, name, MAXNAME); + close(slave_fd); // We don't need this yet // Yes, we do. + ptyfd = master_fd; + return ptyfd; + } + ptyfd = -1; +// kdDebug(900) << k_lineinfo << "Opening pty failed.\n"; + return -1; + +#elif defined(HAVE__GETPTY) + + // 3: Irix interface + int master_fd; + char *tmp = _getpty(&master_fd,O_RDWR,0600,0); + if (tmp) { + ttyname = strdup(tmp); + ptyfd = master_fd; + } else { + ptyfd = -1; +// kdDebug(900) << k_lineinfo << "Opening pty failed.error" << errno << '\n'; + } + return ptyfd; + +#else + + // 4: Open terminal device directly + // 4.1: Try /dev/ptmx first. (Linux w/ Unix98 PTYs, Solaris) + + ptyfd = open("/dev/ptmx", O_RDWR); + if (ptyfd >= 0) { + ptyname = strdup("/dev/ptmx"); +#ifdef HAVE_PTSNAME + ttyname = strdup(::ptsname(ptyfd)); + return ptyfd; +#elif defined (TIOCGPTN) + int ptyno; + if (ioctl(ptyfd, TIOCGPTN, &ptyno) == 0) { + ttyname = (char*)qalloc(ttyname,MAXNAME); + snprintf(ttyname,MAXNAME-1,"/dev/pts/%d", ptyno); + return ptyfd; + } +#endif + close(ptyfd); + } + + // 4.2: Try /dev/pty[p-e][0-f] (Linux w/o UNIX98 PTY's) + + for (const char *c1 = "pqrstuvwxyzabcde"; *c1 != '\0'; c1++) + { + for (const char *c2 = "0123456789abcdef"; *c2 != '\0'; c2++) + { + ptyname = (char*)qalloc(ptyname,strlen("/dev/pty12")); + ttyname = (char*)qalloc(ttyname,strlen("/dev/tty12")); + sprintf(ptyname, "/dev/pty%c%c", *c1, *c2); + sprintf(ttyname, "/dev/tty%c%c", *c1, *c2); + if (access(ptyname, F_OK) < 0) + goto linux_out; + ptyfd = open(ptyname, O_RDWR); + if (ptyfd >= 0) + return ptyfd; + } + } +linux_out: + + // 4.3: Try /dev/pty%d (SCO, Unixware) + + for (int i=0; i<256; i++) + { + ptyname = (char*)qalloc(ptyname,MAXNAME); + ttyname = (char*)qalloc(ttyname,MAXNAME); + snprintf(ptyname, MAXNAME-1, "/dev/ptyp%d", i); + snprintf(ttyname, MAXNAME-1, "/dev/ttyp%d", i); + if (access(ptyname, F_OK) < 0) + break; + ptyfd = open(ptyname, O_RDWR); + if (ptyfd >= 0) + return ptyfd; + } + + + // Other systems ?? + ptyfd = -1; +// kdDebug(900) << k_lineinfo << "Unknown system or all methods failed.\n"; + return -1; + +#endif // HAVE_GETPT && HAVE_PTSNAME + +} + + +int PTY::grantpt() +{ + if (ptyfd < 0) + return -1; + +#ifdef HAVE_GRANTPT + + return ::grantpt(ptyfd); + +#elif defined(HAVE_OPENPTY) + + // the BSD openpty() interface chowns the devices properly for us, + // no need to do this at all + return 0; + +#else + + // konsole_grantpty only does /dev/pty?? + if (strncmp(ptyname, "/dev/pty", 8) != 0) + return 0; + + fprintf (stderr, "Edelib: Pty: Your system doesn't have capabilities for PTYs and we don't implement them."); + return -1; + + // Use konsole_grantpty: +// if (KStandardDirs::findExe("konsole_grantpty").isEmpty()) +// { +// kdError(900) << k_lineinfo << "konsole_grantpty not found.\n"; +// return -1; +// } + + // As defined in konsole_grantpty.c + const int pty_fileno = 3; + + pid_t pid; + if ((pid = fork()) == -1) + { +// kdError(900) << k_lineinfo << "fork(): " << perror << "\n"; + return -1; + } + + if (pid) + { + // Parent: wait for child + int ret; + waitpid(pid, &ret, 0); + if (WIFEXITED(ret) && !WEXITSTATUS(ret)) + return 0; +// kdError(900) << k_lineinfo << "konsole_grantpty returned with error: " +// << WEXITSTATUS(ret) << "\n"; + return -1; + } else + { + // Child: exec konsole_grantpty + if (ptyfd != pty_fileno && dup2(ptyfd, pty_fileno) < 0) + _exit(1); + execlp("konsole_grantpty", "konsole_grantpty", "--grant", (void *)0); +// kdError(900) << k_lineinfo << "exec(): " << perror << "\n"; + _exit(1); + } + + // shut up, gcc + return 0; + +#endif // HAVE_GRANTPT +} + + +/** + * Unlock the pty. This allows connections on the slave side. + */ + +int PTY::unlockpt() +{ + if (ptyfd < 0) + return -1; + +#ifdef HAVE_UNLOCKPT + + // (Linux w/ glibc 2.1, Solaris, ...) + + return ::unlockpt(ptyfd); + +#elif defined(TIOCSPTLCK) + + // Unlock pty (Linux w/ UNIX98 PTY's & glibc 2.0) + int flag = 0; + return ioctl(ptyfd, TIOCSPTLCK, &flag); + +#else + + // Other systems (Linux w/o UNIX98 PTY's, ...) + return 0; + +#endif + +} + + +/** + * Return the slave side name. + */ + +const char *PTY::ptsname() +{ + if (ptyfd < 0) + return 0; + + return ttyname; +} + diff --git a/edelib2/pty.h b/edelib2/pty.h new file mode 100644 index 0000000..0d4d6d3 --- /dev/null +++ b/edelib2/pty.h @@ -0,0 +1,90 @@ +/* + * $Id$ + * + * edelib::PTY - A class for handling pseudoterminals (PTYs) + * Adapted from KDE (kdelibs/kdesu/kdesu_pty.h) - original copyright message below + * + * Part of Equinox Desktop Environment (EDE). + * Copyright (c) 2000-2006 EDE Authors. + * + * This program is licenced under terms of the + * GNU General Public Licence version 2 or newer. + * See COPYING for details. + */ + + +/* vi: ts=8 sts=4 sw=4 + * + * Id: kdesu_pty.h 439322 2005-07-27 18:49:23Z coolo + * + * This file is part of the KDE project, module kdesu. + * Copyright (C) 1999,2000 Geert Jansen + * + * This is free software; you can use this library under the GNU Library + * General Public License, version 2. See the file "COPYING.LIB" for the + * exact licensing terms. + */ + + +/** + * PTY compatibility routines. This class tries to emulate a UNIX98 PTY API + * on various platforms. + */ +#ifndef _edelib_PTY_h_ +#define _edelib_PTY_h_ + +//#include + +//#include + +namespace edelib { + +class PTY { + +public: + /** + * Construct a PTY object. + */ + PTY(); + + /** + * Destructs the object. The PTY is closed if it is still open. + */ + ~PTY(); + + /** + * Allocate a pty. + * @return A filedescriptor to the master side. + */ + int getpt(); + + /** + * Grant access to the slave side. + * @return Zero if succesfull, < 0 otherwise. + */ + int grantpt(); + + /** + * Unlock the slave side. + * @return Zero if successful, < 0 otherwise. + */ + int unlockpt(); + + /** + * Get the slave name. + * @return The slave name. + */ + const char *ptsname(); + +private: + + int ptyfd; + char *ptyname, *ttyname; + + class PTYPrivate; + PTYPrivate *d; +}; + +} + +#endif // _edelib_PTY_h_ diff --git a/edewm/Atoms.cpp b/edewm/Atoms.cpp new file mode 100644 index 0000000..dbeafa7 --- /dev/null +++ b/edewm/Atoms.cpp @@ -0,0 +1,243 @@ +/* + * $Id$ + * + * Edewm, window manager + * Part of Equinox Desktop Environment (EDE). + * Copyright (c) 2000-2006 EDE Authors. + * + * This program is licenced under terms of the + * GNU General Public Licence version 2 or newer. + * See COPYING for details. + */ + +#include "Atoms.h" +#include + +// Icccm atoms +Atom _XA_WM_PROTOCOLS; +Atom _XA_WM_DELETE_WINDOW; +Atom _XA_WM_STATE; +Atom _XA_WM_CHANGE_STATE; +Atom _XA_WM_COLORMAP_WINDOWS; +Atom _XA_WM_TAKE_FOCUS; + +Atom _XA_UTF8_STRING; + +// Motif atoms +Atom _XA_MOTIF_HINTS; + +// Netwm atoms +Atom _XA_NET_SUPPORTED; +Atom _XA_NET_SUPPORTING_WM_CHECK; + +Atom _XA_NET_NUMBER_OF_DESKTOPS; +Atom _XA_NET_DESKTOP_GEOMETRY; +Atom _XA_NET_DESKTOP_VIEWPORT; +Atom _XA_NET_CURRENT_DESKTOP; +Atom _XA_NET_DESKTOP_NAMES; +Atom _XA_NET_ACTIVE_WINDOW; +Atom _XA_NET_WORKAREA; +Atom _XA_NET_SHOWING_DESKTOP; +// other root messages +Atom _XA_NET_CLOSE_WINDOW; +Atom _XA_NET_MOVERESIZE_WINDOW; +Atom _XA_NET_RESTACK_WINDOW; +Atom _XA_NET_REQUEST_FRAME_EXTENTS; + +// application messages +Atom _XA_NET_WM_NAME; +Atom _XA_NET_WM_WINDOW_TYPE; +Atom _XA_NET_WM_WINDOW_TYPE_NORMAL; +Atom _XA_NET_WM_WINDOW_TYPE_DOCK; +Atom _XA_NET_WM_WINDOW_TYPE_TOOLBAR; +Atom _XA_NET_WM_WINDOW_TYPE_MENU; +Atom _XA_NET_WM_WINDOW_TYPE_UTIL; +Atom _XA_NET_WM_WINDOW_TYPE_DIALOG; +Atom _XA_NET_WM_WINDOW_TYPE_SPLASH; +Atom _XA_NET_WM_WINDOW_TYPE_DESKTOP; + +// our messages +Atom _XA_EDE_WM_STARTUP_NOTIFY; +Atom _XA_EDE_WM_APP_STARTING; + +// only for debugging +Atom _XA_NET_VIRTUAL_ROOTS; +Atom _XA_NET_DESKTOP_LAYOUT; +Atom _XA_NET_WM_MOVERESIZE; +Atom _XA_NET_WM_VISIBLE_NAME; +Atom _XA_NET_WM_ICON_NAME; +Atom _XA_NET_WM_ICON_VISIBLE_NAME; +Atom _XA_NET_WM_DESKTOP; +Atom _XA_NET_WM_STATE; +Atom _XA_NET_WM_STATE_MODAL; //Needs transient for (root for whole group) +Atom _XA_NET_WM_STATE_STICKY; //Pos fixed, even if virt. desk. scrolls +Atom _XA_NET_WM_STATE_MAXIMIZED_VERT; +Atom _XA_NET_WM_STATE_MAXIMIZED_HORZ; +Atom _XA_NET_WM_STATE_SHADED; +Atom _XA_NET_WM_STATE_SKIP_TASKBAR; +Atom _XA_NET_WM_STATE_SKIP_PAGER; +Atom _XA_NET_WM_STATE_HIDDEN; +Atom _XA_NET_WM_STATE_FULLSCREEN; +Atom _XA_NET_WM_STATE_ABOVE; +Atom _XA_NET_WM_STATE_BELOW; +Atom _XA_NET_WM_STATE_DEMANDS_ATTENTION; +Atom _XA_NET_WM_ALLOWED_ACTIONS; +Atom _XA_NET_WM_ACTION_MOVE; +Atom _XA_NET_WM_ACTION_RESIZE; +Atom _XA_NET_WM_ACTION_MINIMIZE; +Atom _XA_NET_WM_ACTION_SHADE; +Atom _XA_NET_WM_ACTION_STICK; +Atom _XA_NET_WM_ACTION_MAXIMIZE_HORZ; +Atom _XA_NET_WM_ACTION_MAXIMIZE_VERT; +Atom _XA_NET_WM_ACTION_FULLSCREEN; +Atom _XA_NET_WM_ACTION_CHANGE_DESKTOP; +Atom _XA_NET_WM_ACTION_CLOSE; +Atom _XA_NET_WM_STRUT; +Atom _XA_NET_WM_STRUT_PARTIAL; +Atom _XA_NET_WM_ICON_GEOMETRY; +Atom _XA_NET_WM_ICON; +Atom _XA_NET_WM_PID; +Atom _XA_NET_WM_HANDLED_ICONS; +Atom _XA_NET_WM_USER_TIME; +Atom _XA_NET_FRAME_EXTENTS; +Atom _XA_NET_WM_PING; +Atom _XA_NET_WM_SYNC_REQUEST; +Atom _XA_NET_WM_STATE_STAYS_ON_TOP; +Atom _XA_KWM_WIN_ICON; + + +#ifdef _DEBUG + #define REGISTER_ATOM(id, name) \ + id = XInternAtom(fl_display, name, False);\ + atoms_map[id] = name +#else + #define REGISTER_ATOM(id, name) \ + id = XInternAtom(fl_display, name, False) +#endif + +#define COUNT(x) (sizeof(x)/sizeof(x[0])) + +#ifdef _DEBUG +void InitAtoms(Display* display, std::map& atoms_map) +#else +void InitAtoms(Display* display) +#endif +{ + // Icccm + REGISTER_ATOM(_XA_WM_PROTOCOLS, "WM_PROTOCOLS"); + REGISTER_ATOM(_XA_WM_DELETE_WINDOW, "WM_DELETE_WINDOW"); + REGISTER_ATOM(_XA_WM_STATE, "WM_STATE"); + REGISTER_ATOM(_XA_WM_CHANGE_STATE, "WM_CHANGE_STATE"); + REGISTER_ATOM(_XA_WM_COLORMAP_WINDOWS, "WM_COLORMAP_WINDOWS"); + REGISTER_ATOM(_XA_WM_TAKE_FOCUS, "WM_TAKE_FOCUS"); + + REGISTER_ATOM(_XA_UTF8_STRING, "UTF8_STRING"); + + // Motif + REGISTER_ATOM(_XA_MOTIF_HINTS, "_MOTIF_WM_HINTS"); + + // Netwm + REGISTER_ATOM(_XA_NET_SUPPORTED, "_NET_SUPPORTED"); + REGISTER_ATOM(_XA_NET_SUPPORTING_WM_CHECK, "_NET_SUPPORTING_WM_CHECK"); + REGISTER_ATOM(_XA_NET_NUMBER_OF_DESKTOPS, "_NET_NUMBER_OF_DESKTOPS"); + REGISTER_ATOM(_XA_NET_DESKTOP_GEOMETRY, "_NET_DESKTOP_GEOMETRY"); + REGISTER_ATOM(_XA_NET_DESKTOP_VIEWPORT, "_NET_DESKTOP_VIEWPORT"); + REGISTER_ATOM(_XA_NET_CURRENT_DESKTOP, "_NET_CURRENT_DESKTOP"); + REGISTER_ATOM(_XA_NET_DESKTOP_NAMES, "_NET_DESKTOP_NAMES"); + REGISTER_ATOM(_XA_NET_ACTIVE_WINDOW, "_NET_ACTIVE_WINDOW"); + REGISTER_ATOM(_XA_NET_WORKAREA, "_NET_WORKAREA"); + REGISTER_ATOM(_XA_NET_SHOWING_DESKTOP, "_NET_SHOWING_DESKTOP"); + + // other root messages + REGISTER_ATOM(_XA_NET_CLOSE_WINDOW, "_NET_CLOSE_WINDOW"); + REGISTER_ATOM(_XA_NET_MOVERESIZE_WINDOW, "_NET_MOVERESIZE_WINDOW"); + REGISTER_ATOM(_XA_NET_RESTACK_WINDOW, "_NET_RESTACK_WINDOW"); + REGISTER_ATOM(_XA_NET_REQUEST_FRAME_EXTENTS, "_NET_REQUEST_FRAME_EXTENTS"); + + REGISTER_ATOM(_XA_NET_WM_NAME, "_NET_WM_NAME"); + REGISTER_ATOM(_XA_NET_WM_WINDOW_TYPE, "_NET_WM_WINDOW_TYPE"); + REGISTER_ATOM(_XA_NET_WM_WINDOW_TYPE_NORMAL, "_NET_WM_WINDOW_TYPE_NORMAL"); + REGISTER_ATOM(_XA_NET_WM_WINDOW_TYPE_DOCK, "_NET_WM_WINDOW_TYPE_DOCK"); + REGISTER_ATOM(_XA_NET_WM_WINDOW_TYPE_TOOLBAR, "_NET_WM_WINDOW_TYPE_TOOLBAR"); + REGISTER_ATOM(_XA_NET_WM_WINDOW_TYPE_MENU, "_NET_WM_WINDOW_TYPE_MENU"); + REGISTER_ATOM(_XA_NET_WM_WINDOW_TYPE_UTIL, "_NET_WM_WINDOW_TYPE_UTIL"); + REGISTER_ATOM(_XA_NET_WM_WINDOW_TYPE_DIALOG, "_NET_WM_WINDOW_TYPE_DIALOG"); + REGISTER_ATOM(_XA_NET_WM_WINDOW_TYPE_DIALOG, "_NET_WM_WINDOW_TYPE_SPLASH"); + REGISTER_ATOM(_XA_NET_WM_WINDOW_TYPE_DESKTOP, "_NET_WM_WINDOW_TYPE_DESKTOP"); + + // window messages + REGISTER_ATOM(_XA_NET_WM_STATE, "_NET_WM_STATE"); + REGISTER_ATOM(_XA_NET_WM_STATE_MAXIMIZED_VERT,"_NET_WM_STATE_MAXIMIZED_VERT"); + REGISTER_ATOM(_XA_NET_WM_STATE_MAXIMIZED_HORZ,"_NET_WM_STATE_MAXIMIZED_HORZ"); + REGISTER_ATOM(_XA_NET_WM_STATE_SHADED, "_NET_WM_STATE_SHADED"); + REGISTER_ATOM(_XA_NET_WM_STATE_ABOVE, "_NET_WM_STATE_ABOVE"); + REGISTER_ATOM(_XA_NET_WM_STATE_BELOW, "_NET_WM_STATE_BELOW"); + + // our messages + REGISTER_ATOM(_XA_EDE_WM_STARTUP_NOTIFY, "_EDE_WM_STARTUP_NOTIFY"); + REGISTER_ATOM(_XA_EDE_WM_APP_STARTING, "_EDE_WM_APP_STARTING"); + + // debugging stuff (aka. not implemented) + REGISTER_ATOM(_XA_NET_VIRTUAL_ROOTS, "_NET_VIRTUAL_ROOTS"); + REGISTER_ATOM(_XA_NET_DESKTOP_LAYOUT, "_NET_DESKTOP_LAYOUT"); + REGISTER_ATOM(_XA_NET_WM_MOVERESIZE, "_NET_WM_MOVERESIZE"); + REGISTER_ATOM(_XA_NET_WM_VISIBLE_NAME, "_NET_WM_VISIBLE_NAME"); + REGISTER_ATOM(_XA_NET_WM_ICON_NAME, "_NET_WM_ICON_NAME"); + REGISTER_ATOM(_XA_NET_WM_ICON_VISIBLE_NAME, "_NET_WM_ICON_VISIBLE_NAME"); + REGISTER_ATOM(_XA_NET_WM_DESKTOP, "_NET_WM_DESKTOP"); + REGISTER_ATOM(_XA_NET_WM_STATE_MODAL, "_NET_WM_STATE_MODAL"); + REGISTER_ATOM(_XA_NET_WM_STATE_STICKY, "_NET_WM_STATE_STICKY"); + REGISTER_ATOM(_XA_NET_WM_STATE_SKIP_TASKBAR, "_NET_WM_STATE_SKIP_TASKBAR"); + REGISTER_ATOM(_XA_NET_WM_STATE_SKIP_PAGER, "_NET_WM_STATE_SKIP_PAGER"); + REGISTER_ATOM(_XA_NET_WM_STATE_HIDDEN, "_NET_WM_STATE_HIDDEN"); + REGISTER_ATOM(_XA_NET_WM_STATE_FULLSCREEN, "_NET_WM_STATE_FULLSCREEN"); + REGISTER_ATOM(_XA_NET_WM_STATE_DEMANDS_ATTENTION, "_NET_WM_STATE_DEMANDS_ATTENTION"); + REGISTER_ATOM(_XA_NET_WM_ALLOWED_ACTIONS, "_NET_WM_ALLOWED_ACTIONS"); + REGISTER_ATOM(_XA_NET_WM_ACTION_MOVE, "_NET_WM_ACTION_MOVE"); + REGISTER_ATOM(_XA_NET_WM_ACTION_RESIZE, "_NET_WM_ACTION_RESIZE"); + REGISTER_ATOM(_XA_NET_WM_ACTION_MINIMIZE, "_NET_WM_ACTION_MINIMIZE"); + REGISTER_ATOM(_XA_NET_WM_ACTION_SHADE, "_NET_WM_ACTION_SHADE"); + REGISTER_ATOM(_XA_NET_WM_ACTION_STICK, "_NET_WM_ACTION_STICK"); + REGISTER_ATOM(_XA_NET_WM_ACTION_MAXIMIZE_HORZ,"_NET_WM_ACTION_MAXIMIZE_HORZ"); + REGISTER_ATOM(_XA_NET_WM_ACTION_MAXIMIZE_VERT,"_NET_WM_ACTION_MAXIMIZE_VERT"); + REGISTER_ATOM(_XA_NET_WM_ACTION_FULLSCREEN, "_NET_WM_ACTION_FULLSCREEN"); + REGISTER_ATOM(_XA_NET_WM_ACTION_CHANGE_DESKTOP,"_NET_WM_ACTION_CHANGE_DESKTOP"); + REGISTER_ATOM(_XA_NET_WM_ACTION_CLOSE, "_NET_WM_ACTION_CLOSE"); + REGISTER_ATOM(_XA_NET_WM_STRUT, "_NET_WM_STRUT"); + REGISTER_ATOM(_XA_NET_WM_STRUT_PARTIAL, "_NET_WM_STRUT_PARTIAL"); + REGISTER_ATOM(_XA_NET_WM_ICON_GEOMETRY, "_NET_WM_ICON_GEOMETRY"); + REGISTER_ATOM(_XA_NET_WM_ICON, "_NET_WM_ICON"); + REGISTER_ATOM(_XA_NET_WM_PID, "_NET_WM_PID"); + REGISTER_ATOM(_XA_NET_WM_HANDLED_ICONS, "_NET_WM_HANDLED_ICONS"); + REGISTER_ATOM(_XA_NET_WM_USER_TIME, "_NET_WM_USER_TIME"); + REGISTER_ATOM(_XA_NET_FRAME_EXTENTS, "_NET_FRAME_EXTENTS"); + REGISTER_ATOM(_XA_NET_WM_PING, "_NET_WM_PING"); + REGISTER_ATOM(_XA_NET_WM_SYNC_REQUEST, "_NET_WM_SYNC_REQUEST"); + REGISTER_ATOM(_XA_NET_WM_STATE_STAYS_ON_TOP, "_NET_WM_STATE_STAYS_ON_TOP"); + REGISTER_ATOM(_XA_KWM_WIN_ICON, "_KWM_WIN_ICON"); +} + +// these are list of current implemented atoms +void SetSupported(Window root) +{ + Atom atoms[] = + { + _XA_NET_SUPPORTED, + _XA_NET_SUPPORTING_WM_CHECK, + + _XA_NET_WM_NAME, + _XA_NET_WM_WINDOW_TYPE, + _XA_NET_WM_WINDOW_TYPE_NORMAL, + _XA_NET_WM_WINDOW_TYPE_DOCK, + _XA_NET_WM_WINDOW_TYPE_TOOLBAR, + _XA_NET_WM_WINDOW_TYPE_MENU, + _XA_NET_WM_WINDOW_TYPE_UTIL, + _XA_NET_WM_WINDOW_TYPE_DIALOG, + _XA_NET_WM_WINDOW_TYPE_SPLASH, + _XA_NET_WM_WINDOW_TYPE_DESKTOP + }; + + XChangeProperty(fl_display, root, _XA_NET_SUPPORTED, XA_ATOM, 32, PropModeReplace, + (unsigned char*)atoms, COUNT(atoms)); +} + diff --git a/edewm/Atoms.h b/edewm/Atoms.h new file mode 100644 index 0000000..9ad741b --- /dev/null +++ b/edewm/Atoms.h @@ -0,0 +1,131 @@ +/* + * $Id$ + * + * Edewm, window manager + * Part of Equinox Desktop Environment (EDE). + * Copyright (c) 2000-2006 EDE Authors. + * + * This program is licenced under terms of the + * GNU General Public Licence version 2 or newer. + * See COPYING for details. + */ + +#ifndef __ATOMS_H__ +#define __ATOMS_H__ + +#ifdef _DEBUG +#include +#endif + +#include + +// Icccm atoms +extern Atom _XA_WM_PROTOCOLS; +extern Atom _XA_WM_DELETE_WINDOW; +extern Atom _XA_WM_STATE; +extern Atom _XA_WM_CHANGE_STATE; +extern Atom _XA_WM_COLORMAP_WINDOWS; +extern Atom _XA_WM_TAKE_FOCUS; + +extern Atom _XA_UTF8_STRING; + +// Motif atoms +extern Atom _XA_MOTIF_HINTS; + +// Netwm atoms +// root messages +extern Atom _XA_NET_SUPPORTED; +extern Atom _XA_NET_SUPPORTING_WM_CHECK; +extern Atom _XA_NET_NUMBER_OF_DESKTOPS; +extern Atom _XA_NET_DESKTOP_GEOMETRY; +extern Atom _XA_NET_DESKTOP_VIEWPORT; +extern Atom _XA_NET_CURRENT_DESKTOP; +extern Atom _XA_NET_DESKTOP_NAMES; +extern Atom _XA_NET_ACTIVE_WINDOW; +extern Atom _XA_NET_WORKAREA; +extern Atom _XA_NET_SHOWING_DESKTOP; +// other root messages +extern Atom _XA_NET_CLOSE_WINDOW; +extern Atom _XA_NET_MOVERESIZE_WINDOW; +extern Atom _XA_NET_RESTACK_WINDOW; +extern Atom _XA_NET_REQUEST_FRAME_EXTENTS; + +// application messages +extern Atom _XA_NET_WM_NAME; +extern Atom _XA_NET_WM_WINDOW_TYPE; + extern Atom _XA_NET_WM_WINDOW_TYPE_NORMAL; + extern Atom _XA_NET_WM_WINDOW_TYPE_DOCK; + extern Atom _XA_NET_WM_WINDOW_TYPE_TOOLBAR; + extern Atom _XA_NET_WM_WINDOW_TYPE_MENU; + extern Atom _XA_NET_WM_WINDOW_TYPE_UTIL; + extern Atom _XA_NET_WM_WINDOW_TYPE_DIALOG; + extern Atom _XA_NET_WM_WINDOW_TYPE_SPLASH; + extern Atom _XA_NET_WM_WINDOW_TYPE_DESKTOP; + +extern Atom _XA_NET_WM_STATE_SHADED; +extern Atom _XA_NET_WM_STATE_MAXIMIZED_VERT; +extern Atom _XA_NET_WM_STATE_MAXIMIZED_HORZ; +extern Atom _XA_NET_WM_STATE_ABOVE; +extern Atom _XA_NET_WM_STATE_BELOW; + +// how to apply above states +#define _NET_WM_STATE_REMOVE 0 // remove/unset property +#define _NET_WM_STATE_ADD 1 // add/set property +#define _NET_WM_STATE_TOGGLE 2 // toggle property + +// our messages +extern Atom _XA_EDE_WM_STARTUP_NOTIFY; + extern Atom _XA_EDE_WM_APP_STARTING; + +// atoms for debugging (not implemented) +extern Atom _XA_NET_VIRTUAL_ROOTS; +extern Atom _XA_NET_DESKTOP_LAYOUT; +extern Atom _XA_NET_WM_MOVERESIZE; +extern Atom _XA_NET_RESTACK_WINDOW; +extern Atom _XA_NET_REQUEST_FRAME_EXTENTS; +extern Atom _XA_NET_WM_NAME; +extern Atom _XA_NET_WM_VISIBLE_NAME; +extern Atom _XA_NET_WM_ICON_NAME; +extern Atom _XA_NET_WM_ICON_VISIBLE_NAME; +extern Atom _XA_NET_WM_DESKTOP; +extern Atom _XA_NET_WM_STATE; +extern Atom _XA_NET_WM_STATE_MODAL; //Needs transient for (root for whole group) +extern Atom _XA_NET_WM_STATE_STICKY; //Pos fixed, even if virt. desk. scrolls +extern Atom _XA_NET_WM_STATE_SKIP_TASKBAR; +extern Atom _XA_NET_WM_STATE_SKIP_PAGER; +extern Atom _XA_NET_WM_STATE_HIDDEN; +extern Atom _XA_NET_WM_STATE_FULLSCREEN; +extern Atom _XA_NET_WM_STATE_DEMANDS_ATTENTION; + +extern Atom _XA_NET_WM_ALLOWED_ACTIONS; +extern Atom _XA_NET_WM_ACTION_MOVE; +extern Atom _XA_NET_WM_ACTION_RESIZE; +extern Atom _XA_NET_WM_ACTION_MINIMIZE; +extern Atom _XA_NET_WM_ACTION_SHADE; +extern Atom _XA_NET_WM_ACTION_STICK; +extern Atom _XA_NET_WM_ACTION_MAXIMIZE_HORZ; +extern Atom _XA_NET_WM_ACTION_MAXIMIZE_VERT; +extern Atom _XA_NET_WM_ACTION_FULLSCREEN; +extern Atom _XA_NET_WM_ACTION_CHANGE_DESKTOP; +extern Atom _XA_NET_WM_ACTION_CLOSE; +extern Atom _XA_NET_WM_STRUT; +extern Atom _XA_NET_WM_STRUT_PARTIAL; +extern Atom _XA_NET_WM_ICON_GEOMETRY; +extern Atom _XA_NET_WM_ICON; +extern Atom _XA_NET_WM_PID; +extern Atom _XA_NET_WM_HANDLED_ICONS; +extern Atom _XA_NET_WM_USER_TIME; +extern Atom _XA_NET_FRAME_EXTENTS; +extern Atom _XA_NET_WM_PING; +extern Atom _XA_NET_WM_SYNC_REQUEST; +extern Atom _XA_NET_WM_STATE_STAYS_ON_TOP; +extern Atom _XA_KWM_WIN_ICON; + +#ifdef _DEBUG + void InitAtoms(Display* display, std::map& atoms_map); +#else + void InitAtoms(Display* display); +#endif +void SetSupported(Window root); + +#endif // __ATOMS_H__ diff --git a/edewm/COMPLIANCE b/edewm/COMPLIANCE new file mode 100644 index 0000000..2d4e4c4 --- /dev/null +++ b/edewm/COMPLIANCE @@ -0,0 +1,128 @@ +$Id: COMPLIANCE 1688 2006-07-19 12:01:58Z karijes $ + +Edewm standards compliance +========================== + +Map: +---- + (?): pending for implementation + (+): implemented + (/): partially implemented + (x): listed in _NET_SUPPORTED, but not implemented + (-): probably will not be implemented + +Netwm compliance (http://freedesktop.org/Standards/wm-spec/) +============================================================ + +Root window +----------- + +(+) _NET_SUPPORTED, +(x) _NET_SUPPORTING_WM_CHECK +(?) _NET_CLIENT_LIST +(?) _NET_CLIENT_LIST_STACKING +(?) _NET_NUMBER_OF_DESKTOPS +(?) _NET_DESKTOP_GEOMETRY +(?) _NET_DESKTOP_VIEWPORT +(?) _NET_CURRENT_DESKTOP +(?) _NET_DESKTOP_NAMES +(?) _NET_ACTIVE_WINDOW +(?) _NET_WORKAREA +(?) _NET_SUPPORTING_WM_CHECK +(-) _NET_VIRTUAL_ROOTS +(?) _NET_DESKTOP_LAYOUT +(?) _NET_SHOWING_DESKTOP +(?) _NET_CLOSE_WINDOW +(?) _NET_MOVERESIZE_WINDOW +(?) _NET_WM_MOVERESIZE + +Application window +------------------ + +(x) _NET_WM_NAME +(/) _NET_WM_WINDOW_TYPE + (+) _NET_WM_WINDOW_TYPE_NORMAL + (?) _NET_WM_WINDOW_TYPE_DOCK + (+) _NET_WM_WINDOW_TYPE_TOOLBAR + (+) _NET_WM_WINDOW_TYPE_MENU + (?) _NET_WM_WINDOW_TYPE_UTIL + (?) _NET_WM_WINDOW_TYPE_DIALOG + (+) _NET_WM_WINDOW_TYPE_SPLASH + (?) _NET_WM_WINDOW_TYPE_DESKTOP + +(/) _NET_WM_STATE + (?) _NET_WM_STATE_MODAL + (?) _NET_WM_STATE_STICKY + (/) _NET_WM_STATE_MAXIMIZED_VERT + (/) _NET_WM_STATE_MAXIMIZED_HORZ + (+) _NET_WM_STATE_SHADED + (?) _NET_WM_STATE_SKIP_TASKBAR + (?) _NET_WM_STATE_SKIP_PAGER + (?) _NET_WM_STATE_HIDDEN + (?) _NET_WM_STATE_FULLSCREEN + (?) _NET_WM_STATE_ABOVE + (?) _NET_WM_STATE_BELOW + +(-) _NET_WM_ALLOWED_ACTIONS + Although in edewm there is facility for easier implementing + this message, I am not quite sure where will be used. + +(?) _NET_WM_STRUT +(?) _NET_WM_STRUT_PARTIAL +(?) _NET_WM_ICON_GEOMETRY +(?) _NET_WM_ICON + +(-) _NET_WM_PID + Probably later will be implemented. For now it is not needed + at all. + +(-) _NET_WM_HANDLED_ICONS +(?) _NET_WM_USER_TIME + + +Icccm compliance +================ + +Version 2.0 is used as guide. + +Note: in WM_NORMAL_HINTS, win_gravitiy is ignored since edewm always +assume and use NorthWestGravity. This will be changed. + + +Other +===== + +Motif +----- + +(/) _MOTIF_HINTS + This hint is, as I can see, very standardized now, but implementations + differ. Edewm use only decor data from it, since based on decor, allowed + actions are deduced. + +KDE +--- +(?) _KWM_WIN_ICON + Previous edewm version loaded this message, but not used. Probably + will be implemented for history reasons (hm...) + +GNOME +----- +(-) None of them, since no one requested it. + + +Ambiguities +=========== +If ambiguities arise between similar hints, Netwm is preferred. Then +comes Icccm and Other. + + +Notes +===== +This document will be tried to be up to date with package. If you notice some +omissions, please mail me at [karijes at users.sf.net]. + +Important: since standard's documentation is very sparse (nothing unusual) and +possibility for bad/wrong interpretation of some parts exists, your notice about +them (or different behaviors among other window managers) will be much appreciated. +Mail is above. diff --git a/edewm/Cursor.cpp b/edewm/Cursor.cpp new file mode 100644 index 0000000..ff09fb0 --- /dev/null +++ b/edewm/Cursor.cpp @@ -0,0 +1,298 @@ +/* + * $Id$ + * + * Edewm, window manager + * Part of Equinox Desktop Environment (EDE). + * Copyright (c) 2000-2006 EDE Authors. + * + * This program is licenced under terms of the + * GNU General Public Licence version 2 or newer. + * See COPYING for details. + */ + +#include "Cursor.h" +#include "Frame.h" +#include "Tracers.h" + +#include +#include + +#include + +#ifdef _DEBUG + #include + std::map cursors_map; +#endif + +/* Windows like cursors (copied from FLTK). + * These are cursors for some shapes (given in comments). For others, default X are used. + */ +#define CURSORSIZE 16 +#define HOTXY 8 +static struct TableEntry { + uchar bits[CURSORSIZE*CURSORSIZE/8]; + uchar mask[CURSORSIZE*CURSORSIZE/8]; + Cursor cursor; +} table[] = { + {{ // FL_CURSOR_NS + 0x00, 0x00, 0x80, 0x01, 0xc0, 0x03, 0xe0, 0x07, 0x80, 0x01, 0x80, 0x01, + 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, + 0xe0, 0x07, 0xc0, 0x03, 0x80, 0x01, 0x00, 0x00}, + { + 0x80, 0x01, 0xc0, 0x03, 0xe0, 0x07, 0xf0, 0x0f, 0xf0, 0x0f, 0xc0, 0x03, + 0xc0, 0x03, 0xc0, 0x03, 0xc0, 0x03, 0xc0, 0x03, 0xc0, 0x03, 0xf0, 0x0f, + 0xf0, 0x0f, 0xe0, 0x07, 0xc0, 0x03, 0x80, 0x01}}, + {{ // FL_CURSOR_EW + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x10, + 0x0c, 0x30, 0xfe, 0x7f, 0xfe, 0x7f, 0x0c, 0x30, 0x08, 0x10, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, + { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x1c, 0x38, + 0xfe, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x7f, 0x1c, 0x38, 0x18, 0x18, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}, + {{ // FL_CURSOR_NWSE + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x00, 0x38, 0x00, 0x78, 0x00, + 0xe8, 0x00, 0xc0, 0x01, 0x80, 0x03, 0x00, 0x17, 0x00, 0x1e, 0x00, 0x1c, + 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, + { + 0x00, 0x00, 0x00, 0x00, 0xfc, 0x00, 0xfc, 0x00, 0x7c, 0x00, 0xfc, 0x00, + 0xfc, 0x01, 0xec, 0x03, 0xc0, 0x37, 0x80, 0x3f, 0x00, 0x3f, 0x00, 0x3e, + 0x00, 0x3f, 0x00, 0x3f, 0x00, 0x00, 0x00, 0x00}}, + {{ // FL_CURSOR_NESW + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x1c, 0x00, 0x1e, + 0x00, 0x17, 0x80, 0x03, 0xc0, 0x01, 0xe8, 0x00, 0x78, 0x00, 0x38, 0x00, + 0x78, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, + { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x00, 0x3f, 0x00, 0x3e, 0x00, 0x3f, + 0x80, 0x3f, 0xc0, 0x37, 0xec, 0x03, 0xfc, 0x01, 0xfc, 0x00, 0x7c, 0x00, + 0xfc, 0x00, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00}}, + {{0}, {0}} // FL_CURSOR_NONE & unknown +}; + +// Mozilla-like busy cursor +#define LAWATCH_WIDTH 32 +#define LAWATCH_HEIGHT 32 +#define LAWATCH_HOTXY 2 +const char left_arrow_watch_bits [] = +{ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, + 0x0c, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, + 0x7c, 0x00, 0x00, 0x00, 0xfc, 0x00, 0x00, 0x00, 0xfc, 0x01, 0x00, 0x00, + 0xfc, 0x3b, 0x00, 0x00, 0x7c, 0x38, 0x00, 0x00, 0x6c, 0x54, 0x00, 0x00, + 0xc4, 0xdc, 0x00, 0x00, 0xc0, 0x44, 0x00, 0x00, 0x80, 0x39, 0x00, 0x00, + 0x80, 0x39, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +}; + +const char left_arrow_watch_mask [] = +{ + 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, + 0x1e, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x00, 0x7e, 0x00, 0x00, 0x00, + 0xfe, 0x00, 0x00, 0x00, 0xfe, 0x01, 0x00, 0x00, 0xfe, 0x3b, 0x00, 0x00, + 0xfe, 0x7f, 0x00, 0x00, 0xfe, 0x7f, 0x00, 0x00, 0xfe, 0xfe, 0x00, 0x00, + 0xee, 0xff, 0x01, 0x00, 0xe4, 0xff, 0x00, 0x00, 0xc0, 0x7f, 0x00, 0x00, + 0xc0, 0x7f, 0x00, 0x00, 0x80, 0x39, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +}; + +Cursor CreateLeftArrowWatch(void) +{ + XColor dummy; + Pixmap p = XCreateBitmapFromData(fl_display, RootWindow(fl_display, fl_screen), + left_arrow_watch_bits, LAWATCH_WIDTH, LAWATCH_HEIGHT); + Pixmap m = XCreateBitmapFromData(fl_display, RootWindow(fl_display, fl_screen), + left_arrow_watch_mask, LAWATCH_WIDTH, LAWATCH_HEIGHT); + + Cursor cursor = XCreatePixmapCursor(fl_display, p, m, &dummy, &dummy, LAWATCH_HOTXY, LAWATCH_HOTXY); + + // recolor created cursor to usefull colors + XColor fgc; + Fl_Color fg = fl_get_color(FL_BLACK); + fgc.red = (fg>>16)&0xFF00; + fgc.green = (fg>>8)&0xFF00; + fgc.blue = fg & 0xFF00; + + XColor bgc; + Fl_Color bg = fl_get_color(FL_WHITE); + bgc.red = (bg>>16)&0xFF00; + bgc.green = (bg>>8)&0xFF00; + bgc.blue = bg & 0xFF00; + XRecolorCursor(fl_display, cursor, &fgc, &bgc); + + return cursor; +} + +Cursor CreateFltkCursor(Fl_Cursor c) +{ + Cursor cursor; + if(!c) + return None; + + if(c >= FL_CURSOR_NS) + { + TableEntry* q = (c > FL_CURSOR_NESW) ? table+4 : table+(c-FL_CURSOR_NS); + if(!(q->cursor)) + { + XColor dummy; + Pixmap p = XCreateBitmapFromData(fl_display, RootWindow(fl_display, fl_screen), (const char*)q->bits, + CURSORSIZE, CURSORSIZE); + Pixmap m = XCreateBitmapFromData(fl_display, RootWindow(fl_display, fl_screen), (const char*)q->mask, + CURSORSIZE, CURSORSIZE); + q->cursor = XCreatePixmapCursor(fl_display, p, m, &dummy, &dummy, HOTXY, HOTXY); + + XFreePixmap(fl_display, m); + XFreePixmap(fl_display, p); + } + cursor = q->cursor; + } + else + cursor = XCreateFontCursor(fl_display, (c-1)*2); + + // recolor created cursor to usefull colors + XColor fgc; + Fl_Color fg = fl_get_color(FL_BLACK); + fgc.red = (fg>>16)&0xFF00; + fgc.green = (fg>>8)&0xFF00; + fgc.blue = fg & 0xFF00; + + XColor bgc; + Fl_Color bg = fl_get_color(FL_WHITE); + bgc.red = (bg>>16)&0xFF00; + bgc.green = (bg>>8)&0xFF00; + bgc.blue = bg & 0xFF00; + XRecolorCursor(fl_display, cursor, &fgc, &bgc); + + return cursor; +} + +CursorHandler::CursorHandler() +{ + cursors_loaded = false; + + /* In some cases curr_cursor_type can't be set + * fast enough (mostly for Frame::grab_cursor()) which + * will crash whole wm. This will prevent that. + */ + curr_cursor_type = CURSOR_DEFAULT; +} + +CursorHandler::~CursorHandler() +{ + if(st != X_CURSORS) + return; + + for(int i = 0; i < CURSOR_LIST_SIZE; i++) + XFreeCursor(fl_display, cursors[i]); +} + +void CursorHandler::load(CursorShapeType s) +{ + TRACE_FUNCTION("void CursorHandler::load(CursorShapeType s)"); + + st = s; + if(st == FLTK_CURSORS) + { + cursors[CURSOR_DEFAULT] = CreateFltkCursor(FL_CURSOR_ARROW); + cursors[CURSOR_MOVE] = CreateFltkCursor(FL_CURSOR_MOVE); + + //cursors[CURSOR_WAIT] = CreateFltkCursor(FL_CURSOR_WAIT); + cursors[CURSOR_WAIT] = CreateLeftArrowWatch(); + + cursors[CURSOR_HELP] = CreateFltkCursor(FL_CURSOR_HELP); + cursors[CURSOR_N] = CreateFltkCursor(FL_CURSOR_NS); + cursors[CURSOR_NE] = CreateFltkCursor(FL_CURSOR_NESW); + cursors[CURSOR_E] = CreateFltkCursor(FL_CURSOR_WE); + cursors[CURSOR_SE] = CreateFltkCursor(FL_CURSOR_NWSE); + cursors[CURSOR_S] = CreateFltkCursor(FL_CURSOR_NS); + cursors[CURSOR_SW] = CreateFltkCursor(FL_CURSOR_NESW); + cursors[CURSOR_W] = CreateFltkCursor(FL_CURSOR_WE); + cursors[CURSOR_NW] = CreateFltkCursor(FL_CURSOR_NWSE); + } + else + { + cursors[CURSOR_DEFAULT] = XCreateFontCursor(fl_display, XC_left_ptr); + cursors[CURSOR_MOVE] = XCreateFontCursor(fl_display, XC_fleur); + + //cursors[CURSOR_WAIT] = XCreateFontCursor(fl_display, XC_watch); + cursors[CURSOR_WAIT] = CreateLeftArrowWatch(); + + cursors[CURSOR_HELP] = XCreateFontCursor(fl_display, XC_question_arrow); + cursors[CURSOR_N] = XCreateFontCursor(fl_display, XC_top_side); + cursors[CURSOR_NE] = XCreateFontCursor(fl_display, XC_top_right_corner); + cursors[CURSOR_E] = XCreateFontCursor(fl_display, XC_right_side); + cursors[CURSOR_SE] = XCreateFontCursor(fl_display, XC_bottom_right_corner); + cursors[CURSOR_S] = XCreateFontCursor(fl_display, XC_bottom_side); + cursors[CURSOR_SW] = XCreateFontCursor(fl_display, XC_bottom_left_corner); + cursors[CURSOR_W] = XCreateFontCursor(fl_display, XC_left_side); + cursors[CURSOR_NW] = XCreateFontCursor(fl_display, XC_top_left_corner); + } + +#ifdef _DEBUG + cursors_map[CURSOR_DEFAULT] = "CURSOR_DEFAULT"; + cursors_map[CURSOR_MOVE] = "CURSOR_MOVE"; + cursors_map[CURSOR_WAIT] = "CURSOR_WAIT"; + cursors_map[CURSOR_HELP] = "CURSOR_HELP"; + cursors_map[CURSOR_N] = "CURSOR_N"; + cursors_map[CURSOR_NE] = "CURSOR_NE"; + cursors_map[CURSOR_E] = "CURSOR_E"; + cursors_map[CURSOR_SE] = "CURSOR_SE"; + cursors_map[CURSOR_S] = "CURSOR_S"; + cursors_map[CURSOR_SW] = "CURSOR_SW"; + cursors_map[CURSOR_W] = "CURSOR_W"; + cursors_map[CURSOR_NW] = "CURSOR_NW"; +#endif + + cursors_loaded = true; +} + +void CursorHandler::set_cursor(Frame* f, CursorType t) +{ + TRACE_FUNCTION("void CursorHandler::set_cursor(Frame* f, CursorType t)"); +#ifdef _DEBUG + ELOG("Cursor set to %s", cursors_map[t]); +#endif + assert(cursors_loaded != false); + assert(f != NULL); + + // do not set cursor to same type again + if(t == curr_cursor_type) + return; + + curr_cursor_type = t; + + XDefineCursor(fl_display, fl_xid(f), cursors[curr_cursor_type]); +} + +// only for root window +void CursorHandler::set_root_cursor(void) +{ + TRACE_FUNCTION("void CursorHandler::set_root_cursor(void)"); + assert(cursors_loaded != false); + + root_window_cursor = cursors[CURSOR_DEFAULT]; + XDefineCursor(fl_display, RootWindow(fl_display, fl_screen), root_window_cursor); +} + +void CursorHandler::set_root_cursor(CursorType t) +{ + TRACE_FUNCTION("void CursorHandler::set_root_cursor(CursorType t)"); + assert(cursors_loaded != false); + + root_window_cursor = cursors[t]; + XDefineCursor(fl_display, RootWindow(fl_display, fl_screen), root_window_cursor); +} + +Cursor CursorHandler::current_cursor(void) const +{ + TRACE_FUNCTION("Cursor CursorHandler::current_cursor(void) const"); + //assert(current_cursor > 0 && current_cursor < CURSOR_LIST_SIZE); + return cursors[curr_cursor_type]; +} diff --git a/edewm/Cursor.h b/edewm/Cursor.h new file mode 100644 index 0000000..1ae16a4 --- /dev/null +++ b/edewm/Cursor.h @@ -0,0 +1,70 @@ +/* + * $Id$ + * + * Edewm, window manager + * Part of Equinox Desktop Environment (EDE). + * Copyright (c) 2000-2006 EDE Authors. + * + * This program is licenced under terms of the + * GNU General Public Licence version 2 or newer. + * See COPYING for details. + */ + +#ifndef __CURSOR_H__ +#define __CURSOR_H__ + +#include // Cursor + +/* Main existance of this class is + * to allow using efltk and X cursors + * (...and maybe bitmapped ones :). + */ + +enum CursorType +{ + CURSOR_DEFAULT = 0, + CURSOR_MOVE, + CURSOR_WAIT, + CURSOR_HELP, + CURSOR_N, + CURSOR_NE, + CURSOR_E, + CURSOR_SE, + CURSOR_S, + CURSOR_SW, + CURSOR_W, + CURSOR_NW, + CURSOR_NONE +}; + +#define CURSOR_LIST_SIZE 13 + +enum CursorShapeType +{ + FLTK_CURSORS = 0, + X_CURSORS +}; + +class Frame; + +class CursorHandler +{ + private: + int cursors[CURSOR_LIST_SIZE]; + CursorShapeType st; + CursorType curr_cursor_type; + Cursor root_window_cursor; + bool locked; + bool cursors_loaded; + public: + CursorHandler(); + ~CursorHandler(); + void load(CursorShapeType s); + void set_cursor(Frame* f, CursorType t); + void set_root_cursor(void); + void set_root_cursor(CursorType t); + Cursor current_cursor(void) const; + Cursor root_cursor(void) { return root_window_cursor; } + CursorShapeType cursor_shape_type(void) { return st; } +}; +#endif diff --git a/edewm/Desktop.h b/edewm/Desktop.h new file mode 100644 index 0000000..83f856e --- /dev/null +++ b/edewm/Desktop.h @@ -0,0 +1,81 @@ +/* + * $Id$ + * + * Edewm, window manager + * Part of Equinox Desktop Environment (EDE). + * Copyright (c) 2000-2006 EDE Authors. + * + * This program is licenced under terms of the + * GNU General Public Licence version 2 or newer. + * See COPYING for details. + */ + +#ifndef _DESKTOP_H_ +#define _DESKTOP_H_ + +#include + +class Desktop { +public: + Desktop(const char *name); + ~Desktop(); + + const char* name() const { return name_; } + void name(const char *name); + int number() const { return number_; } + + static Desktop *desktop(int num); + + static Desktop *next(); + static Desktop *prev(); + + static Desktop *current() { return current_; } + static int current_num() { return current_ ? current_->number() : -1; } + + static Desktop* add(const char *name=0); + + static void current(Desktop *cur); + static void current(int cur) { current(desktop(cur)); } + + static int desktop_count() { return desktop_count_; } + + static void update_desktop_viewport(); + static void update_desktop_workarea(); + static void update_desktop_geometry(); + + static void update_desktop_count(uint cnt, bool send=true); + static void update_desktop_names(bool send=true); + + static void set_names(); + + int junk; // for temporary storage by menu builder + +private: + static Desktop* current_; + static int desktop_count_; + + const char* name_; + int number_; +}; + +class Desktop_List : public Fl_Ptr_List { +public: + Desktop_List() : Fl_Ptr_List() { } + + void append(Desktop *item) { Fl_Ptr_List::append((void *)item); } + void prepend(Desktop *item) { Fl_Ptr_List::prepend((void *)item); } + void insert(uint pos, Desktop *item) { Fl_Ptr_List::insert(pos, (void *)item); } + void replace(uint pos, Desktop *item) { Fl_Ptr_List::replace(pos, (void *)item); } + void remove(uint pos) { Fl_Ptr_List::remove(pos); } + bool remove(Desktop *item) { return Fl_Ptr_List::remove((void *)item); } + int index_of(const Desktop *w) const { return Fl_Ptr_List::index_of((void*)w); } + Desktop *item(uint index) const { return (Desktop*)Fl_Ptr_List::item(index); } + + Desktop **data() { return (Desktop**)items; } + + Desktop *operator [](uint ind) const { return (Desktop *)items[ind]; } +}; + +extern Desktop_List desktops; + +#endif diff --git a/edewm/Events.cpp b/edewm/Events.cpp new file mode 100644 index 0000000..55e63fb --- /dev/null +++ b/edewm/Events.cpp @@ -0,0 +1,508 @@ +/* + * $Id$ + * + * Edewm, window manager + * Part of Equinox Desktop Environment (EDE). + * Copyright (c) 2000-2006 EDE Authors. + * + * This program is licenced under terms of the + * GNU General Public Licence version 2 or newer. + * See COPYING for details. + */ + +#include "Events.h" +#include "Frame.h" +#include "Titlebar.h" +#include "Windowmanager.h" +#include "Tracers.h" +#include "Atoms.h" +#include "Hints.h" +#include "Cursor.h" +#include "debug.h" + +#include + + +#define FRAME_NAME(frame) (frame->label ? frame->label : "NULL") + +FrameEventHandler::FrameEventHandler(Frame* f) : curr_frame(f) +{ + assert(curr_frame != NULL); +} + +FrameEventHandler::~FrameEventHandler() +{ +} + +/* Handle efltk events. + * Some events like FL_FOCUS and FL_UNFOCUS are not handled, since + * efltk does not receive this event when when should (for example: + * one window is focused, but other shoud be automatically unfocused). + * X on ther hand send FocusIn and FocusOut when above events ocurr. + */ +int FrameEventHandler::handle_fltk(int event) +{ + long gggg; + static long bbbb; + static CursorType ctype; + + if(curr_frame->show_titlebar) + { + Titlebar* tbar = curr_frame->titlebar; + assert(tbar != NULL); + + if(!curr_frame->resizing()) + { + if(Fl::event_inside(tbar->x(), tbar->y(), tbar->w(), tbar->h()) || curr_frame->moving()) + return tbar->handle(event); + } + } + + switch(event) + { + case FL_SHOW: + case FL_HIDE: + return 0; + + case FL_ENTER: + ELOG("FrameEventHandler: FL_ENTER"); + return 1; + + case FL_LEAVE: + ELOG("FrameEventHandler: FL_LEAVE"); + return 1; + + case FL_MOVE: + { + // note, I am using coordinates _inside_ window + gggg = curr_frame->resize_type(Fl::event_x(), Fl::event_y()); + switch(gggg) + { + case ResizeTypeUpLeft: + ELOG("FrameEventHandler (resizing): ResizeTypeUpLeft"); + curr_frame->set_cursor(CURSOR_NW); + ctype = CURSOR_NW; + bbbb = ResizeTypeUpLeft; + return 1; + case ResizeTypeUpRight: + ELOG("FrameEventHandler (resizing): ResizeTypeUpRight"); + curr_frame->set_cursor(CURSOR_NE); + ctype = CURSOR_NE; + bbbb = ResizeTypeUpRight; + return 1; + case ResizeTypeDownLeft: + ELOG("FrameEventHandler (resizing): ResizeTypeDownLeft"); + curr_frame->set_cursor(CURSOR_SW); + ctype = CURSOR_SW; + bbbb = ResizeTypeDownLeft; + return 1; + case ResizeTypeDownRight: + ELOG("FrameEventHandler (resizing): ResizeTypeDownRight"); + curr_frame->set_cursor(CURSOR_SE); + ctype = CURSOR_SE; + bbbb = ResizeTypeDownRight; + return 1; + case ResizeTypeUp: + ELOG("FrameEventHandler (resizing): ResizeTypeUp"); + curr_frame->set_cursor(CURSOR_N); + ctype = CURSOR_N; + bbbb = ResizeTypeUp; + return 1; + case ResizeTypeLeft: + ELOG("FrameEventHandler (resizing): ResizeTypeLeft"); + curr_frame->set_cursor(CURSOR_W); + ctype = CURSOR_W; + bbbb = ResizeTypeLeft; + return 1; + case ResizeTypeRight: + ELOG("FrameEventHandler (resizing): ResizeTypeRight"); + curr_frame->set_cursor(CURSOR_E); + ctype = CURSOR_E; + bbbb = ResizeTypeRight; + return 1; + case ResizeTypeDown: + ELOG("FrameEventHandler (resizing): ResizeTypeDown"); + curr_frame->set_cursor(CURSOR_S); + ctype = CURSOR_S; + bbbb = ResizeTypeDown; + return 1; + default: + //curr_frame->set_cursor(CURSOR_DEFAULT); + bbbb = ResizeTypeNone; + return 1; + } + return 1; + } + + case FL_PUSH: + ELOG("FrameEventHandler: FL_PUSH"); + + if(Fl::event_is_click()) + { + curr_frame->borders_color(CLICKED); + curr_frame->raise(); + } + return 1; + + case FL_DRAG: + ELOG("FrameEventHandler: FL_DRAG"); + if(bbbb != ResizeTypeNone) + { + if(!curr_frame->resizing()) + { + curr_frame->grab_cursor(); + curr_frame->resize_start(); + curr_frame->show_coordinates_window(); + } + + //XGrabServer(fl_display); + + curr_frame->set_cursor(ctype); + curr_frame->resize_window(Fl::event_x_root(), Fl::event_y_root(), bbbb); + curr_frame->update_coordinates_window(); + } + return 1; + + case FL_RELEASE: + ELOG("FrameEventHandler: FL_RELEASE"); + if(curr_frame->resizing()) + { + //XUngrabServer(fl_display); + curr_frame->resize_end(); + curr_frame->ungrab_cursor(); + curr_frame->hide_coordinates_window(); + curr_frame->set_cursor(CURSOR_DEFAULT); + } + + //curr_frame->color(FL_GRAY); + curr_frame->borders_color(FOCUSED); + return 1; + default: + // let other events go to sizers + return curr_frame->handle_parent(event); + } + return 0; + +} + +int FrameEventHandler::handle_x(XEvent* event) +{ + switch(event->type) + { + case MapRequest: + return map_event(event->xmaprequest); + case UnmapNotify: + return unmap_event(event->xunmap); + case ReparentNotify: + return reparent_event(event->xreparent); + case DestroyNotify: + return destroy_event(event->xdestroywindow); + /*case ClientMessage: + return client_message(event->xclient);*/ + case LeaveNotify: + case EnterNotify: + return enter_leave_event(event->xcrossing); + + /* FocusIn, as FocusOut is not used, but for + * debugging is here. When we map a large number + * of windows, X seems goes into (for me unknown) + * infinite FocusIn/FocusOut loop, which blocks + * everything. So, to keep us far away from pain, + * leave FocusIn for someone else. Here should not + * be used. + */ + case FocusIn: + { + ELOG("FrameEventHandler: FocusIn"); + switch(event->xfocus.mode) + { + case NotifyNormal: + ELOG(" - NotifyNormal"); + break; + case NotifyGrab: + ELOG(" - NotifyGrab"); + break; + case NotifyUngrab: + ELOG(" - NotifyUngrab"); + break; + } + + if(event->xfocus.send_event) + ELOG(" - got from SendEvent"); + + /* This will prevent menus, etc. + * to steal focus from parent. + */ + //if(event->xfocus.mode == NotifyNormal) + // curr_frame->focus(); + } + return 1; + + /* FocusOut really fuck up focusing so + * it is not handled. Either xfocus.mode == NotifyNormal + * does not helps when window emits menu, since menu + * itself will yield FocusOut for parent and FocusIn + * for itself. Unfortunately I don't know any toolkit + * which export some kind MENU flag, where we can check. + * So, let we shut it up, make ourself little bit happy + * and take all burden of FocusOut to ourself (which made + * use very very unhappy). + */ + case FocusOut: + { + ELOG("FrameEventHandler: FocusOut"); + switch(event->xfocus.mode) + { + case NotifyNormal: + ELOG(" - NotifyNormal"); + break; + case NotifyGrab: + ELOG(" - NotifyGrab"); + break; + case NotifyUngrab: + ELOG(" - NotifyUngrab"); + break; + } + + if(event->xfocus.send_event) + ELOG(" - got from SendEvent"); + //curr_frame->unfocus(); + } + return 1; + case PropertyNotify: + return property_event(event->xproperty); + case ConfigureRequest: + return configure_event(event->xconfigurerequest); + return 1; + + default: +#ifdef _DEBUG + const char* name = WindowManager::instance()->xevent_map[event->type]; + if(name) + ELOG("Got unhandled %s in frame", name); + else + ELOG("Got unhandled event in frame (%i)", event->type); +#endif + return 0; + } + return 0; +} + +int FrameEventHandler::map_event(const XMapRequestEvent& e) +{ + TRACE_FUNCTION("int FrameEventHandler::map_event(const XMapRequestEvent& e)"); + assert(e.window == curr_frame->window()); + + curr_frame->map(); + + return 1; +} + +int FrameEventHandler::unmap_event(const XUnmapEvent& e) +{ + TRACE_FUNCTION("int FrameEventHandler::unmap_event(const XUnmapEvent& e)"); + //assert(e.window == curr_frame->window()); + if(e.window != curr_frame->window()) + return 1; + + ELOG("FrameEventHandler: UnmapNotify (%s)", FRAME_NAME(curr_frame->fdata)); + if(e.from_configure) + return 1; + + if(curr_frame->option(FrameOptIgnoreUnmap)) + { + ELOG("Frame have FrameOptIgnoreUnmap, skiping this event"); + curr_frame->clear_option(FrameOptIgnoreUnmap); + } + else + curr_frame->unmap(); + + return 1; +} + +int FrameEventHandler::reparent_event(const XReparentEvent& e) +{ + TRACE_FUNCTION("int FrameEventHandler::reparent_event(const XReparentEvent& e)"); + ELOG("FrameEventHandler: ReparentNotify (%s)", FRAME_NAME(curr_frame->fdata)); + + // echo + if(e.parent == fl_xid(curr_frame)) + return 1; + // app is trying to tear-off again ??? + if(e.parent == fl_xid(WindowManager::instance())) + return 1; + + if(e.override_redirect) + { + ELOG("override_redirect from reparent_event"); + } + + EWARNING("Destroy in ReparentNotify!"); + curr_frame->destroy(); + + return 1; +} + +int FrameEventHandler::destroy_event(const XDestroyWindowEvent& e) +{ + TRACE_FUNCTION("int FrameEventHandler::destroy_event(const XDestroyWindowEvent& e)"); + + curr_frame->destroy(); + return 1; +} + +int FrameEventHandler::client_message(const XClientMessageEvent& e) +{ + TRACE_FUNCTION("int FrameEventHandler::client_message(const XClientMessageEvent& e)"); + + if(!ValidateDrawable(e.window)) + return 1; + +#ifdef _DEBUG + Atom a = e.message_type; + const char* name = WindowManager::instance()->atom_map[a]; + if(name) + ELOG("FrameEventHandler: unhandled atom %s", name); + else + ELOG("FrameEventHandler: unhandled atom %x", a); +#endif + + return 1; +} + +/* Handle property atoms. Here Netwm atoms are handled + * last, giving them precedence and chance to overwrite + * Icccm stuf (list XA_WM_NAME vs. _XA_NET_WM_NAME) + */ +int FrameEventHandler::property_event(const XPropertyEvent& e) +{ + TRACE_FUNCTION("int FrameEventHandler::property_event(const XPropertyEvent& e)"); + + if(e.atom == XA_WM_NAME) + ELOG("XA_WM_NAME"); + if(e.atom == XA_WM_ICON_NAME) + ELOG("XA_WM_ICON_NAME"); + if(e.atom == XA_WM_HINTS) + ELOG("XA_WM_HINTS"); + if(e.atom == XA_WM_NORMAL_HINTS) + ELOG("XA_WM_NORMAL_HINTS"); + if(e.atom == XA_WM_SIZE_HINTS) + ELOG("XA_WM_SIZE_HINTS"); + if(e.atom == XA_WM_TRANSIENT_FOR) + ELOG("XA_WM_TRANSIENT_FOR"); + if(e.atom == _XA_WM_COLORMAP_WINDOWS) + ELOG("_XA_WM_COLORMAP_WINDOWS"); + if(e.atom == _XA_WM_STATE) + ELOG("_XA_WM_STATE"); + if(e.atom == _XA_WM_PROTOCOLS) + ELOG("_XA_WM_PROTOCOLS"); + if(e.atom == _XA_NET_WM_WINDOW_TYPE) + ELOG("_XA_NET_WM_WINDOW_TYPE"); + if(e.atom == _XA_NET_WM_STRUT) + { + ELOG("_XA_NET_WM_STRUT"); + int dummy; + WindowManager::instance()->hints()->netwm_strut(curr_frame->fdata->window, + &dummy, &dummy, &dummy, &dummy); + } + if(e.atom == _XA_NET_WM_NAME) + ELOG("_XA_NET_WM_NAME"); + if(e.atom == _XA_NET_WM_ICON) + ELOG("_XA_NET_WM_ICON"); + if(e.atom == _XA_KWM_WIN_ICON) + ELOG("_XA_KWM_WIN_ICON"); + + return 1; +} + +/* Handle EnterNotify and LeaveNotify events. + * Here is used only LeaveNotify to change cursor, since it will be + * trigered only on window borders (exact what is needed). On other + * hand, entering frame's child (or plain window) is handled by + * window itself, with ability to change cursor as like. + * Note, this event could not be simulated with FL_LEAVE, since + * it will be trigered only when mouse if off from whole window + * (including childs). + * + * Also, checkings of frame resizings are must, since mouse moving is + * usually faster than window resizing, so we will get flickering in + * cursors changes if not checked. + * + * TODO: better will be cursor is grabbed ! + */ +int FrameEventHandler::enter_leave_event(const XCrossingEvent& e) +{ + TRACE_FUNCTION("int FrameEventHandler::enter_event(const XEnterWindowEvent& e)"); + if(curr_frame->state(FrameStateUnmapped)) + return 1; + + if(e.type == LeaveNotify && !curr_frame->resizing()) + curr_frame->set_cursor(CURSOR_DEFAULT); + + return 1; +} + +/* This message we can get for windows we know about and we don't know + * about (since all root messages are redirected to us). So we first check + * is window is managed by us, and apply changes to it via our functions. + * Otherwise, we configure window directly. + * + * Note: in fltk's fluid(1.1.6), setting x coords will send us pretty + * amount of junk (change x and y in the same time !!!). This is probably + * bug in fluid. + */ +int FrameEventHandler::configure_event(const XConfigureRequestEvent& e) +{ + TRACE_FUNCTION("int FrameEventHandler::configure_event(const XConfigureRequestEvent& e)"); + + if(curr_frame->state(FrameStateUnmapped)) + return 1; + + if(curr_frame->window() == e.window) + { + ELOG("ConfigureRequest from frame"); + if(!ValidateDrawable(curr_frame->window())) + return 1; + + int x_pos = curr_frame->fdata->plain.x; + int y_pos = curr_frame->fdata->plain.y; + int w_sz = curr_frame->fdata->plain.w; + int h_sz = curr_frame->fdata->plain.h; + + if(e.value_mask & CWX) + x_pos = e.x; + if(e.value_mask & CWY) + y_pos = e.y; + if(e.value_mask & CWWidth) + w_sz = e.width; + if(e.value_mask & CWHeight) + h_sz = e.height; + + if(e.value_mask & CWStackMode) + { + if(e.detail == Above) + curr_frame->raise(); + if(e.detail == Below) + curr_frame->lower(); + } + + curr_frame->set_size(x_pos, y_pos, w_sz, h_sz, true); + } + else + { + ELOG("ConfigureRequest from unhandled window"); + + if(ValidateDrawable(e.window)) + { + XWindowChanges wc; + wc.x = e.x; + wc.y = e.y; + wc.width = e.width; + wc.height = e.height; + wc.stack_mode = e.detail; + XConfigureWindow(fl_display, e.window, e.value_mask, &wc); + } + } + + return 1; +} diff --git a/edewm/Events.h b/edewm/Events.h new file mode 100644 index 0000000..b87511a --- /dev/null +++ b/edewm/Events.h @@ -0,0 +1,45 @@ +/* + * $Id$ + * + * Edewm, window manager + * Part of Equinox Desktop Environment (EDE). + * Copyright (c) 2000-2006 EDE Authors. + * + * This program is licenced under terms of the + * GNU General Public Licence version 2 or newer. + * See COPYING for details. + */ + +#ifndef __EVENTS_H__ +#define __EVENTS_H__ + +#include // XEvent + +/* Purpose of this class is to + * split and minimize already big Frame class + */ + +class Frame; + +class FrameEventHandler +{ + private: + Frame* curr_frame; + + int map_event(const XMapRequestEvent& e); + int unmap_event(const XUnmapEvent& e); + int reparent_event(const XReparentEvent& e); + int destroy_event(const XDestroyWindowEvent& e); + int client_message(const XClientMessageEvent& e); + int property_event(const XPropertyEvent& e); + int enter_event(const XCrossingEvent& e); + int configure_event(const XConfigureRequestEvent& e); + int enter_leave_event(const XCrossingEvent& e); + public: + FrameEventHandler(Frame* f); + ~FrameEventHandler(); + int handle_fltk(int e); + int handle_x(XEvent* e); +}; + +#endif diff --git a/edewm/Frame.cpp b/edewm/Frame.cpp new file mode 100644 index 0000000..888d14b --- /dev/null +++ b/edewm/Frame.cpp @@ -0,0 +1,1700 @@ +/* + * $Id$ + * + * Edewm, window manager + * Part of Equinox Desktop Environment (EDE). + * Copyright (c) 2000-2006 EDE Authors. + * + * This program is licenced under terms of the + * GNU General Public Licence version 2 or newer. + * See COPYING for details. + */ + +#include "Frame.h" +#include "Events.h" +#include "Hints.h" +#include "Windowmanager.h" +#include "Atoms.h" +#include "Utils.h" +#include "Titlebar.h" +#include "debug.h" +#include "Sound.h" +#include "Tracers.h" + +#include +#include // snprintf + +#ifdef SHAPE + #include +#endif // SHAPE + + +#define FRAME_NAME(frame) (frame->label ? frame->label : "NULL") + +// TODO: just for testing +#define BORDER_UPDOWN 3 +#define BORDER_LEFTRIGHT 3 + +#define BORDER_THIN_UPDOWN 1 +#define BORDER_THIN_LEFTRIGHT 1 + +#define SIZER_W 15 +#define SIZER_H 15 + +#define MIN_W 0 +#define MIN_H 0 + +#define TITLEBAR_H 20 + +#define EDGE_SNAP 10 + + +void FrameBorders::item_color(Fl_Color c, FrameBordersState s, bool is_border) +{ + switch(s) + { + case FOCUSED: + (is_border) ? (focused = c) : (sizers_focused = c); + break; + case UNFOCUSED: + (is_border) ? (unfocused = c) : (sizers_unfocused = c); + break; + case CLICKED: + (is_border) ? (clicked = c) : (sizers_clicked = c); + break; + } +} + +Fl_Color FrameBorders::item_color(FrameBordersState s, bool is_border) +{ + switch(s) + { + case FOCUSED: + if(is_border) + return focused; + else + return sizers_focused; + case UNFOCUSED: + if(is_border) + return unfocused; + else + return sizers_unfocused; + case CLICKED: + if(is_border) + return clicked; + else + return sizers_clicked; + } + + return FL_GRAY; +} + +void FrameBorders::updown(int s) +{ + updown_w = s; + updown2x_w = s * 2; +} + +void FrameBorders::leftright(int s) +{ + leftright_h = s; + leftright2x_h = s * 2; +} + +void FrameBorders::shaped(bool s) +{ + is_shaped = s; +} + +CoordinatesView::CoordinatesView() : Fl_Window(120, 20) +{ + color(FL_WHITE); + box(FL_BORDER_BOX); + data_box = new Fl_Box(0, 0, w(), h()); + data_box->label_size(11); + end(); +} + +CoordinatesView::~CoordinatesView() +{ +} + +void CoordinatesView::display_data(int x, int y, int w, int h) +{ + snprintf(data, sizeof(data)-1, "%i x %i x %i x %i", x, y, w, h); + data_box->label(data); + data_box->redraw_label(); + redraw(); +} + +Frame::Frame(Window win, XWindowAttributes* attrs) : + Fl_Window(0, 0), + fdata(new FrameData), + screen_x(0), + screen_y(0), + screen_w(0), + screen_h(0), + restore_x(0), + restore_y(0), + restore_w(0), + restore_h(0), + opaque_move_resize(false), + show_titlebar(true), + is_moving(false), + is_resizing(false), + cursor_grabbed(false), + snap_move(false), + show_coordinates(true) +{ + // register our events + events = new FrameEventHandler(this); + + if(show_coordinates) + cview = new CoordinatesView(); + + fdata->window = win; + fdata->transient_win = None; + fdata->colormap = DefaultColormap(fl_display, fl_screen); + fdata->option = 0; + fdata->type = FrameTypeNormal; + fdata->state = 0; + fdata->win_gravity = 0; + fdata->autoplace = true; + fdata->icon_pixmap = 0; + fdata->icon_mask = 0; + fdata->label = 0; + fdata->label_alocated = false; + + fdata->plain.x = fdata->plain.y = 0; + fdata->plain.w = fdata->plain.h = 0; + fdata->plain.offset_x = fdata->plain.offset_y = 0; + fdata->plain.inc_w = fdata->plain.inc_h = 0; + fdata->plain.max_w = fdata->plain.max_h = 0; + fdata->plain.min_w = fdata->plain.min_h = 0; + + overlay.x = overlay.y = overlay.w = overlay.h = 0; + + borders.border_color(fl_darker(FL_GRAY), FOCUSED); + borders.border_color(FL_WHITE, UNFOCUSED); + borders.border_color(FL_BLUE, CLICKED); + + borders.sizers_color(FL_GRAY, FOCUSED); + borders.sizers_color(FL_RED, UNFOCUSED); + borders.sizers_color(FL_RED, CLICKED); + // recalculated in setup_borders + borders.updown(0); + borders.leftright(0); + borders.shaped(false); + + // we does not use window specific borders + fdata->plain.border = 0; + + // collect data + WindowManager* wm = WindowManager::instance(); + + screen_x = wm->x(); + screen_y = wm->y(); + screen_w = wm->w(); + screen_h = wm->h(); + + XWindowAttributes init_attrs; + if(attrs) + { + init_attrs = *attrs; + set_option(FrameOptIgnoreUnmap); + } + else + XGetWindowAttributes(fl_display, fdata->window, &init_attrs); + + fdata->plain.x = init_attrs.x; + fdata->plain.y = init_attrs.y; + fdata->plain.w = init_attrs.width; + fdata->plain.h = init_attrs.height; + + load_colormap(init_attrs.colormap); + + if(init_attrs.map_state == IsViewable) + set_state(FrameStateNormal); + else if(init_attrs.map_state == IsUnmapped) + set_state(FrameStateIconized); + else if(init_attrs.map_state == IsUnviewable) + ELOG("Got IsUnviewable map_state, skiping for now..."); + + wm->hints()->icccm_size(fdata); + wm->hints()->icccm_wm_hints(fdata); + wm->hints()->netwm_window_type(fdata); + wm->hints()->netwm_window_state(fdata); + wm->hints()->mwm_load_hints(fdata); + + load_label(); + + // do this asap so we don't miss any events... + XSelectInput(fl_display, fdata->window, + VisibilityChangeMask | ColormapChangeMask | + PropertyChangeMask | FocusChangeMask /*| StructureNotifyMask*/); + + XGetTransientForHint(fl_display, fdata->window, &fdata->transient_win); + if(fdata->transient_win != None) + { + fdata->type = FrameTypeDialog; + ELOG("Got transient_win"); + } + + if(fdata->type == FrameTypeNormal || fdata->type == FrameTypeDialog) + { + set_option(FrameOptHaveTitlebar | FrameOptHaveBorder | FrameOptCloseable | FrameOptMoveable); + if(fdata->type == FrameTypeNormal) + set_option(FrameOptResizeable | FrameOptHideable); + + borders.leftright(BORDER_LEFTRIGHT); + borders.updown(BORDER_UPDOWN); + } + + init_overlay(borders.updown()); + + x(fdata->plain.x); + y(fdata->plain.y); + + w(fdata->plain.w + borders.leftright2x()); + h(fdata->plain.h + borders.updown2x()); + XSetWindowBorderWidth(fl_display, fdata->window, fdata->plain.border); + + XMoveResizeWindow(fl_display, fdata->window, fdata->plain.x, fdata->plain.y, + fdata->plain.w, fdata->plain.h); + + ELOG("XWindowAttributes: %i %i %i %i", fdata->plain.x, fdata->plain.y, fdata->plain.w, fdata->plain.h); + begin(); + Fl_Color szc = borders.sizers_color(FOCUSED); + sizer_top_left = new Fl_Box(1,1,SIZER_W,SIZER_H); + sizer_top_left->box(FL_FLAT_BOX); + sizer_top_left->color(szc); + + sizer_top_right = new Fl_Box(1,1,SIZER_W,SIZER_H); + sizer_top_right->box(FL_FLAT_BOX); + sizer_top_right->color(szc); + + sizer_bottom_left = new Fl_Box(1,1,SIZER_W,SIZER_H); + sizer_bottom_left->box(FL_FLAT_BOX); + sizer_bottom_left->color(szc); + + sizer_bottom_right = new Fl_Box(1,1,SIZER_W,SIZER_H); + sizer_bottom_right->box(FL_FLAT_BOX); + sizer_bottom_right->color(szc); + + + if(show_titlebar) + { + titlebar = new Titlebar(this, borders.leftright(), borders.updown(), + w() - borders.leftright2x(), TITLEBAR_H, "Untitled"); + + if(fdata->label) + titlebar->label(fdata->label); + + /* Offset for fdata->window in our frame. + * Used in reparenting. + */ + fdata->plain.offset_x = borders.leftright(); + fdata->plain.offset_y = borders.updown() + titlebar->h(); + } + else + { + fdata->plain.offset_x = borders.leftright(); + fdata->plain.offset_y = borders.updown(); + } + + end(); + + /* Reposition and resize main frame + * but skip it if position is already + * set by some hints or fdata->autoplace is false. + * + * NOTE: efltk set minimal position 2x2 + * so this is check. If window is initialy + * tried to be placed on 0x0 it will be + * misteriously hidden. + */ + int pos_x; + int pos_y; + if(fdata->autoplace && wm->query_best_position(&pos_x, &pos_y, w(), h())) + { + if(pos_x <= 2) + pos_x = x(); + if(pos_y <= 2) + pos_y = y(); + + ELOG("This window does use autoplace"); + } + else + { + // recorrect positions made up in setup_borders() ?@#@! including + // titlebar if present + if((x() - borders.leftright()) > screen_x) + pos_x = x() - borders.leftright(); + else + pos_x = x(); + + if(show_titlebar && (y() - titlebar->h() - borders.updown()) > screen_y) + pos_y = y() - titlebar->h() - borders.updown(); + else if((y() - borders.updown()) > screen_y) + pos_y = y() - borders.updown(); + else + pos_y = y(); + } + + if(show_titlebar) + resize(pos_x, pos_y, w(), h() + titlebar->h()); + else + resize(pos_x, pos_y, w(), h()); + + place_sizers(x(), y(), w(), h()); + + // only normal windows can be resized + if(fdata->type != FrameTypeNormal) + hide_sizers(); + + set_override(); + // color of main window background, aka borders + color(borders.border_color(FOCUSED)); + create(); + reparent_window(); + configure_notify(); + + // rest is in content_click() + XGrabButton(fl_display, AnyButton, AnyModifier, fdata->window, + False, ButtonPressMask, GrabModeSync, GrabModeAsync, None, None); + + // show our creation + XMapWindow(fl_display, fdata->window); + show(); + + if(borders.shaped()) + shape_borders(); + + //shape_edges(); + + XAddToSaveSet(fl_display, fdata->window); + + // TODO: this handling should be in WindowManager + wm->window_list.push_back(this); + + if(fdata->transient_win != None) + { + ELOG("Added to aot_list"); + // latest mapped windows will be _before_ others iff they are transient + wm->aot_list.push_front(this); + } + else + { + ELOG("Added to stack_list"); + wm->stack_list.push_front(this); + } + + if(fdata->option & FrameOptTakeFocus) + focus(); + + ELOG("Window loaded, frame: 0x%x plain: 0x%x", fl_xid(this), fdata->window); + XFlush(fl_display); +} + +Frame::~Frame() +{ + ELOG("Frame::~Frame"); + if(fdata->label_alocated) + free(fdata->label); + + XFreeGC(fl_display, overlay.inverted_gc); + + if(show_coordinates) + delete cview; + + delete events; + delete fdata; +} +#if 0 +void Frame::feed_data(XWindowAttributes* existing) +{ + WindowManager* wm = WindowManager::instance(); + + screen_x = wm->x(); + screen_y = wm->y(); + screen_w = wm->w(); + screen_h = wm->h(); + + wm->hints()->icccm_size(fdata); + + // TODO: For testing only. Better solution will be. + fdata->type = wm->hints()->netwm_window_type(fdata); + + setup_borders(); + + if(fdata->type == FrameTypeSplash + || fdata->type == FrameTypeMenu + || fdata->type == FrameTypeDesktop + || fdata->type == FrameTypeDock) + { + show_titlebar = false; + } + // ------------------------------------------------ + + wm->hints()->netwm_window_state(fdata); + wm->hints()->mwm_load_hints(fdata); + + load_wm_hints(); + load_colormap(); + load_label(); + + XWindowAttributes attrs; + if(existing) + attrs = *existing; + else + XGetWindowAttributes(fl_display, fdata->window, &attrs); + + // according to ICCCM standard, returned values must + // be used for window only, excluding decorations + fdata->plain.x = attrs.x; + fdata->plain.y = attrs.y; + // TODO: add checking if window out of screen + fdata->plain.w = attrs.width; + fdata->plain.h = attrs.height; + + ELOG("XWindowAttributes: %i %i %i %i", fdata->plain.x, fdata->plain.y, fdata->plain.w, fdata->plain.h); + + // Shorthand for: fdata->colormap = attrs->colormap; + // ...for easier tracking + if(fdata->colormap != attrs.colormap) + load_colormap(attrs.colormap); + + switch(attrs.map_state) + { + case IsUnmapped: + set_state(FrameStateIconized); + break; + case IsViewable: + set_state(FrameStateNormal); + break; + case IsUnviewable: + ELOG("Got IsUnviewable map_state, skiping for now..."); + break; + } +} +#endif +/* load WM_HINTS property, finding if window + * have icons and in what state is in + * TODO: place this as Hint::icccm_load_wm_hints() + */ +#if 0 +void Frame::load_wm_hints(void) +{ + XWMHints* wm_hints = XAllocWMHints(); + wm_hints = XGetWMHints(fl_display, fdata->window); + if(!wm_hints) + { + ELOG("XGetWMHints failed!"); + return; + } + + if((wm_hints->flags & IconPixmapHint) && wm_hints->icon_pixmap) + fdata->icon_pixmap = wm_hints->icon_pixmap; + if((wm_hints->flags & IconMaskHint) &&wm_hints->icon_mask) + fdata->icon_mask = wm_hints->icon_mask; + + switch(wm_hints->initial_state) + { + case WithdrawnState: + XRemoveFromSaveSet(fl_display, fdata->window); + break; + case IconicState: + fdata->state = FrameStateIconized; + break; + case NormalState: + default: + fdata->state = FrameStateNormal; + break; + } + + // check for focus + if((wm_hints->flags & InputHint) && !wm_hints->input) + fdata->option &= ~FrameOptTakeFocus; // window does not want focus + else + fdata->option |= FrameOptTakeFocus; // window want focus; + + XFree(wm_hints); +} +#endif +// guess title +void Frame::load_label(void) +{ + TRACE_FUNCTION("void Frame::load_label(void)"); + WindowManager* wm = WindowManager::instance(); + + // first try NETWM style + fdata->label = wm->hints()->netwm_label(fdata->window, &fdata->label_alocated); + if(!fdata->label) + { + // then ICCCM + fdata->label = wm->hints()->icccm_label(fdata->window, &fdata->label_alocated); + } + ELOG("Window: %s (%p) loaded", (fdata->label ? fdata->label : "NULL"), fdata->window); +} + +void Frame::destroy(void) +{ + TRACE_FUNCTION("void Frame::destroy(void)"); + + ELOG("window goes down"); + if(state(FrameStateDestroyed)) + return; + + if(!state(FrameStateUnmapped)) + { + if(ValidateDrawable(fdata->window)) + { + XRemoveFromSaveSet(fl_display, fdata->window); + XUnmapWindow(fl_display, fdata->window); + XUnmapWindow(fl_display, fl_xid(this)); + } + } + + set_state(FrameStateDestroyed); + WindowManager::instance()->update_client_list(); + Fl::awake(); +} + +void Frame::map(void) +{ + if(!state(FrameStateUnmapped)) + return; + + XAddToSaveSet(fl_display, fdata->window); + XMapWindow(fl_display, fdata->window); + XMapWindow(fl_display, fl_xid(this)); + + clear_state(FrameStateUnmapped); +} + +void Frame::unmap(void) +{ + if(state(FrameStateUnmapped)) + return; + + if(ValidateDrawable(fdata->window)) + { + XRemoveFromSaveSet(fl_display, fdata->window); + XUnmapWindow(fl_display, fdata->window); + XUnmapWindow(fl_display, fl_xid(this)); + } + + set_state(FrameStateUnmapped); +} + +// Install custom or default colormap. +// Default colormap is read only once, in Frame constructor. +void Frame::load_colormap(Colormap col) +{ + TRACE_FUNCTION("void Frame::load_colormap(Colormap col)"); + + if(col != 0) + { + ELOG("Installing custom colormap"); + fdata->colormap = col; + } + else + ELOG("Loading default colormap"); + + XInstallColormap(fl_display, fdata->colormap); +} + +// Recalculate framed based on plain. +// If window is outside screen, fix what needs to be fixed +void Frame::setup_borders(void) +{ + TRACE_FUNCTION("void Frame::setup_borders(void)"); + + int tx, ty; + switch(fdata->type) + { + case FrameTypeNormal: + /* border = BORDER_NORMAL; */ + borders.leftright(BORDER_LEFTRIGHT); + borders.updown(BORDER_UPDOWN); + break; + case FrameTypeDialog: + /*border = BORDER_THIN; */ + //borders.leftright(BORDER_THIN_LEFTRIGHT); + //borders.updown(BORDER_THIN_UPDOWN); + borders.leftright(BORDER_LEFTRIGHT); + borders.updown(BORDER_UPDOWN); + break; + case FrameTypeSplash: + case FrameTypeDesktop: + case FrameTypeMenu: + case FrameTypeDock: + borders.leftright(0); + borders.updown(0); + // they don't have visible borders + break; + } + + // TODO: setting up initial window sizes + // should not be in setup_borders(); + tx = fdata->plain.x - borders.leftright(); + ty = fdata->plain.y - borders.updown(); + if(tx < 0) + fdata->plain.x = borders.leftright(); + if(ty < 0) + fdata->plain.y = borders.updown(); + x(fdata->plain.x); + y(fdata->plain.y); + + w(fdata->plain.w + borders.leftright2x()); + h(fdata->plain.h + borders.updown2x()); + + // set fdata->window borders, althought fdata->plain.borders is + // always 0 + XSetWindowBorderWidth(fl_display, fdata->window, fdata->plain.border); +} +#if 0 +/* Setup window sizes to minimal usable (MIN_W, MIN_H) + * but only for normal windows. Transient should set + * their size internally. + */ +void Frame::init_sizes(void) +{ + if(fdata->type == FrameTypeDialog) + return; + + if(fdata->plain.w < MIN_W) + fdata->plain.w = MIN_W; + if(fdata->plain.h < MIN_H) + fdata->plain.h = MIN_H; +} +#endif +void Frame::init_overlay(int border_size) +{ + XGCValues v; + v.subwindow_mode = IncludeInferiors; + v.foreground = 0xffffffff; + v.function = GXxor; + v.line_width = border_size; + v.graphics_exposures = False; + int mask = GCForeground | GCSubwindowMode | GCFunction | GCLineWidth | GCGraphicsExposures; + overlay.inverted_gc = XCreateGC(fl_display, + WindowManager::instance()->root_window(), mask, &v); +} + +void Frame::reparent_window(void) +{ + TRACE_FUNCTION("void Frame::reparent_window(void)"); + + if(!ValidateDrawable(fdata->window)) + return; + + const int XEventMask = + ExposureMask | + StructureNotifyMask| + VisibilityChangeMask | + KeyPressMask| + KeyReleaseMask| + KeymapStateMask| + FocusChangeMask | + ButtonPressMask | + ButtonReleaseMask | + EnterWindowMask | + LeaveWindowMask | + PointerMotionMask | + SubstructureRedirectMask | + SubstructureNotifyMask; + + + XSetWindowAttributes sattr; + // TODO: some windows set bit_gravity too + sattr.bit_gravity = NorthWestGravity; + sattr.event_mask = XEventMask; + sattr.colormap = fl_colormap; + sattr.border_pixel = fl_xpixel(FL_BLACK); + sattr.override_redirect = 0; + sattr.background_pixel = fl_xpixel(FL_GRAY); + XChangeWindowAttributes(fl_display, fl_xid(this), + CWBitGravity | CWBorderPixel | CWColormap | CWEventMask | CWBackPixel | CWOverrideRedirect, &sattr); + + XReparentWindow(fl_display, fdata->window, fl_xid(this), fdata->plain.offset_x, fdata->plain.offset_y); +/* + if(!show_titlebar) + { + XReparentWindow(fl_display, fdata->window, fl_xid(this), + borders.leftright(), borders.updown()); + } + else + { + XReparentWindow(fl_display, fdata->window, fl_xid(this), + borders.leftright(), borders.updown() + titlebar->h()); + } +*/ + +} + +void Frame::recalc_geometry(int x_pos, int y_pos, int w_sz, int h_sz, short rtype) +{ + TRACE_FUNCTION("void Frame::recalc_geometry(int x_pos, int y_pos, int w_sz, int h_sz, short rtype"); + + if(rtype == GeometryRecalcAll) + { + x(x_pos); y(y_pos); + w(w_sz); h(h_sz); + + fdata->plain.x = x() + borders.leftright(); + fdata->plain.y = y() + borders.updown(); + fdata->plain.w = w() - borders.leftright2x(); + } + else if(rtype == GeometryRecalcAllXY) + { + // do not include fdata->plain.w + // FIXME: duplication as above + x(x_pos); y(y_pos); + w(w_sz); h(h_sz); + fdata->plain.x = x() + borders.leftright(); + fdata->plain.y = y() + borders.updown(); + } + else if(rtype == GeometryRecalcPlain) + { + fdata->plain.x = x_pos; + fdata->plain.y = y_pos; + fdata->plain.w = w_sz; + fdata->plain.h = h_sz; + + x(x_pos - borders.leftright()); + y(y_pos - borders.updown()); + w(w_sz + borders.leftright2x()); + } + else + { + // we should no be here + assert(0); + } + + + if(show_titlebar) + { + // titlebar->resize(border, border, w() - border2x, titlebar->h()); + if(rtype == GeometryRecalcAll) + { + fdata->plain.h = h() - (titlebar->h() + borders.updown2x()); + } + else if(rtype == GeometryRecalcPlain) + { + h(h_sz + titlebar->h() + borders.updown2x()); + } + + titlebar->size(w() - borders.leftright2x(), titlebar->h()); + } + else + { + if(rtype == GeometryRecalcAll) + { + fdata->plain.h = h() - borders.updown2x(); + } + else if(rtype == GeometryRecalcPlain) + { + h(h_sz + borders.updown2x()); + } + } + + /* Sanitize sizes. If we go below min width and height + * even X will start to yell. Who likes yelling ? + * + * TODO: maybe when we detect this, should disallow any + * further moves/resizes ? + */ + if(fdata->plain.w <= fdata->plain.min_w) + { + int offset = fdata->plain.min_w - fdata->plain.w; + fdata->plain.w = fdata->plain.min_w; + w(w() + offset); + } + + if(fdata->plain.h <= fdata->plain.min_h) + { + int offset = fdata->plain.min_h - fdata->plain.h; + fdata->plain.h = fdata->plain.min_h; + h(h() + offset); + } + + + ELOG("p: %i %i %i %i w: %i %i %i %i", + fdata->plain.x, fdata->plain.y, fdata->plain.w, fdata->plain.h, + x(), y(), w(), h()); +} + +/* Set size of window, accepting coordinates for fdata->window + frame, + * int which case it will be resized both. + */ +void Frame::set_size(int x_pos, int y_pos, int w_sz, int h_sz, bool apply_on_plain) +{ + TRACE_FUNCTION("void Frame::set_size(int x_pos, int y_pos, int w_sz, int h_sz, bool apply_on_plain)"); + + if(!ValidateDrawable(fdata->window)) + return; + + short how; + if(apply_on_plain) + how = GeometryRecalcPlain; + else + how = GeometryRecalcAll; + + recalc_geometry(x_pos, y_pos, w_sz, h_sz, how); + + XGrabServer(fl_display); + + place_sizers(x(), y(), w(), h()); + XMoveWindow(fl_display, fl_xid(this), x(), y()); + XResizeWindow(fl_display, fl_xid(this), w(), h()); + XResizeWindow(fl_display, fdata->window, fdata->plain.w, fdata->plain.h); + + if(borders.shaped()) + shape_borders(); + + XUngrabServer(fl_display); + + configure_notify(); + redraw(); +} + +void Frame::move_window(int x_pos, int y_pos) +{ + TRACE_FUNCTION("void Frame::move_window(int x_pos, int y_pos)"); + + //draw_overlay(x_pos, y_pos, w(), h()); + //return; + + // very dummy snapping with screen edges + // TODO: what about other window(s) edges ? + if(snap_move) + { + int snap_x = screen_x + EDGE_SNAP; + int snap_y = snap_x; + int snap_w = screen_w - EDGE_SNAP; + int snap_h = screen_h - EDGE_SNAP; + int w_pos = x_pos + w(); + int h_pos = y_pos + h(); + + if(snap_x > x_pos - EDGE_SNAP && snap_x < x_pos + EDGE_SNAP) + x_pos = screen_x; + if(snap_y > y_pos - EDGE_SNAP && snap_y < y_pos + EDGE_SNAP) + y_pos = screen_y; + + if(snap_w > w_pos - EDGE_SNAP && snap_w < w_pos + EDGE_SNAP) + x_pos = screen_w - w(); + if(snap_h > h_pos - EDGE_SNAP && snap_h < h_pos + EDGE_SNAP) + y_pos = screen_h - h(); + } + + recalc_geometry(x_pos, y_pos, w(), h(), GeometryRecalcAllXY); + XMoveWindow(fl_display, fl_xid(this), x(), y()); + configure_notify(); +} + +void Frame::draw_overlay(int x, int y, int w, int h) +{ + TRACE_FUNCTION("void Frame::draw_overlay(int x, int y, int w, int h)"); +/* + XGCValues v; + v.subwindow_mode = IncludeInferiors; + v.foreground = 0xffffffff; + v.function = GXxor; + v.line_width = borders.updown(); + v.graphics_exposures = False; + int mask = GCForeground|GCSubwindowMode|GCFunction|GCLineWidth|GCGraphicsExposures; + GC invertGc = XCreateGC(fl_display, RootWindow(fl_display, fl_screen), mask, &v); +*/ + + if (w < 0) {x += w; w = -w;} + else if (!w) w = 1; + if (h < 0) {y += h; h = -h;} + else if (!h) h = 1; + Window root = WindowManager::instance()->root_window(); + + if(overlay.w > 0) + { + if(x == overlay.x && y == overlay.y && w == overlay.w && h == overlay.h) + return; + XDrawRectangle(fl_display, root, overlay.inverted_gc, overlay.x, overlay.y, overlay.w, overlay.h); + } + + overlay.x = x; + overlay.y = y; + overlay.w = w; + overlay.h = h; + + XDrawRectangle(fl_display, root, overlay.inverted_gc, overlay.x, overlay.y, overlay.w, overlay.h); +} + +void Frame::clear_overlay(void) +{ + if(overlay.w > 0) + { + Window root = WindowManager::instance()->root_window(); + XDrawRectangle(fl_display, root, overlay.inverted_gc, overlay.x, overlay.y, overlay.w, overlay.h); + overlay.w = 0; + } +} + +void Frame::place_sizers(int x, int y, int w, int h) +{ + TRACE_FUNCTION("void Frame::place_sizers(int x, int y, int w, int h)"); + + // using position() instead resize() will be only + // valid if sizers are initialy set to SIZER_W and SIZER_H + + sizer_top_left->position(0, 0); + sizer_top_right->position(w - SIZER_W, 0); + sizer_bottom_left->position(0, h - SIZER_H); + sizer_bottom_right->position(w - SIZER_W, h - SIZER_H); +} + +/* Determine type of resizing based on position + * (NOTE: here is used relative position - Fl::event_x() and Fl::event_y(), + * which are valid only in frame window). + * + * TODO: any way this can be simplified ? + */ +long Frame::resize_type(int x, int y) +{ + // TRACE_FUNCTION("long Frame::resize_type(int x, int y)"); + + //ELOG("%i %i", x, y); + // we are in top left sizer + if((x >= sizer_top_left->x() && x <= sizer_top_left->w()) && + (y >= sizer_top_left->y() && y <= sizer_top_left->h())) + return ResizeTypeUpLeft; + + // we are in top right sizer + if((x >= sizer_top_right->x() && x <= sizer_top_right->x() + sizer_top_right->w()) && + (y >= sizer_top_right->y() && y <= sizer_top_right->y() + sizer_top_right->h())) + return ResizeTypeUpRight; + + // we are in bottom left sizer + if((x >= sizer_bottom_left->x() && x <= sizer_bottom_left->x() + sizer_bottom_left->w()) && + (y >= sizer_bottom_left->y() && y <= sizer_bottom_left->y() + sizer_bottom_left->h())) + return ResizeTypeDownLeft; + + // we are in bottom right sizer + if((x >= sizer_bottom_right->x() && x <= sizer_bottom_right->x() + sizer_bottom_right->w()) && + y >= sizer_bottom_right->y() && y <= sizer_bottom_right->y() + sizer_bottom_right->h()) + return ResizeTypeDownRight; + + // we are in top border + if((x > sizer_top_left->x() + sizer_top_left->w() && x < sizer_top_right->x()) && + (y < borders.updown())) + return ResizeTypeUp; + + // we are in left border + if((x < borders.leftright()) && (y > sizer_top_left->y() + sizer_top_left->h()) && + y < sizer_bottom_left->y()) + return ResizeTypeLeft; + + // we are in right border + if((x < sizer_top_right->x() + sizer_top_right->w()) && + (x > sizer_top_right->x() + sizer_top_right->w() - borders.leftright()) && + (y > sizer_top_right->y() + sizer_top_right->w()) && + (y < sizer_bottom_left->y())) + return ResizeTypeRight; + + // we are in bottom border + if((x > sizer_bottom_left->x() + sizer_bottom_left->w()) && + (x < sizer_bottom_right->x()) && + (y > sizer_bottom_left->y() + sizer_bottom_left->h() - borders.updown()) && + (y < sizer_bottom_left->y() + sizer_bottom_left->h())) + return ResizeTypeDown; + + + return ResizeTypeNone; +} + +/* unscramble direction, and check what combination it have + * + * TODO: direction should not have oposite sides included + * like ResizeTypeRight | ResizeTypeLeft + */ +void Frame::resize_window(int mouse_x, int mouse_y, long direction) +{ + TRACE_FUNCTION("void Frame::resize_window(int mouse_x, int mouse_y, long direction)"); + + if(direction == 0) + EFATAL("calling resize on possible unresizable window"); + + if(direction & ResizeTypeNone) + return; + +#warning "Add increment/decrement info from icccm" + + // use collected increment/decrement info from icccm + /*int inc_w = fdata->plain.inc_w; + int inc_h = fdata->plain.inc_h; */ + + int tw = 0, th = 0; + + if(direction & ResizeTypeLeft) + { + if(mouse_x > x()) + tw = w() - (mouse_x - x()); // decrease + else + tw = w() + (x() - mouse_x); // increase + + set_size(mouse_x, y(), tw, h(), false); + } + + if(direction & ResizeTypeRight) + { + tw = mouse_x - x(); + set_size(x(), y(), tw, h(), false); + } + + if(direction & ResizeTypeUp) + { + if(mouse_y > y()) + th = h() - (mouse_y - y()); //decrease + else + th = h() + (y() - mouse_y); //increase + + set_size(x(), mouse_y, w(), th, false); + } + + if(direction & ResizeTypeDown) + { + th = mouse_y - y(); + set_size(x(), y(), w(), th, false); + } + +} + +void Frame::configure_notify(void) +{ + TRACE_FUNCTION("void Frame::configure_notify(void)"); + if(!ValidateDrawable(fdata->window)) + return; + + WindowManager::instance()->hints()->icccm_configure(fdata); +} + +// apply shape on borders, based on shape mask +void Frame::shape_borders(void) +{ + TRACE_FUNCTION("void Frame::shape_borders(void)"); + +#ifdef SHAPE + Window shape = XCreateSimpleWindow(fl_display, RootWindow(fl_display, fl_screen), + x(), y(), w(), h(), 0, 0, 0); + + XRectangle rect[4]; + // top + rect[0].x = SIZER_W; + rect[0].y = 0; + rect[0].width = w() - SIZER_W * 2; + rect[0].height = borders.updown(); + + // right + rect[1].x = w() - borders.leftright(); + rect[1].y = SIZER_H; + rect[1].width = borders.leftright(); + rect[1].height = h() - SIZER_H * 2; + + // bottom + rect[2].x = SIZER_W; + rect[2].y = h() - borders.updown(); + rect[2].width = w() - SIZER_W * 2; + rect[2].height = borders.updown(); + + // left + rect[3].x = 0; + rect[3].y = SIZER_H; + rect[3].width = borders.leftright(); + rect[3].height = h() - SIZER_H * 2; + + // modify our shape window + XShapeCombineRectangles(fl_display, shape, ShapeBounding, 0, 0, rect, 4, ShapeSubtract, Unsorted); + // apply our shape window as mask + XShapeCombineShape(fl_display, fl_xid(this), ShapeBounding, 0, 0, shape, ShapeBounding, ShapeSet); + XDestroyWindow(fl_display, shape); +#endif +} + +// apply shape on edges, based on pixmap mask +#include "mask.xpm" +#include +void Frame::shape_edges(void) +{ + TRACE_FUNCTION("void Frame::shape_edges(void)"); +#if 0 + // TODO: finish with other three edges + Fl_Image img((const char**)mask_xpm); + Pixmap mask = img.create_mask(img.width(), img.height()); + + Window shape = XCreateSimpleWindow(fl_display, RootWindow(fl_display, fl_screen), + x(), y(), w(), h(), 0, 0, 0); + + XShapeCombineMask(fl_display, shape, ShapeBounding, 0, 0, mask, ShapeSubtract); + XShapeCombineShape(fl_display, fl_xid(this), ShapeBounding, 0, 0, shape, ShapeBounding, ShapeSet); + XDestroyWindow(fl_display, shape); +#endif +} + +void Frame::maximize(void) +{ + TRACE_FUNCTION("void Frame::maximize(void)"); + + if(state(FrameStateShaded)) + { + ELOG("Maximizing shaded windows is bugy as devil himself !"); + return; + } + + if(fdata->type == FrameTypeDialog) + { + ELOG("Dialogs should not be resized !"); + return; + } + + if(state(FrameStateMaximized)) + { + ELOG("Window is alread maximized"); + return; + } + + restore_x = x(); + restore_y = y(); + restore_w = w(); + restore_h = h(); + + set_size(screen_x, screen_y, screen_w, screen_h, false); + set_state(FrameStateMaximized); + + WindowManager::instance()->play_sound(SOUND_MAXIMIZE); +} + +void Frame::restore(void) +{ + TRACE_FUNCTION("void Frame::restore(void)"); + + if(!state(FrameStateMaximized)) + { + ELOG("Restore unmaximized window ???"); + return; + } + + set_size(restore_x, restore_y, restore_w, restore_h, false); + clear_state(FrameStateMaximized); + + WindowManager::instance()->play_sound(SOUND_RESTORE); +} + +/* First will inspect does window participate for WM_DELETE_WINDOW + * message, and if not, it will be killed. That is the life... + */ +void Frame::close_kill(void) +{ + TRACE_FUNCTION("void Frame::close_kill(void)"); + + Atom* protocols; + int n; + bool have_close = false; + + if(XGetWMProtocols(fl_display, fdata->window, &protocols, &n)) + { + for(int i = 0; i < n; i++) + { + if(protocols[i] == _XA_WM_DELETE_WINDOW) + have_close = true; + } + + XFree(protocols); + } + if(have_close) + SendMessage(fdata->window, _XA_WM_PROTOCOLS, _XA_WM_DELETE_WINDOW); + else + { + ELOG("Frame killed"); + XKillClient(fl_display, fdata->window); + } + + WindowManager::instance()->play_sound(SOUND_CLOSE); +} + +// window accepts input +void Frame::focus(void) +{ + TRACE_FUNCTION("void Frame::focus(void)"); + + if(state(FrameStateFocused)) + return; + + if(!ValidateDrawable(fdata->window)) + return; + + WindowManager::instance()->clear_focus_windows(); + + borders_color(FOCUSED); + if(show_titlebar) + titlebar->focus(); + + //XSetInputFocus(fl_display, fdata->window, RevertToPointerRoot, fl_event_time); + XSetInputFocus(fl_display, fdata->window, RevertToPointerRoot, CurrentTime); + XInstallColormap(fl_display, fdata->colormap); + + /* DO NOT use this ! + * SendMessage(fdata->window, _XA_WM_PROTOCOLS, _XA_WM_TAKE_FOCUS); + */ + + WindowManager::instance()->hints()->netwm_set_active_window(fdata->window); + set_state(FrameStateFocused); +} + +void Frame::unfocus(void) +{ + if(!state(FrameStateFocused)) + return; + + TRACE_FUNCTION("void Frame::unfocus(void)"); + + borders_color(UNFOCUSED); + if(show_titlebar) + titlebar->unfocus(); + + clear_state(FrameStateFocused); +} + +void Frame::raise(void) +{ + TRACE_FUNCTION("void Frame::raise(void)"); + + WindowManager* wm = WindowManager::instance(); + if(wm->stack_list.size() <= 1) + { + ELOG("Only one window, restacking skipped"); + focus(); + return; + } + + FrameList::iterator it = wm->stack_list.begin(); + FrameList::iterator last = wm->stack_list.end(); + + while(it != last) + { + if(*it == this) + { + wm->stack_list.erase(it); + wm->stack_list.push_front(*it); + } + + ++it; + } + wm->restack_windows(); + focus(); +} + +/* Send frame one stack position below. + * Note that as in raise(), aot_list is not checked + * since those windows are _always_ on top. This will + * rearange stack_list and call restack_windows(), as you guess. + * + * Yes, this can be avoided using XWindowChanges with + * x.sibling and x.stack_mode = Below, which is much faster + * but we will lose arangements in stack_list and posibility + * to update _NET_CLIENT_LIST_STACKING atom. So stick with this. + * + * PS: if you have idea how to combine XWindowChanges with X calls + * without needs to update stack_list, but to extract full stacking + * list for _NET_CLIENT_LIST_STACKING, let me know. + */ +void Frame::lower(void) +{ + TRACE_FUNCTION("void Frame::lower(void)"); + + WindowManager* wm = WindowManager::instance(); + + if(wm->stack_list.size() <= 1) + { + ELOG("Only one window, restacking skipped"); + return; + } + + FrameList::iterator top = wm->stack_list.begin(); + + /* We are not at the top. + * This will prevent rise-lower-rise effect when + * function is called multiple times. + */ + if(this != *top) + return; + + FrameList::iterator below = top; + ++below; + + if(*below) + { + std::swap(*top, *below); + } + + wm->restack_windows(); + focus(); +} + +/* When we want to shade window, child (fdata->window) must + * completely disapear (as should it be). Funny thing is + * if few pixels child is visible, some programs-windows + * will crash (like mrxvt). + */ +void Frame::shade(void) +{ + TRACE_FUNCTION("void Frame::shade(void)"); + + if(!show_titlebar) + return; + + if(state(FrameStateShaded)) + return; + + restore_x = x(); + restore_y = y(); + restore_w = w(); + restore_h = h(); + + // place it to outside frame + int px = -(fdata->plain.offset_x + fdata->plain.w); + int py = -(fdata->plain.offset_y + fdata->plain.h); + + XMoveWindow(fl_display, fdata->window, px, py); + XResizeWindow(fl_display, fl_xid(this), w(), titlebar->h() + borders.updown2x()); + + set_state(FrameStateShaded); + WindowManager::instance()->hints()->netwm_set_window_state(fdata); + + WindowManager::instance()->play_sound(SOUND_SHADE); + + // Configure not needed, since we do nothing usefull to window + //configure_notify(); +} + +void Frame::unshade(void) +{ + TRACE_FUNCTION("void Frame::unshade(void)"); + + if(!show_titlebar) + return; + + if(!state(FrameStateShaded)) + { + ELOG("Unshade not shaded window ???"); + return; + } + + XMoveResizeWindow(fl_display, fdata->window, fdata->plain.offset_x, fdata->plain.offset_y, + fdata->plain.w, fdata->plain.h); + XResizeWindow(fl_display, fl_xid(this), w(), restore_h); + + clear_state(FrameStateShaded); + WindowManager::instance()->hints()->netwm_set_window_state(fdata); + + WindowManager::instance()->play_sound(SOUND_SHADE); + + // Configure not needed, since we do nothing usefull to window + //configure_notify(); +} + +void Frame::borders_color(FrameBordersState s) +{ + TRACE_FUNCTION("void Frame::borders_color(FrameBordersState s)"); + + Fl_Color szc = borders.sizers_color(s); + sizer_top_left->color(szc); + sizer_top_right->color(szc); + sizer_bottom_left->color(szc); + sizer_bottom_right->color(szc); + + color(borders.border_color(s)); + redraw(); +} + +void Frame::show_sizers(void) +{ + TRACE_FUNCTION("void Frame::show_sizers(void)"); + + sizer_top_left->show(); + sizer_top_right->show(); + sizer_bottom_left->show(); + sizer_bottom_right->show(); +} + +void Frame::hide_sizers(void) +{ + TRACE_FUNCTION("void Frame::hide_sizers(void)"); + + sizer_top_left->hide(); + sizer_top_right->hide(); + sizer_bottom_left->hide(); + sizer_bottom_right->hide(); +} + +void Frame::set_cursor(CursorType t) +{ + WindowManager::instance()->set_cursor(this, t); +} + +#if 0 +/* This function will change window type, to some of + * netwm types. Note, this function should _not_ be used + * anywhere except from toolbar menu, where window can + * be modified (if allowed in options). + * + * TODO: If we want borderless window, netwm does not provide + * anything like _NET_WM_WINDOW_TYPE_SPLASH, but not for splashes. + * Maybe we should add something like _EDE_WM_WINDOW_TYPE_PLAIN ? + */ +void Frame::change_window_type(short type) +{ + TRACE_FUNCTION("void Frame::change_window_type(short type)"); + + if(type == fdata->type) + return; + + // set fdata->window borders, althought fdata->plain.borders is + // always 0 + XSetWindowBorderWidth(fl_display, fdata->window, fdata->plain.border); + + fdata->type = type; + + switch(fdata->type) + { + case FrameTypeNormal: + borders.leftright(BORDER_LEFTRIGHT); + borders.updown(BORDER_UPDOWN); + break; + case FrameTypeDialog: + borders.leftright(BORDER_THIN_LEFTRIGHT); + borders.updown(BORDER_THIN_UPDOWN); + break; + case FrameTypeSplash: + case FrameTypeDesktop: + case FrameTypeMenu: + case FrameTypeDock: + borders.leftright(0); + borders.updown(0); + if(show_titlebar && titlebar) + { + titlebar->hide(); + show_titlebar = false; + } + // they don't have visible borders + break; + } + + // TODO: setting up initial window sizes + // should not be in setup_borders(); + if(fdata->type == FrameTypeNormal || fdata->type == FrameTypeDialog) + { + int tx, ty; + tx = fdata->plain.x - borders.leftright(); + ty = fdata->plain.y - borders.updown(); + /* + if(tx < 0) + fdata->plain.x = borders.leftright(); + if(ty < 0) + fdata->plain.y = borders.updown(); + */ + x(fdata->plain.x); + y(fdata->plain.y); + + w(fdata->plain.w + borders.leftright2x()); + h(fdata->plain.h + borders.updown2x()); + } + // means only borders + else + { + /* First resize window to size of child (x,y will be preserved) + * then resize child. + * XXX: child window's x,y are offsets from x,y of parent, so + * they are 0. + * We can't use Fl_Window::size(), since explicit window sizing + * does not work. In that case, slap it with hammer ! + */ + XResizeWindow(fl_display, fl_xid(this), fdata->plain.w, fdata->plain.h); + XMoveResizeWindow(fl_display, fdata->window, 0, 0, fdata->plain.w, fdata->plain.h); + } + + WindowManager::instance()->hints()->netwm_set_window_type(fdata); +} +#endif +/* After XGrabButton, WindowManager will FL_PUSH events + * redirect here. We must make sure after processing them + * redirect events further to fdata->window. + * + * We should not worry about transients (or any window + * it aot_list) since they will be always on top. + * + * TODO: Should we allow events on below windows event + * if transients are shown ??? + */ +void Frame::content_click(void) +{ + TRACE_FUNCTION("void Frame::content_click(void)"); + + ELOG("Clicked on frame: %s", FRAME_NAME(fdata)); + + if(fl_xevent.xbutton.button == 1) + raise(); + + XAllowEvents(fl_display, ReplayPointer, CurrentTime); +} + +void Frame::show_coordinates_window(void) +{ + if(!show_coordinates) + return; + + TRACE_FUNCTION("void Frame::show_coordinates_window(void)"); + + // calculate center of frame, and show it there + int cx = (x() + w()/2) - (cview->w()/2); + int cy = (y() + h()/2) - (cview->h()/2); + + /* Check if we are inside screen coordinates or showing window + * beyond them will not show window at all! + */ + if(cx < screen_x) + cx = screen_x; + if(cy < screen_y) + cy = screen_y; + if((cx + cview->w()) > screen_w) + cx = screen_w - cview->w(); + if((cy + cview->h()) > screen_h) + cy = screen_h - cview->h(); + + cview->position(cx, cy); + //if(!cview->shown()) + cview->show(); +} + +void Frame::update_coordinates_window(void) +{ + if(!show_coordinates) + return; + + TRACE_FUNCTION("void Frame::update_coordinates_window(void)"); + int cx = (x() + w()/2) - (cview->w()/2); + int cy = (y() + h()/2) - (cview->h()/2); + + if(cx < screen_x) + cx = screen_x; + if(cy < screen_y) + cy = screen_y; + if((cx + cview->w()) > screen_w) + cx = screen_w - cview->w(); + if((cy + cview->h()) > screen_h) + cy = screen_h - cview->h(); + + cview->position(cx, cy); + cview->display_data(x(), y(), w(), h()); +} + +void Frame::hide_coordinates_window(void) +{ + if(!show_coordinates) + return; + + TRACE_FUNCTION("void Frame::hide_coordinates_window(void)"); + cview->hide(); +} + +// handle events that efltk understainds +int Frame::handle(int event) +{ + return events->handle_fltk(event); +} + +int Frame::handle(XEvent* event) +{ + return events->handle_x(event); +} + +// this is here so FrameEventHandler can access Fl_Window +int Frame::handle_parent(int event) +{ + return Fl_Window::handle(event); +} + +/* Grab pointer, scheduling pointer events for future use. + * The only thing I can say is this is the only way of correct + * usage, althought I would like to see pointer in GrabModeAsync. + * Later is hardly possible (think so) because efltk will not be + * able to synchronize itself with X events. + */ +void Frame::grab_cursor(void) +{ + TRACE_FUNCTION("void Frame::grab_cursor(void)"); + + if(cursor_grabbed) + return; + + // use currently set cursor + Cursor cc = WindowManager::instance()->cursor_handler()->current_cursor(); + + if(XGrabPointer(fl_display, fl_xid(this), + true, /* owner events */ + ButtonMotionMask | ButtonPressMask |ButtonReleaseMask | PointerMotionMask, + GrabModeAsync, /* pointer mode */ + GrabModeAsync, /* keyboard mode */ + None, + cc, fl_event_time) == GrabSuccess) + { + //XAllowEvents(fl_display, AsyncPointer, CurrentTime); + cursor_grabbed = true; + ELOG("Cursor grabbed"); + } +} + +void Frame::ungrab_cursor(void) +{ + TRACE_FUNCTION("void Frame::ungrab_cursor(void)"); + + if(!cursor_grabbed) + return; + + ELOG("Cursor ungrabbed"); + Fl::event_is_click(0); // avoid double click + //XAllowEvents(fl_display, Fl::event() == FL_PUSH ? ReplayPointer : AsyncPointer, CurrentTime); + XUngrabPointer(fl_display, fl_event_time); + XFlush(fl_display); // make sure we are out of danger before continuing... + // because we "pushed back" the FL_PUSH, make it think no buttons are down: + Fl::e_state &= 0xffffff; + Fl::e_keysym = 0; + + cursor_grabbed = false; +} + +void Frame::display_internals(void) +{ + EPRINTF("-----------------------------------\n"); + EPRINTF("window : %lx\n", fdata->window); + EPRINTF("transient : %lx\n", fdata->transient_win); + EPRINTF("colormap : %lx\n", fdata->colormap); + EPRINTF("state : %li\n", fdata->state); + EPRINTF("options : %li\n", fdata->option); + EPRINTF("type : %i\n", fdata->type); + EPRINTF("min width : %i\n", fdata->plain.min_w); + EPRINTF("min height : %i\n", fdata->plain.min_h); + EPRINTF("max width : %i\n", fdata->plain.max_w); + EPRINTF("max height : %i\n", fdata->plain.max_h); + EPRINTF("x : %i\n", fdata->plain.x); + EPRINTF("y : %i\n", fdata->plain.y); + EPRINTF("w : %i\n", fdata->plain.w); + EPRINTF("h : %i\n", fdata->plain.h); + EPRINTF("x (framed) : %i\n", x()); + EPRINTF("y (framed) : %i\n", y()); + EPRINTF("w (framed) : %i\n", w()); + EPRINTF("h (framed) : %i\n", h()); + EPRINTF("gravity : %i\n", fdata->win_gravity); + EPRINTF("autoplace : %i\n", fdata->autoplace); + EPRINTF("have icon : %s\n", (fdata->icon_pixmap ? "yes" : "no")); + EPRINTF("have icon mask : %s\n", (fdata->icon_mask ? "yes" : "no")); + EPRINTF("label : %s\n", (fdata->label ? fdata->label : "NULL")); + EPRINTF("-----------------------------------\n"); +} diff --git a/edewm/Frame.h b/edewm/Frame.h new file mode 100644 index 0000000..2c93313 --- /dev/null +++ b/edewm/Frame.h @@ -0,0 +1,344 @@ +/* + * $Id$ + * + * Edewm, window manager + * Part of Equinox Desktop Environment (EDE). + * Copyright (c) 2000-2006 EDE Authors. + * + * This program is licenced under terms of the + * GNU General Public Licence version 2 or newer. + * See COPYING for details. + */ + +#ifndef _FRAME_H_ +#define _FRAME_H_ + +#include +#include +#include + +#include "Cursor.h" + +// frame states (internal) +#define FrameStateNormal (1 << 0) // neither of below states +#define FrameStateUnmapped (1 << 1) // or Withdrawn +#define FrameStateDestroyed (1 << 2) // destroyed window, handled by WindowManager +#define FrameStateFocused (1 << 3) + +// frame states (netwm) +#define FrameStateModal (1 << 4) // transients +#define FrameStateSticky (1 << 5) +#define FrameStateShaded (1 << 6) +#define FrameStateHidden (1 << 7) // or iconized +#define FrameStateIconized FrameStateHidden + +/* These two types are used to emit _NET_WM_STATE_ABOVE and _NET_WM_STATE_BELOW. + * For me it is unclear why they didn't called _NET_WM_STATE_ALWAYS_(ABOVE,BELOW) + * since all wm's set them in this state (except transient who are always above all + * windows), and stacking order can't be changed. Anyway, enjoy with more apropriate + * names. + */ +#define FrameStateAlwaysAbove (1 << 8) +#define FrameStateAlwaysBelow (1 << 9) + +#define FrameStateMaximizedHorz (1 << 10) +#define FrameStateMaximizedVert (1 << 11) +#define FrameStateMaximized (FrameStateMaximizedHorz | FrameStateMaximizedVert) + +// some options frame can have (or their combinations) +/* +#define FrameOptSkipList (1 << 0) // some reason why not in list +#define FrameOptBorder (1 << 1) +#define FrameOptThinBorder (1 << 2) +#define FrameOptTitlebar (1 << 3) +#define FrameOptSysmenu (1 << 4) // what a hell !?!? +#define FrameOptMinimize (1 << 5) +#define FrameOptMaxmize (1 << 6) +#define FrameOptClose (1 << 7) +#define FrameOptResize (1 << 8) +#define FrameOptMove (1 << 9) +#define FrameOptTakeFocus (1 << 10) +#define FrameOptKeepAspect (1 << 11) +*/ + +#define FrameOptSkipList (1 << 0) +#define FrameOptHaveBorder (1 << 1) +#define FrameOptHaveTitlebar (1 << 2) +#define FrameOptResizeable (1 << 3) +#define FrameOptMoveable (1 << 4) +#define FrameOptCloseable (1 << 5) +#define FrameOptHideable (1 << 6) +#define FrameOptTakeFocus (1 << 7) +#define FrameOptKeepAspect (1 << 8) + +/* some events echo UnmapNotify, like ReparentNotify, and if we + * start wm on existing X session with open windows, this flag will + * prevent they be unmapped + */ +#define FrameOptIgnoreUnmap (1 << 12) + +// frame type +#define FrameTypeNormal 0 +#define FrameTypeDialog 1 +#define FrameTypeSplash 2 +#define FrameTypeDock 3 +#define FrameTypeToolbar 4 +#define FrameTypeMenu 5 +#define FrameTypeUtil 6 +#define FrameTypeDesktop 7 + +// type of resizing; means from which +// side of window is resize doing +#define ResizeTypeNone (1 << 0) +#define ResizeTypeLeft (1 << 1) +#define ResizeTypeRight (1 << 2) +#define ResizeTypeUp (1 << 3) +#define ResizeTypeDown (1 << 4) +#define ResizeTypeUpLeft (ResizeTypeUp | ResizeTypeLeft) +#define ResizeTypeDownLeft (ResizeTypeDown | ResizeTypeLeft) +#define ResizeTypeUpRight (ResizeTypeUp | ResizeTypeRight) +#define ResizeTypeDownRight (ResizeTypeDown | ResizeTypeRight) +#define ResizeTypeAll (ResizeTypeUp | ResizeTypeDown | ResizeTypeLeft | ResizeTypeRight) + +// type of recalc_geometry() +#define GeometryRecalcAll 0 +#define GeometryRecalcAllXY 1 // recalc all, except for plain w and h +#define GeometryRecalcPlain 2 + +// now lets go to code... + +// window sizes without borders, titlebar etc. +struct WindowGeometry +{ + int x, y, w, h; + int offset_x, offset_y; + int min_w, min_h; + int max_w, max_h; + int inc_w, inc_h; + int border; +}; + +struct FrameData +{ + Window window; + Window transient_win; + Colormap colormap; + + WindowGeometry plain; + + Pixmap icon_pixmap; + Pixmap icon_mask; + char* label; + bool label_alocated; + long state; + long option; + short type; + + int win_gravity; + bool autoplace; + bool have_transient; + +// Icon* icon; +}; + +struct Overlay +{ + int x, y, w, h; + GC inverted_gc; +}; + +enum FrameBordersState +{ + FOCUSED = 1, + UNFOCUSED, + CLICKED +}; + +class FrameBorders +{ + private: + Fl_Color focused; + Fl_Color unfocused; + Fl_Color clicked; + Fl_Color sizers_focused; + Fl_Color sizers_unfocused; + Fl_Color sizers_clicked; + int updown_w; + int updown2x_w; + int leftright_h; + int leftright2x_h; + bool is_shaped; + bool is_border; + void item_color(Fl_Color c, FrameBordersState s, bool is_border); + Fl_Color item_color(FrameBordersState s, bool is_border); + + public: + void border_color(Fl_Color c, FrameBordersState s) { item_color(c, s, true); } + void sizers_color(Fl_Color c, FrameBordersState s) { item_color(c, s, false); } + void updown(int s); + void leftright(int s); + void shaped(bool s); + + Fl_Color border_color(FrameBordersState s) { return item_color(s, true); } + Fl_Color sizers_color(FrameBordersState s) { return item_color(s, false); } + int updown(void) { return updown_w; } + int updown2x(void) { return updown2x_w; } + int leftright(void) { return leftright_h; } + int leftright2x(void) { return leftright2x_h; } + bool shaped(void) { return is_shaped; } +}; + +/* Window responsible for displaying parent + * coordinates. It will _not_ be framed. + */ +class CoordinatesView : public Fl_Window +{ + private: + char data[100]; + Fl_Box* data_box; + public: + CoordinatesView(); + ~CoordinatesView(); + void display_data(int x, int y, int w, int h); +}; + + +class Titlebar; +class FrameEventHandler; + +// Head honcho of everything +class Frame : public Fl_Window +{ + private: + friend class FrameEventHandler; + + FrameData* fdata; + int screen_x, screen_y, screen_w, screen_h; + // sizes used when we do restore() + int restore_x, restore_y, restore_w, restore_h; + + bool opaque_move_resize; + bool show_titlebar; + bool is_moving; + bool is_resizing; + bool cursor_grabbed; + bool snap_move; + bool show_coordinates; + + FrameBorders borders; + FrameEventHandler* events; + + Titlebar* titlebar; + + Fl_Box* sizer_top_left; + Fl_Box* sizer_top_right; + Fl_Box* sizer_bottom_left; + Fl_Box* sizer_bottom_right; + + CoordinatesView* cview; + + Overlay overlay; + + // private loaders + void feed_data(XWindowAttributes* attrs); + //void load_wm_hints(void); + /* void load_size_hints(void); */ + void load_label(void); + + // preparers + void setup_borders(void); + // void init_sizes(void); + void init_overlay(int border_size); + void reparent_window(void); + void place_sizers(int x, int y, int w, int h); + long resize_type(int x, int y); + + void recalc_geometry(int x, int y, int w, int h, short rtype); + void configure_notify(void); + void shape_borders(void); + void shape_edges(void); + + void show_sizers(void); + void hide_sizers(void); + + void draw_overlay(int x, int y, int w, int h); + void clear_overlay(void); + + // this is here so FrameEventHandler can access Fl_Window + int handle_parent(int event); + + Frame(const Frame&); + Frame operator=(const Frame&); + + public: + Frame(Window, XWindowAttributes* = 0); + ~Frame(); + + Window window(void) { return fdata->window; } + Window transient_window(void) { return fdata->transient_win; } + + void settings_changed(void) { } + int handle(int e); + int handle(XEvent* e); + void destroy(void); + void display_internals(void); + void content_click(void); + + bool frame_type(short t) { return ((fdata->type == t) ? true : false); } + + void set_state(long s) { fdata->state |= s; } + bool state(long s) { return ((fdata->state & s) == s) ? true : false; } + void clear_state(long s) { fdata->state &= ~s; } + void clear_all_states(void) { fdata->state = 0; } + + void set_option(long o) { fdata->option |= o; } + bool option(long o) { return ((fdata->option & o) == o) ? true : false; } + void clear_option(long o) { fdata->option &= ~o; } + void clear_all_options(void) { fdata->option = 0; } + + // public loaders + void load_colormap(Colormap col = 0); + + // window manipulators + void set_size(int x, int y, int w, int h, bool apply_on_plain); + void move_window(int x, int y); + void resize_window(int mouse_x, int mouse_y, long direction); + void maximize(void); + void restore(void); + void shade(void); + void unshade(void); + void close_kill(void); + void focus(void); + void unfocus(void); + void raise(void); + void lower(void); + void borders_color(FrameBordersState s); + void set_cursor(CursorType t); + // void change_window_type(short t); + void map(void); + void unmap(void); + + void show_coordinates_window(void); + void update_coordinates_window(void); + void hide_coordinates_window(void); + + //const FrameBorders& frame_borders(void) { return borders; } + + /* These function are used to determine how Frame + * will dispatch events between titlebar and sizers + */ + void move_start(void) { is_moving = true; } + void move_end(void) { is_moving = false; } + bool moving(void) { return is_moving; } + void resize_start(void) { is_resizing = true; } + void resize_end(void) { is_resizing = false; } + bool resizing(void) { return is_resizing; } + + // TODO: should this be in WindowManager or here ??? + void grab_cursor(void); + void ungrab_cursor(void); + + bool destroy_scheduled(void) { return state(FrameStateDestroyed); } +}; + +#endif diff --git a/edewm/Hints.cpp b/edewm/Hints.cpp new file mode 100644 index 0000000..c29d328 --- /dev/null +++ b/edewm/Hints.cpp @@ -0,0 +1,512 @@ +/* + * $Id$ + * + * Edewm, window manager + * Part of Equinox Desktop Environment (EDE). + * Copyright (c) 2000-2006 EDE Authors. + * + * This program is licenced under terms of the + * GNU General Public Licence version 2 or newer. + * See COPYING for details. + */ + +#include "Hints.h" +#include "Tracers.h" +#include "Frame.h" +#include "Atoms.h" +#include "Windowmanager.h" + +#include +#include // CARD32 +#include + +#define MwmHintsDecorations (1 << 1) + +#define MwmDecorAll (1 << 0) +#define MwmDecorBorder (1 << 1) +#define MwmDecorHandle (1 << 2) +#define MwmDecorTitle (1 << 3) +#define MwmDecorMenu (1 << 4) +#define MwmDecorMinimize (1 << 5) +#define MwmDecorMaximize (1 << 6) + +#define PropMotifHintsElements 3 + +struct MwmHints +{ + unsigned long flags; + unsigned long functions; + unsigned long decorations; +}; + +void Hints::icccm_size(FrameData* f) +{ + TRACE_FUNCTION("void Hints::icccm_size(FrameData* f)"); + + assert(f != 0); + long supplied; + XSizeHints* sh = XAllocSizeHints(); + + if(!XGetWMNormalHints(fl_display, f->window, sh, &supplied)) + sh->flags = 0; + + if(sh->flags & PResizeInc) + { + if(sh->width_inc < 1) + sh->width_inc = 1; + if(sh->height_inc < 1) + sh->height_inc = 1; + } + + /* Check if PBaseSize flag is set. If not + * fill it with minimal values and use them below. + */ + if(!(sh->flags & PBaseSize)) + sh->base_width = sh->base_height = 0; + + if(!(sh->flags & PMinSize)) + { + sh->min_width = sh->base_width; + sh->min_height= sh->base_height; + } + + if(!(sh->flags & PMaxSize)) + { + sh->max_width = 32767; + sh->max_height = 32767; + } + + if(sh->max_width < sh->min_width || sh->max_width <= 0) + sh->max_width = 32767; + if(sh->max_height < sh->min_height || sh->max_height <= 0) + sh->max_height = 32767; + + if(!(sh->flags & PWinGravity)) + { + sh->win_gravity = NorthWestGravity; + sh->flags |= PWinGravity; + } + + f->plain.max_w = sh->max_width; + f->plain.max_h = sh->max_height; + //f->plain.w = sh->base_width; + //f->plain.h = sh->base_height; + f->plain.min_w = sh->min_width; + f->plain.min_h = sh->min_height; + f->win_gravity = sh->win_gravity; + + // TODO: maybe calculate aspect_min and aspect_max ? + if(sh->flags & PAspect) + f->option |= FrameOptKeepAspect; + + f->autoplace = (!(sh->flags & (USPosition|PPosition))); + + XFree(sh); +} + +void Hints::icccm_wm_hints(FrameData* f) +{ + TRACE_FUNCTION("void Hints::icccm_wm_hints(FrameData* f)"); + assert(f != NULL); + + XWMHints* wm_hints = XAllocWMHints(); + wm_hints = XGetWMHints(fl_display, f->window); + if(!wm_hints) + { + ELOG("XGetWMHints failed!"); + return; + } + + if((wm_hints->flags & IconPixmapHint) && wm_hints->icon_pixmap) + f->icon_pixmap = wm_hints->icon_pixmap; + if((wm_hints->flags & IconMaskHint) &&wm_hints->icon_mask) + f->icon_mask = wm_hints->icon_mask; + + switch(wm_hints->initial_state) + { + case WithdrawnState: + XRemoveFromSaveSet(fl_display, f->window); + break; + case IconicState: + f->state = FrameStateIconized; + break; + case NormalState: + default: + f->state = FrameStateNormal; + break; + } + + // check for focus + if((wm_hints->flags & InputHint) && !wm_hints->input) + f->option &= ~FrameOptTakeFocus; // window does not want focus + else + f->option |= FrameOptTakeFocus; // window want focus; + + XFree(wm_hints); +} + +char* Hints::icccm_label(Window win, bool* allocated) +{ + TRACE_FUNCTION("char* Hints::icccm_label(Window win, bool* allocated)"); + + XTextProperty xtp; + char* title = 0; + if(XGetWMName(fl_display, win, &xtp)) + { + if(xtp.encoding == XA_STRING) + { + title = strdup((const char*)xtp.value); + *allocated = true; + } + else + { + ELOG("X11 UTF8 text property not supported, at least for now..."); + *allocated = false; + } + + XFree(xtp.value); + } + + return title; +} + +void Hints::icccm_set_iconsizes(WindowManager* wm) +{ + TRACE_FUNCTION("void Hints::icccm_set_iconsizes(WindowManager* wm)"); + assert(wm != 0); + + XIconSize* is = XAllocIconSize(); + if(!is) + { + ELOG("XAllocIconSize failed!"); + return; + } + + is->min_width = is->min_height = 8; + is->max_width = is->max_height = 48; + is->width_inc = is->height_inc = 1; + ELOG("setting icon sizes"); + XSetIconSizes(fl_display, WindowManager::instance()->root_window(), is, 1); + XFree(is); +} + +void Hints::icccm_configure(FrameData* f) const +{ + TRACE_FUNCTION("void Hints::icccm_configure(FrameData* f) const"); + + assert(f != 0); + + XConfigureEvent ce; + ce.send_event = True; + ce.display = fl_display; + ce.type = ConfigureNotify; + ce.event = f->window; + ce.window = f->window; + ce.x = f->plain.x; + ce.y = f->plain.y; + ce.width = f->plain.w; + ce.height = f->plain.h; + ce.border_width = f->plain.border; + ce.above = None; + ce.override_redirect = False; + XSendEvent(fl_display, f->window, False, StructureNotifyMask, (XEvent*)&ce); +} + +char* Hints::netwm_label(Window win, bool* allocated) +{ + TRACE_FUNCTION("char* Hints::netwm_label(Window win, bool* allocated)"); + + unsigned char* title = 0; + Atom real_type; + int real_format; + unsigned long items_read, items_left; + + int status = XGetWindowProperty(fl_display, win, _XA_NET_WM_NAME, + 0L, 0x7fffffff, False, _XA_UTF8_STRING, &real_type, &real_format, &items_read, &items_left, + (unsigned char**)&title); + + if(status != Success && items_read != 1) + { + *allocated = false; + if(title) + XFree(title); + + return 0; + } + + *allocated = true; + return (char*)title; +} + +void Hints::netwm_window_type(FrameData* fd) +{ + TRACE_FUNCTION("short Hints::netwm_window_type(FrameData* fd) const"); + + Atom *data; + Atom real_type; + int real_format; + unsigned long items_read, items_left; + short type = FrameTypeNormal; + + int status = XGetWindowProperty(fl_display, fd->window, _XA_NET_WM_WINDOW_TYPE, + 0L, 8L, false, XA_ATOM, &real_type, &real_format, &items_read, &items_left, + (unsigned char**)&data); + + if(status != Success || !items_read) + { + ELOG("Netwm say: unknown window type, using FrameTypeNormal"); + type = FrameTypeNormal; + } + + for(unsigned int i = 0; i < items_read; i++) + { + + if(data[i] == _XA_NET_WM_WINDOW_TYPE_DOCK) + { + ELOG("_XA_NET_WM_WINDOW_TYPE_DOCK"); + type = FrameTypeDock; + break; + } + + if(data[i] == _XA_NET_WM_WINDOW_TYPE_TOOLBAR) + { + ELOG("_XA_NET_WM_WINDOW_TYPE_TOOLBAR"); + type = FrameTypeToolbar; + break; + } + + if(data[i] == _XA_NET_WM_WINDOW_TYPE_MENU) + { + ELOG("_XA_NET_WM_WINDOW_TYPE_MENU"); + type = FrameTypeMenu; + break; + } + + if(data[i] == _XA_NET_WM_WINDOW_TYPE_UTIL) + { + ELOG("_XA_NET_WM_WINDOW_TYPE_UTIL"); + type = FrameTypeUtil; + break; + } + + if(data[i] == _XA_NET_WM_WINDOW_TYPE_DIALOG) + { + ELOG("_XA_NET_WM_WINDOW_TYPE_DIALOG"); + type = FrameTypeDialog; + break; + } + + if(data[i] == _XA_NET_WM_WINDOW_TYPE_SPLASH) + { + ELOG("_XA_NET_WM_WINDOW_TYPE_SPLASH"); + type = FrameTypeSplash; + break; + } + + if(data[i] == _XA_NET_WM_WINDOW_TYPE_DESKTOP) + { + ELOG("_XA_NET_WM_WINDOW_TYPE_DESKTOP"); + type = FrameTypeDesktop; + break; + } + + if(data[i] == _XA_NET_WM_WINDOW_TYPE_NORMAL) + { + ELOG("_XA_NET_WM_WINDOW_TYPE_NORMAL"); + type = FrameTypeNormal; + break; + } + } + + XFree(data); + fd->type = type; +} + +void Hints::netwm_set_window_type(FrameData* fd) +{ + TRACE_FUNCTION("void Hints::netwm_set_window_type(FrameData* fd)"); + assert(fd != 0); + + Atom to_set[1]; + switch(fd->type) + { + case FrameTypeNormal: + to_set[0] = _XA_NET_WM_WINDOW_TYPE_NORMAL; + break; + case FrameTypeDesktop: + to_set[0] = _XA_NET_WM_WINDOW_TYPE_DESKTOP; + break; + case FrameTypeSplash: + to_set[0] = _XA_NET_WM_WINDOW_TYPE_SPLASH; + break; + case FrameTypeUtil: + to_set[0] = _XA_NET_WM_WINDOW_TYPE_UTIL; + break; + case FrameTypeMenu: + to_set[0] = _XA_NET_WM_WINDOW_TYPE_MENU; + break; + case FrameTypeToolbar: + to_set[0] = _XA_NET_WM_WINDOW_TYPE_TOOLBAR; + break; + case FrameTypeDialog: + to_set[0] = _XA_NET_WM_WINDOW_TYPE_DIALOG; + break; + case FrameTypeDock: + to_set[0] = _XA_NET_WM_WINDOW_TYPE_DOCK; + break; + default: + EFATAL("Type unknown"); + to_set[0] = _XA_NET_WM_WINDOW_TYPE_NORMAL; + break; + } + + XChangeProperty(fl_display, fd->window, _XA_NET_WM_WINDOW_TYPE, XA_ATOM, 32, + PropModeReplace, (unsigned char*)to_set, 1); +} + +long Hints::netwm_window_state(FrameData* fd) const +{ + TRACE_FUNCTION("long Hints::netwm_window_state(FrameData* fd) const"); + assert(fd != 0); + + Atom *data; + Atom real_type; + int real_format; + unsigned long items_read, items_left; + + int status = XGetWindowProperty(fl_display, fd->window, _XA_NET_WM_STATE, + 0L, 12L, false, XA_ATOM, &real_type, &real_format, &items_read, &items_left, + (unsigned char**)&data); + + if(status != Success || !items_read) + return FrameTypeNormal; + + for(unsigned int i = 0; i < items_read; i++) + { + if(data[i] == _XA_NET_WM_STATE_MODAL) + ELOG("_XA_NET_WM_STATE_MODAL"); + else if(data[i] == _XA_NET_WM_STATE_STICKY) + ELOG("_XA_NET_WM_STATE_STICKY"); + else if(data[i] == _XA_NET_WM_STATE_MAXIMIZED_VERT) + ELOG("_XA_NET_WM_STATE_MAXIMIZED_VERT"); + else if(data[i] == _XA_NET_WM_STATE_MAXIMIZED_HORZ) + ELOG("_XA_NET_WM_STATE_MAXIMIZED_HORZ"); + else if(data[i] == _XA_NET_WM_STATE_SHADED) + ELOG("_XA_NET_WM_STATE_SHADED"); + else if(data[i] == _XA_NET_WM_STATE_SKIP_TASKBAR) + ELOG("_XA_NET_WM_STATE_SKIP_TASKBAR"); + else if(data[i] == _XA_NET_WM_STATE_SKIP_PAGER) + ELOG("_XA_NET_WM_STATE_SKIP_PAGER"); + else if(data[i] == _XA_NET_WM_STATE_HIDDEN) + ELOG("_XA_NET_WM_STATE_HIDDEN"); + else if(data[i] == _XA_NET_WM_STATE_FULLSCREEN) + ELOG("_XA_NET_WM_STATE_FULLSCREEN"); + else if(data[i] == _XA_NET_WM_STATE_ABOVE) + ELOG("_XA_NET_WM_STATE_ABOVE"); + else if(data[i] == _XA_NET_WM_STATE_BELOW) + ELOG("_XA_NET_WM_STATE_BELOW"); + else if(data[i] == _XA_NET_WM_STATE_DEMANDS_ATTENTION) + ELOG("_XA_NET_WM_STATE_DEMANDS_ATTENTION"); + } + + XFree(data); + return FrameStateNormal; +} + +void Hints::netwm_set_window_state(FrameData* fd) +{ + TRACE_FUNCTION("void Hints::set_window_state(FrameData* fd)"); + + assert(fd != 0); + Atom data[10]; + int i = 0; + + if(fd->state & FrameStateSticky) + data[i++] = _XA_NET_WM_STATE_STICKY; + if(fd->state & FrameStateShaded) + data[i++] = _XA_NET_WM_STATE_SHADED; + if(fd->state & FrameStateAlwaysAbove) + data[i++] = _XA_NET_WM_STATE_ABOVE; + if(fd->state & FrameStateAlwaysBelow) + data[i++] = _XA_NET_WM_STATE_BELOW; + if((fd->state & FrameStateMaximizedHorz) || (fd->state & FrameStateMaximized)) + data[i++] = _XA_NET_WM_STATE_MAXIMIZED_HORZ; + if((fd->state & FrameStateMaximizedVert) || (fd->state & FrameStateMaximized)) + data[i++] = _XA_NET_WM_STATE_MAXIMIZED_VERT; + + XChangeProperty(fl_display, fd->window, _XA_NET_WM_STATE, XA_ATOM, 32, + PropModeReplace, (unsigned char*)data, i); +} + +void Hints::netwm_set_active_window(Window win) +{ + TRACE_FUNCTION("void Hints::netwm_set_active_window(Window win)"); + + XChangeProperty(fl_display, WindowManager::instance()->root_window(), _XA_NET_ACTIVE_WINDOW, XA_WINDOW, 32, + PropModeReplace, (unsigned char *)&win, 1); +} + +void Hints::netwm_strut(Window win, int* x, int* y, int* w, int* h) const +{ + TRACE_FUNCTION("void Hints::netwm_strut(Window win, int* x, int* y, int* w, int* h) const"); + + CARD32 *data; + Atom real_type; + int real_format; + unsigned long items_read, items_left; + + int status = XGetWindowProperty(fl_display, win, _XA_NET_WM_STRUT, + 0L, 0x7fffffff, False, XA_CARDINAL, &real_type, &real_format, &items_read, &items_left, + (unsigned char**)&data); + + ELOG("STRUT: items_read %i", items_read); + if(status != Success) + return; + + if((items_read / sizeof(CARD32)) != 4) + { + ELOG("STRUT: window have wrong strut %i", items_read/sizeof(CARD32)); + return; + } + + ELOG("STRUT: %i %i %i %i", data[0], data[1], data[2], data[3]); + XFree((char*)data); +} + +void Hints::mwm_load_hints(FrameData* fd) +{ + TRACE_FUNCTION("void Hints::mwm_load_hints(FrameData* fd)"); + assert(fd != 0); + + Atom real_type; + int real_format; + unsigned long items_read, items_left; + MwmHints* mwm; + + int status = XGetWindowProperty(fl_display, fd->window, _XA_MOTIF_HINTS, + 0L, 20L, false, _XA_MOTIF_HINTS, &real_type, &real_format, &items_read, &items_left, + (unsigned char**)&mwm); + + if(status == Success && items_read /*>= PropMotifHintsElements*/) + { + ELOG("MWM: got hints !!!"); + if((mwm->flags & MwmHintsDecorations)) + { + if(mwm->decorations & MwmDecorAll) + ELOG("MwmDecorAll"); + else + { + if(mwm->decorations & MwmDecorTitle) + ELOG("MwmHintsDecorTitle"); + if(mwm->decorations & MwmDecorBorder) + ELOG("MwmHintsDecorBorder"); + if(mwm->decorations & MwmDecorHandle) + ELOG("MwmHintsDecorHandle"); + } + } + else + ELOG("mwm: no decor at all"); + } + + XFree(mwm); +} diff --git a/edewm/Hints.h b/edewm/Hints.h new file mode 100644 index 0000000..e4145b6 --- /dev/null +++ b/edewm/Hints.h @@ -0,0 +1,40 @@ +/* + * $Id$ + * + * Edewm, window manager + * Part of Equinox Desktop Environment (EDE). + * Copyright (c) 2000-2006 EDE Authors. + * + * This program is licenced under terms of the + * GNU General Public Licence version 2 or newer. + * See COPYING for details. + */ + +#ifndef __HINTS_H__ +#define __HINTS_H__ + +#include + +struct FrameData; +class WindowManager; + +struct Hints +{ + void icccm_size(FrameData* f); + void icccm_wm_hints(FrameData* f); + char* icccm_label(Window win, bool* allocated); + void icccm_set_iconsizes(WindowManager* wm); + void icccm_configure(FrameData* f) const; + + char* netwm_label(Window win, bool* allocated); + void netwm_window_type(FrameData* fd); + void netwm_set_window_type(FrameData* fd); + long netwm_window_state(FrameData* fd) const; + void netwm_set_window_state(FrameData* fd); + void netwm_set_active_window(Window win); + void netwm_strut(Window win, int* x, int* y, int* w, int* h) const; + + void mwm_load_hints(FrameData* fd); +}; + +#endif diff --git a/edewm/Makefile b/edewm/Makefile new file mode 100644 index 0000000..7e3c2c2 --- /dev/null +++ b/edewm/Makefile @@ -0,0 +1,42 @@ +# +# $Id$ +# +# Part of Equinox Desktop Environment (EDE). +# Copyright (c) 2000-2006 EDE Authors. +# +# This program is licenced under terms of the +# GNU General Public Licence version 2 or newer. +# See COPYING for details. + +CPPFILES = \ + debug.cpp \ + main.cpp \ + Windowmanager.cpp \ + Hints.cpp \ + Atoms.cpp \ + Titlebar.cpp \ + Frame.cpp \ + Cursor.cpp \ + Events.cpp \ + Sound.cpp \ + Utils.cpp + +TARGET = edewm + +include ../makeinclude + +install: + $(INSTALL_PROGRAM) $(TARGET) $(bindir) + $(INSTALL_LOCALE) + +uninstall: + $(RM) $(bindir)/$(TARGET) + +clean: + $(RM) $(TARGET) + $(RM) *.o + +archive: + DATE=`date +%d%m%Y`; \ + cd ..; \ + tar -cjpvf edewm-unfinished-$$DATE.tar.bz2 edewm diff --git a/edewm/Sound.cpp b/edewm/Sound.cpp new file mode 100644 index 0000000..05c313f --- /dev/null +++ b/edewm/Sound.cpp @@ -0,0 +1,173 @@ +/* + * $Id$ + * + * Edewm, window manager + * Part of Equinox Desktop Environment (EDE). + * Copyright (c) 2000-2006 EDE Authors. + * + * This program is licenced under terms of the + * GNU General Public Licence version 2 or newer. + * See COPYING for details. + */ + +#include "Sound.h" +#include "debug.h" + +#ifdef SOUND + #include + #include +#endif + +#include +#include +#include // free +#include // strdup + +SoundSystem::SoundSystem() +{ +#ifdef SOUND + device = NULL; + inited = false; + down = false; +#endif +} + +SoundSystem::~SoundSystem() +{ +#ifdef SOUND + if(!down) + shutdown(); // just in case +#endif +} + +void SoundSystem::init(void) +{ +#ifdef SOUND + EPRINTF("Loading sound system\n"); + + ao_initialize(); + default_driver = ao_default_driver_id(); + + for(int i = 0; i < KNOWN_SOUNDS; i++) + { + event_sound[i].allocated = false; + event_sound[i].loaded = false; + event_sound[i].file_to_play = NULL; + } + + inited = true; +#endif +} + +void SoundSystem::shutdown(void) +{ +#ifdef SOUND + EPRINTF("Shutting down sound system\n"); + + ao_shutdown(); + + for(int i = 0; i < KNOWN_SOUNDS; i++) + { + if(event_sound[i].allocated) + free(event_sound[i].file_to_play); + } + + down = true; +#endif +} + +void SoundSystem::add(short event, const char* file) +{ +#ifdef SOUND + assert(event < KNOWN_SOUNDS); + if(event_sound[event].allocated) + free(event_sound[event].file_to_play); + + event_sound[event].file_to_play = strdup(file); + event_sound[event].allocated = true; + event_sound[event].loaded = true; +#endif +} + +int SoundSystem::play(short event) +{ +#ifdef SOUND + assert(event < KNOWN_SOUNDS); + if(event_sound[event].loaded) + play(event_sound[event].file_to_play); + else + ELOG("Skipping this sound, no file for it"); +#endif + return 1; +} + +int SoundSystem::play(const char* fname) +{ +#ifdef SOUND + assert(inited != false); + assert(fname != NULL); + + FILE* f = fopen(fname, "rb"); + if(f == NULL) + { + ELOG("Can't open %s\n", fname); + return 0; + } + + OggVorbis_File vf; + vorbis_info* vi; + + if(ov_open(f, &vf, NULL, 0) < 0) + { + ELOG("%s does not appear to be ogg file\n"); + fclose(f); + return 0; + } + + // read and print comments + char** comm = ov_comment(&vf, -1)->user_comments; + vi = ov_info(&vf, -1); + + while(*comm) + { + ELOG("%s", *comm); + comm++; + } + + assert(vi != NULL); + + format.bits = 4 * 8; // TODO: should be word_size * 8 + format.channels = vi->channels; + format.rate = vi->rate; + format.byte_format = AO_FMT_NATIVE; + + // now open device + device = ao_open_live(default_driver, &format, NULL); + if(device == NULL) + { + ELOG("Can't open device"); + ov_clear(&vf); + return 0; + } + + int current_section; + while(1) + { + long ret = ov_read(&vf, pcm_out, sizeof(pcm_out), 0, 2, 1, ¤t_section); + if(ret == 0) + break; + else if(ret < 0) + ELOG("Error in the stream, continuing..."); + else + ao_play(device, pcm_out, ret); + } + + ao_close(device); + device = NULL; + + // NOTE: fclose(f) is not needed, since ov_clear() will close file + ov_clear(&vf); +#endif // SOUND + + return 1; +} diff --git a/edewm/Sound.h b/edewm/Sound.h new file mode 100644 index 0000000..6a63cbf --- /dev/null +++ b/edewm/Sound.h @@ -0,0 +1,63 @@ +/* + * $Id$ + * + * Edewm, window manager + * Part of Equinox Desktop Environment (EDE). + * Copyright (c) 2000-2006 EDE Authors. + * + * This program is licenced under terms of the + * GNU General Public Licence version 2 or newer. + * See COPYING for details. + */ + +#ifndef __SOUND_H__ +#define __SOUND_H__ + +#ifdef SOUND + #include +#endif + +enum +{ + SOUND_MINIMIZE = 0, + SOUND_MAXIMIZE, + SOUND_RESTORE, + SOUND_SHADE, + SOUND_CLOSE +}; +#define KNOWN_SOUNDS 5 + +struct EventSound +{ + bool allocated; + bool loaded; + short event; + char* file_to_play; +}; + +#define PCM_BUF_SIZE 4096 + +class SoundSystem +{ +#ifdef SOUND + private: + ao_device* device; + ao_sample_format format; + int default_driver; + char pcm_out[PCM_BUF_SIZE]; + bool inited; + bool down; + EventSound event_sound[KNOWN_SOUNDS]; +#endif + public: + SoundSystem(); + ~SoundSystem(); + void init(void); + void shutdown(void); + + void add(short event, const char* file); + int play(const char* fname); + int play(short event); +}; + +#endif diff --git a/edewm/Titlebar.cpp b/edewm/Titlebar.cpp new file mode 100644 index 0000000..9fd32e7 --- /dev/null +++ b/edewm/Titlebar.cpp @@ -0,0 +1,429 @@ +/* + * $Id$ + * + * Edewm, window manager + * Part of Equinox Desktop Environment (EDE). + * Copyright (c) 2000-2006 EDE Authors. + * + * This program is licenced under terms of the + * GNU General Public Licence version 2 or newer. + * See COPYING for details. + */ + +#include "Titlebar.h" +#include "Frame.h" +#include "debug.h" +#include +#include +#include +#include +#include + +#include "app.xpm" +Fl_Image app_img((const char**)app_xpm); + +#define MAX_OF 0.6f +#define MIN_OF 0.5f +#define RES_OF 0.1f +#define vv(x,y) fl_vertex(x,y) + +void draw_close(Fl_Color col) +{ + fl_rotate(45); + fl_color(col); + + vv(-0.9f,-0.12f); vv(-0.9f,0.12f); vv(0.9f,0.12f); vv(0.9f,-0.12f); fl_fill_stroke(FL_DARK3); + vv(-0.12f,-0.9f); vv(-0.12f,0.9f); vv(0.12f,0.9f); vv(0.12f,-0.9f); fl_fill_stroke(FL_DARK3); +} + +void draw_max(Fl_Color col) +{ + fl_color(col); + + vv(-MAX_OF, -MAX_OF); vv(MAX_OF, -MAX_OF); + vv(MAX_OF,-MAX_OF+0.4); vv(-MAX_OF,-MAX_OF+0.4); + fl_fill(); + + vv(MAX_OF,-MAX_OF); vv(MAX_OF,MAX_OF); + vv(-MAX_OF,MAX_OF); vv(-MAX_OF,-MAX_OF); + fl_stroke(); +} + +void draw_maximized(Fl_Color col) +{ + fl_color(col); + + vv(-MAX_OF+RES_OF, -MAX_OF+RES_OF); vv(MAX_OF-RES_OF, -MAX_OF+RES_OF); + vv(MAX_OF-RES_OF,-MAX_OF+RES_OF); vv(MAX_OF-RES_OF,MAX_OF-RES_OF); + vv(-MAX_OF+RES_OF,MAX_OF-RES_OF); vv(-MAX_OF+RES_OF,-MAX_OF+RES_OF); + fl_stroke(); + + vv(-MAX_OF+RES_OF+0.2f, -MAX_OF+RES_OF+0.2f); vv(MAX_OF-RES_OF-0.2f, -MAX_OF+RES_OF+0.2f); + vv(MAX_OF-RES_OF-0.2f,-MAX_OF+RES_OF+0.2f); vv(MAX_OF-RES_OF-0.2f,MAX_OF-RES_OF-0.2f); + vv(-MAX_OF+RES_OF+0.2f,MAX_OF-RES_OF-0.2f); vv(-MAX_OF+RES_OF+0.2f,-MAX_OF+RES_OF+0.2f); + fl_stroke(); +} + + +void draw_min(Fl_Color col) +{ + fl_color(col); + + vv(-MIN_OF, MIN_OF); vv(MIN_OF, MIN_OF); + vv(MIN_OF, MIN_OF+0.3f); vv(-MIN_OF, MIN_OF+0.3f); + fl_fill(); +} + +void close_cb(Fl_Widget*, void* t) +{ + Titlebar* tb = (Titlebar*)t; + assert(tb != NULL); + tb->on_close(); +} + +void maximize_cb(Fl_Widget* b, void* t) +{ + Titlebar* tb = (Titlebar*)t; + assert(tb != NULL); + tb->on_maximize(); +} + +void shade_cb(Fl_Widget*, void* t) +{ + Titlebar* tb = (Titlebar*)t; + assert(tb != NULL); + tb->on_shade(); +} + +void minimize_cb(Fl_Widget*, void* t) +{ + Titlebar* tb = (Titlebar*)t; + assert(tb != NULL); + tb->on_minimize(); +} + +void lower_cb(Fl_Widget*, void* t) +{ + Titlebar* tb = (Titlebar*)t; + assert(tb != NULL); + tb->on_lower(); +} + +TitlebarButton::TitlebarButton(int type) : + Fl_Button(0, 0, 0, 0, 0), + button_type(type), + pos(PLACE_RIGHT) +{ + focus_box(FL_NO_BOX); + box(FL_FLAT_BOX); + label_type(FL_SYMBOL_LABEL); + + switch(button_type) + { + case TITLEBAR_CLOSE_UP: + label("@xx"); + break; + case TITLEBAR_MAX_UP: + label("@mx"); + break; + case TITLEBAR_MIN_UP: + label("@ii"); + break; + } +} + +TitlebarButton::~TitlebarButton() +{ +} + +/* Place buttons on titlebar. The can be either + * PLACE_RIGHT (standard in many wm-s) or PLACE_RIGHT + */ +void TitlebarButton::place(int p) +{ + if(p != PLACE_LEFT && p != PLACE_RIGHT) + pos = PLACE_RIGHT; + else + pos = p; +} + +Titlebar::Titlebar(Frame* f, int x, int y, int w, int h, const char* l) : + Fl_Group(x, y, w, h, l), + win_x(0), + win_y(0), + win_x1(0), + win_y1(0), + curr_frame(f), + minb(TITLEBAR_MIN_UP), + maxb(TITLEBAR_MAX_UP), + closeb(TITLEBAR_CLOSE_UP), + label_box(new Fl_Box(0, 0, 0, 0)), + icon_box(new Fl_Box(0, 0, 0, 0)), + focus_color(FL_GRAY), + unfocus_color(FL_WHITE) +{ + assert(curr_frame != NULL); + + box(FL_FLAT_BOX); + + fl_add_symbol("xx", draw_close, 1); + fl_add_symbol("mx", draw_max, 1); + fl_add_symbol("mz", draw_maximized, 1); + fl_add_symbol("ii", draw_min, 1); + label_box->box(FL_FLAT_BOX); + label_box->align(FL_ALIGN_LEFT | FL_ALIGN_INSIDE); + label_box->color(FL_GRAY); + + icon_box->image(app_img); + + title_menu = new Fl_Menu_(); + + /* XXX: any way this can be better ? + * When we change label of existing menu item, menu width will not be + * recalculated honoring size of that item. So we must initially fill + * them with blanks, which will keep longer labels fully visible. + */ + menu_max = title_menu->add(_("Maximize "), 0, maximize_cb, this); + menu_shade = title_menu->add(_("Shade "), 0, shade_cb, this); + menu_lower = title_menu->add(_("Lower "), 0, lower_cb, this); + menu_min = title_menu->add(_("Minimize "), 0, minimize_cb, this, FL_MENU_DIVIDER); + menu_close = title_menu->add(_("Close "), 0, close_cb, this); + + //closeb.place(PLACE_LEFT); + end(); + + closeb.callback(close_cb, this); + //minb.callback(minimize_cb, this); + minb.callback(shade_cb, this); + maxb.callback(maximize_cb, this); + + color(FL_GRAY); + //align(FL_ALIGN_LEFT | FL_ALIGN_INSIDE); + if(curr_frame->frame_type(FrameTypeDialog)) + { + minb.hide(); + maxb.hide(); + } +} + +Titlebar::~Titlebar() +{ +} + +#define PLACE_BUTTON(btn, leftx, rightx, mid, offset, sz) \ + if(btn.place() == PLACE_LEFT) \ + {\ + btn.resize(leftx, mid, sz, sz); \ + if(btn.visible()) \ + leftx += sz + offset; \ + }\ + if(btn.place() == PLACE_RIGHT) \ + {\ + btn.resize(rightx, mid, sz, sz); \ + if(btn.visible()) \ + rightx -= sz + offset; \ + } + +void Titlebar::layout(void) +{ + int initial_offset = 2; // distance from borders + int W = w() - box()->dx() - initial_offset; + int X = box()->dx() + initial_offset; + + int lsize = h() / 2 + 2; + int offset = 0; + int mid = 0; + int sz = h(); + + label_size(lsize); + + sz -= 4; // button width/height + mid = 2; + offset = 2; + + int lx = X + offset; // left x + int rx = W - sz - offset; // right x + + PLACE_BUTTON(closeb, lx, rx, mid, offset, sz) + PLACE_BUTTON(maxb, lx, rx, mid, offset, sz) + PLACE_BUTTON(minb, lx, rx, mid, offset, sz) + + //rx -= sz + offset; + //lx += sz + offset; + + if(icon_box->visible()) + { + icon_box->resize(lx, mid, sz, sz); + lx += sz + offset; + } + + lx += offset; + rx -= lx; + label_box->resize(lx, mid, rx, sz); + + fl_font(label_font(), label_size()); + // take a label from titlebar object + if(!label().empty()) + label_box->label(label()); + + Fl_Group::layout(); +} + +void Titlebar::focus(void) +{ + // TODO: add colors for label_box, buttons + color(focus_color); + redraw(); +} + +void Titlebar::unfocus(void) +{ + // TODO: add colors for label_box, buttons + color(unfocus_color); + redraw(); +} + +void Titlebar::on_close(void) +{ + assert(curr_frame != NULL); + curr_frame->close_kill(); +} + +void Titlebar::on_maximize(void) +{ + assert(curr_frame != NULL); + + if(curr_frame->state(FrameStateMaximized)) + { + curr_frame->restore(); + maxb.label("@mx"); + menu_max->label(_("Maximize")); + } + else + { + curr_frame->maximize(); + maxb.label("@mz"); + menu_max->label(_("UnMaximize")); + } +} + +void Titlebar::on_minimize(void) +{ + assert(curr_frame != NULL); + // TODO: not implemented +} + +void Titlebar::on_shade(void) +{ + assert(curr_frame != NULL); + + if(curr_frame->state(FrameStateShaded)) + { + curr_frame->unshade(); + menu_shade->label(_("Shade")); + } + else + { + curr_frame->shade(); + menu_shade->label(_("UnShade")); + } +} + +void Titlebar::on_lower(void) +{ + curr_frame->lower(); +} + +int Titlebar::handle(int event) +{ + // check if event is directed to our buttons + if(event == FL_PUSH || event == FL_RELEASE) + { + Fl_Widget* ch = 0; + for(int i = 0; i < children(); i++) + { + ch = child(i); + + // do not send event to label_box + if(label_box && ch == label_box) + continue; + + if(ch && Fl::event_inside(ch->x(), ch->y(), ch->w(), ch->h())) + { + ch->send(event); + return 1; + } + } + } + + // proceed to our events + switch(event) + { + case FL_PUSH: + ELOG("Titlebar FL_PUSH"); + + if(Fl::event_state(FL_BUTTON3)) + { + title_menu->popup(Fl::event_x_root(), Fl::event_y_root()); + title_menu->redraw(); + return 1; + } + + // prevent double click + if(Fl::event_is_click()) + curr_frame->raise(); + + win_x = Fl::event_x_root() - curr_frame->x(); + win_y = Fl::event_y_root() - curr_frame->y(); + return 1; + + case FL_DRAG: + ELOG("Titlebar FL_DRAG"); + // TODO: correct behaviour ??? + if(curr_frame->state(FrameStateMaximized)) + return 1; + + win_x1 = Fl::event_x_root() - win_x; + win_y1 = Fl::event_y_root() - win_y; + + if(!curr_frame->moving()) + { + curr_frame->move_start(); + + /* We can safely call grab_cursor() as many times + * as we want, since it have internal checks + * + * TODO: add XGrabServer() here + */ + curr_frame->set_cursor(CURSOR_MOVE); + curr_frame->grab_cursor(); + curr_frame->show_coordinates_window(); + } + + curr_frame->move_window(win_x1, win_y1); + curr_frame->update_coordinates_window(); + + return 1; + + case FL_RELEASE: + ELOG("Titlebar FL_RELEASE"); + if(curr_frame->moving()) + { + curr_frame->ungrab_cursor(); + curr_frame->set_cursor(CURSOR_DEFAULT); + curr_frame->move_end(); + curr_frame->hide_coordinates_window(); + } + return 1; + + case FL_ENTER: + ELOG("Titlebar::FL_ENTER"); + return 1; + case FL_LEAVE: + ELOG("Titlebar::FL_LEAVE"); + return 1; + default: + return Fl_Group::handle(event); + } + return 0; +} diff --git a/edewm/Titlebar.h b/edewm/Titlebar.h new file mode 100644 index 0000000..b4ff42c --- /dev/null +++ b/edewm/Titlebar.h @@ -0,0 +1,79 @@ +/* + * $Id$ + * + * Edewm, window manager + * Part of Equinox Desktop Environment (EDE). + * Copyright (c) 2000-2006 EDE Authors. + * + * This program is licenced under terms of the + * GNU General Public Licence version 2 or newer. + * See COPYING for details. + */ + +#ifndef __TITLEBAR_H__ +#define __TITLEBAR_H__ + +#include +#include +#include +#include +#include + +// TODO: remove this after themes are added +#define TITLEBAR_MAX_UP 1 +#define TITLEBAR_CLOSE_UP 2 +#define TITLEBAR_MIN_UP 3 + +#define PLACE_RIGHT 1 +#define PLACE_LEFT 2 + +class TitlebarButton : public Fl_Button +{ + private: + int button_type; + int pos; + public: + TitlebarButton(int type); + ~TitlebarButton(); + void place(int p); + int place(void) { return pos; } +}; + +class Frame; + +class Titlebar : public Fl_Group +{ + private: + int win_x, win_y, win_x1, win_y1; + Frame* curr_frame; + TitlebarButton minb; + TitlebarButton maxb; + TitlebarButton closeb; + Fl_Box* label_box; + Fl_Box* icon_box; + Fl_Color focus_color; + Fl_Color unfocus_color; + + Fl_Menu_* title_menu; + Fl_Widget* menu_max; + Fl_Widget* menu_min; + Fl_Widget* menu_close; + Fl_Widget* menu_shade; + Fl_Widget* menu_lower; + + public: + Titlebar(Frame* f, int x, int y, int w, int h, const char* l); + ~Titlebar(); + void layout(void); + int handle(int event); + void focus(void); + void unfocus(void); + + void on_close(void); + void on_maximize(void); + void on_minimize(void); + void on_shade(void); + void on_lower(void); +}; + +#endif diff --git a/edewm/Tracers.h b/edewm/Tracers.h new file mode 100644 index 0000000..0ac9c96 --- /dev/null +++ b/edewm/Tracers.h @@ -0,0 +1,42 @@ +/* + * $Id$ + * + * Edewm, window manager + * Part of Equinox Desktop Environment (EDE). + * Copyright (c) 2000-2006 EDE Authors. + * + * This program is licenced under terms of the + * GNU General Public Licence version 2 or newer. + * See COPYING for details. + */ + +#ifndef __TRACERS_H__ +#define __TRACERS_H__ + +#include "debug.h" + +#ifdef _DEBUG + class FunctionTracer + { + private: + const char* func; + public: + FunctionTracer(const char* f) : func(f) + { + if(func) + EPRINTF("Function [+]: \"%s\"\n", func); + } + + ~FunctionTracer() + { + if(func) + EPRINTF("Function [-]: \"%s\"\n", func); + } + }; + + #define TRACE_FUNCTION(name) FunctionTracer foo(name) +#else + #define TRACE_FUNCTION(name) (void)0 +#endif // _DEBUG + +#endif diff --git a/edewm/Utils.cpp b/edewm/Utils.cpp new file mode 100644 index 0000000..1b97065 --- /dev/null +++ b/edewm/Utils.cpp @@ -0,0 +1,29 @@ +/* + * $Id$ + * + * Edewm, window manager + * Part of Equinox Desktop Environment (EDE). + * Copyright (c) 2000-2006 EDE Authors. + * + * This program is licenced under terms of the + * GNU General Public Licence version 2 or newer. + * See COPYING for details. + */ + +#include "Utils.h" +#include + +void SendMessage(Window win, Atom a, Atom l) +{ + XEvent ev; + long mask; + memset(&ev, 0, sizeof(ev)); + ev.xclient.type = ClientMessage; + ev.xclient.window = win; + ev.xclient.message_type = a; + ev.xclient.format = 32; + ev.xclient.data.l[0] = long(l); + ev.xclient.data.l[1] = long(fl_event_time); + mask = 0L; + XSendEvent(fl_display, win, False, mask, &ev); +} diff --git a/edewm/Utils.h b/edewm/Utils.h new file mode 100644 index 0000000..4619f29 --- /dev/null +++ b/edewm/Utils.h @@ -0,0 +1,20 @@ +/* + * $Id$ + * + * Edewm, window manager + * Part of Equinox Desktop Environment (EDE). + * Copyright (c) 2000-2006 EDE Authors. + * + * This program is licenced under terms of the + * GNU General Public Licence version 2 or newer. + * See COPYING for details. + */ + +#ifndef __UTILS_H__ +#define __UTILS_H__ + +#include + +void SendMessage(Window win, Atom a, Atom l); + +#endif // _UTILS_H_ diff --git a/edewm/Windowmanager.cpp b/edewm/Windowmanager.cpp new file mode 100644 index 0000000..effd21f --- /dev/null +++ b/edewm/Windowmanager.cpp @@ -0,0 +1,733 @@ +/* + * $Id$ + * + * Edewm, window manager + * Part of Equinox Desktop Environment (EDE). + * Copyright (c) 2000-2006 EDE Authors. + * + * This program is licenced under terms of the + * GNU General Public Licence version 2 or newer. + * See COPYING for details. + */ + +#include "Windowmanager.h" +#include "Atoms.h" +#include "Hints.h" +#include "Frame.h" +#include "../exset/exset.h" +#include "Tracers.h" +#include "Sound.h" +#include "debug.h" + +#include +#include +#include +#include + +#define WM_CONFIG_FILE "wmanager.conf" +#define EDE_CONFIG_FILE "ede.conf" + + +WindowManager* WindowManager::pinstance = NULL; +int x_errors; + +/* This is one of the most important part of wm and reflects + * current design. Wm will try to send all messages to frame itself, + * after trying to find it's ID in collected list. All further processing + * is left to that frame. Other messages will process wm, + * minimizing spreading events all over the code. + * I'am not in love with this decision; it's roots are from previous + * edewm code (the real roots are from icewm). + * + * Future major versions will probably have different design. + */ +int wm_event_handler(int e) +{ + if(fl_xevent.type == KeyPress) + e = FL_KEY; + if(!e) + { + Window window = fl_xevent.xany.window; + switch(fl_xevent.type) + { + case CirculateNotify: + case CirculateRequest: + case ConfigureNotify: + case ConfigureRequest: + case CreateNotify: + case GravityNotify: + /*case MapNotify:*/ + case MapRequest: + case ReparentNotify: + case UnmapNotify: + window = fl_xevent.xmaprequest.window; + break; + } + + FrameList::iterator last = WindowManager::instance()->window_list.end(); + for(FrameList::iterator it = WindowManager::instance()->window_list.begin(); it != last; ++it) + { + Frame* c = *it; + if(c->window() == window || fl_xid(c) == window) + { + //ELOG("wm_event_handler-> window found (%i), sending a message", i); + return c->handle(&fl_xevent); + } + } + + return WindowManager::instance()->handle(&fl_xevent); + } + else + return WindowManager::instance()->handle(e); +} + +int convert_align(int a) +{ + switch(a) + { + default: + case 0: break; + case 1: return FL_ALIGN_RIGHT; + case 2: return FL_ALIGN_CENTER; + } + return FL_ALIGN_LEFT; +} + +int xerror_handler(Display* d, XErrorEvent* e) +{ + if(e->request_code == X_ChangeWindowAttributes && + e->error_code == BadAccess && + e->resourceid == RootWindow(fl_display, DefaultScreen(fl_display))) + { + // force cleaning data + WindowManager::shutdown(); + Fl::fatal(_("Another window manager is running. You must exit it before running edewm.")); + } + + x_errors++; + + char buff[128]; + + EPRINTF("\n"); + XGetErrorDatabaseText(fl_display, "XlibMessage", "XError", "", buff, 128); + EPRINTF("%s: ", buff); + XGetErrorText(fl_display, e->error_code, buff, 128); + EPRINTF("%s \n", buff); + + XGetErrorDatabaseText(fl_display, "XlibMessage", "MajorCode", "%d", buff, 128); + EPRINTF(" "); + EPRINTF(buff, e->request_code); + + sprintf(buff, "%d", e->request_code); + XGetErrorDatabaseText(fl_display, "XRequest", buff, "%d", buff, 128); + EPRINTF(" (%s)\n", buff); + + XGetErrorDatabaseText(fl_display, "XlibMessage", "MinorCode", "%d", buff, 128); + EPRINTF(" "); + EPRINTF(buff, e->minor_code); + EPRINTF(" "); + XGetErrorDatabaseText(fl_display, "XlibMessage", "ResourceID", "%d", buff, 128); + EPRINTF(buff, e->resourceid); + + EPRINTF("\n"); + EPRINTF("\n"); + + return 0; +} + +bool ValidateDrawable(Drawable d) +{ + Window w; + int dummy; + unsigned int dummy_ui; + + XSync(fl_display, False); + x_errors = 0; + XGetGeometry(fl_display, d, &w, &dummy, &dummy, &dummy_ui, &dummy_ui, &dummy_ui, &dummy_ui); + XSync(fl_display, False); + + bool ret = (x_errors == 0 ? true : false); + x_errors = 0; + +/* + if(ret != true) + { + WindowManager::shutdown(); + assert(ret == true); + } +*/ + + return ret; +} + +WindowManager::WindowManager() : Fl_Window(0, 0, Fl::w(), Fl::h()), is_running(false) +{ + box(FL_NO_BOX); + ELOG("WindowManager constructor"); +} + +WindowManager::~WindowManager() +{ + ELOG("WindowManager destructor"); + + FrameList::iterator last = window_list.end(); + for(FrameList::iterator it = window_list.begin(); it != last; ++it) + { + Frame* f = *it; + delete f; + } + window_list.clear(); + + sound_system->shutdown(); + delete sound_system; + + delete wm_conf; + delete hint_stuff; + delete cur; +} + +WindowManager* WindowManager::instance(void) +{ + assert(WindowManager::pinstance != NULL); + return WindowManager::pinstance; +} + +void WindowManager::init(int argc, char** argv) +{ + if(WindowManager::pinstance != NULL) + return; + + WindowManager::pinstance = new WindowManager(); + WindowManager::pinstance->init_internals(); +} + +void WindowManager::shutdown(void) +{ + if(WindowManager::pinstance != NULL) + { + delete WindowManager::pinstance; + WindowManager::pinstance = NULL; + } +} + +void WindowManager::init_internals(void) +{ + ELOG("Starting window manager"); + wm_conf = new WindowManagerConfig; + + app_starting = false; + + // defaults, in case world goes down + wm_conf->title_active_color = fl_rgb(0,0,128); + wm_conf->title_active_color_text = fl_rgb(255,255,255); + wm_conf->title_normal_color = fl_rgb(192,192,192); + wm_conf->title_normal_color_text = fl_rgb(0,0,128); + wm_conf->title_label_align = FL_ALIGN_LEFT; + wm_conf->title_height = 20; + wm_conf->title_box_type = 0; + wm_conf->frame_do_opaque = false; + wm_conf->frame_animate = true; + wm_conf->frame_animate_speed = 15; + + fl_open_display(); + XSetErrorHandler(xerror_handler); + wm_area.set(0, 0, Fl::w(), Fl::h()); + + read_configuration(); + read_xset_configuration(); + + //register_protocols(); +#ifdef _DEBUG + InitAtoms(fl_display, atom_map); + register_events(); +#else + InitAtoms(fl_display); +#endif + + //cur = XCreateFontCursor(fl_display, XC_left_ptr); + //XDefineCursor(fl_display, RootWindow(fl_display, fl_screen), cur); + // load cursor + cur = new CursorHandler; + cur->load(X_CURSORS); + cur->set_root_cursor(); + + sound_system = new SoundSystem(); + sound_system->init(); + + sound_system->add(SOUND_MINIMIZE, "sounds/minimize.ogg"); + sound_system->add(SOUND_MAXIMIZE, "sounds/maximize.ogg"); + sound_system->add(SOUND_CLOSE, "sounds/close.ogg"); + sound_system->add(SOUND_RESTORE, "sounds/restore.ogg"); + sound_system->add(SOUND_SHADE, "sounds/shade.ogg"); + + // the world is starting here + show(); + register_protocols(); + + hint_stuff = new Hints; + hint_stuff->icccm_set_iconsizes(this); + + init_clients(); + Fl::add_handler(wm_event_handler); + XSync(fl_display, 0); + + is_running = true; +} + +// load current visible clients +void WindowManager::init_clients(void) +{ + Frame* frame = 0; + uint win_num; + Window w1, w2, *wins; + XWindowAttributes attr; + XQueryTree(fl_display, fl_xid(this), &w1, &w2, &wins, &win_num); + + // XXX: excluding root parent !!! + //for (uint i = 0; i < win_num-1; i++) + for (uint i = 0; i < win_num; i++) + { + XGetWindowAttributes(fl_display, wins[i], &attr); + if(!attr.override_redirect && attr.map_state == IsViewable) + { + if(!attr.screen) + { + ELOG("Screen not as window, skiping..."); + continue; + } + + if(ValidateDrawable(wins[i])) + frame = new Frame(wins[i], &attr); + } + else + ELOG("Skipping override_redirect window"); + } + XFree((void *)wins); +} + +// register type messages wm understainds +void WindowManager::register_protocols(void) +{ + ELOG("Loading protocols"); + SetSupported(root_win); +} + +void WindowManager::read_configuration(void) +{ + ELOG("Reading config"); + Fl_Config conf(fl_find_config_file(WM_CONFIG_FILE, 0)); + conf.set_section("TitleBar"); + conf.read("Active color", wm_conf->title_active_color, fl_rgb(0, 0, 128)); + conf.read("Normal color", wm_conf->title_normal_color, fl_rgb(192, 192, 192)); + conf.read("Active color text", wm_conf->title_active_color_text, fl_rgb(255, 255, 255)); + conf.read("Normal color text", wm_conf->title_normal_color_text, fl_rgb(0, 0, 128)); + conf.read("Box type", wm_conf->title_box_type, 0); + conf.read("Height", wm_conf->title_height, 20); + + int la; + conf.read("Text align", la, 0); + wm_conf->title_label_align = convert_align(la); + + conf.set_section("Resize"); + conf.read("Opaque resize", wm_conf->frame_do_opaque, false); + conf.read("Animate", wm_conf->frame_animate, true); + conf.read("Animate Speed", wm_conf->frame_animate_speed, 15); + + conf.set_section("Misc"); + conf.read("Use theme", wm_conf->use_theme); + + notify_clients(); +} + +void WindowManager::read_xset_configuration(void) +{ + Fl_Config conf(fl_find_config_file(EDE_CONFIG_FILE, 1)); + int val1, val2, val3; + Exset xset; + + conf.set_section("Mouse"); + conf.read("Accel", val1, 4); + conf.read("Thress",val2, 4); + xset.set_mouse(val1, val2); + + conf.set_section("Bell"); + conf.read("Volume", val1, 50); + conf.read("Pitch", val2, 440); + conf.read("Duration", val3, 200); + xset.set_bell(val1, val2, val3); + + conf.set_section("Keyboard"); + conf.read("Repeat", val1, 1); + conf.read("ClickVolume", val2, 50); + xset.set_keybd(val1, val2); + + conf.set_section("Screen"); + conf.read("Delay", val1, 15); + conf.read("Pattern",val2, 2); + xset.set_pattern(val1, val2); + + conf.read("CheckBlank", val1, 1); + xset.set_check_blank(val1); + + conf.read("Pattern", val1, 2); + xset.set_blank(val1); +} + +void WindowManager::notify_clients(void) +{ +#warning "TODO: implement WindowManager::notify_clients()" +} + +void WindowManager::show(void) +{ + if(!shown()) + { + create(); + /* Destroy efltk window, set RootWindow to our + * xid and redirect all messages to us, which + * will make us a window manager. + */ + XDestroyWindow(fl_display, Fl_X::i(this)->xid); + Fl_X::i(this)->xid = RootWindow(fl_display, fl_screen); + root_win = RootWindow(fl_display, fl_screen); + XSelectInput(fl_display, fl_xid(this), + SubstructureRedirectMask | + SubstructureNotifyMask | + ColormapChangeMask | + PropertyChangeMask | + ButtonPressMask | + ButtonReleaseMask | + EnterWindowMask | + LeaveWindowMask | + KeyPressMask | + KeyReleaseMask | + KeymapStateMask); + + ELOG("RootWindow ID set to xid"); + draw(); + } +} + +void WindowManager::draw(void) +{ + ELOG("RootWindow draw"); + // redraw root window + XClearWindow(fl_display, fl_xid(this)); +} + +void WindowManager::idle(void) +{ + //ELOG("Idle"); + FrameList::iterator last = remove_list.end(); + for(FrameList::iterator it = remove_list.begin(); it != last; ++it) + { + Frame* f = *it; + delete f; + } + remove_list.clear(); +} + +void WindowManager::exit(void) +{ + if(is_running) + is_running = false; +} + +const Cursor WindowManager::root_cursor(void) +{ + assert(cur != NULL); + return cur->root_cursor(); +} + +void WindowManager::set_cursor(Frame* f, CursorType t) +{ + assert(f != NULL); + cur->set_cursor(f, t); +/* + if(cur->cursor_shape_type() == FLTK_CURSORS) + cur->set_fltk_cursor(f, t); + else + cur->set_x_cursor(f, t); +*/ +} + +const CursorHandler* WindowManager::cursor_handler(void) +{ + assert(cur != NULL); + return cur; +} + +int WindowManager::handle(int event) +{ + Window window = fl_xevent.xany.window; + switch(event) + { + case FL_PUSH: + { + FrameList::iterator last = window_list.end(); + for(FrameList::iterator it = window_list.begin(); it != last; ++it) + { + Frame* f = *it; + if(f->window() == window || fl_xid(f) == window) + { + f->content_click(); + return 1; + } + } + + ELOG("FL_PUSH on root"); + return 0; + } + + case FL_SHORTCUT: + case FL_KEY: + + ELOG("FL_SHORCUT | FL_KEY"); + return 1; + case FL_MOUSEWHEEL: + XAllowEvents(fl_display, ReplayPointer, CurrentTime); + return 0; + } + return 0; +} + +int WindowManager::handle(XEvent* event) +{ + switch(event->type) + { + /* ClientMessage is only used for desktop handling + * and startup notifications. + */ + case ClientMessage: + { + ELOG("ClientMessage in wm"); + if(event->xclient.message_type == _XA_EDE_WM_STARTUP_NOTIFY) + { + Atom data = event->xclient.data.l[0]; + if(data == _XA_EDE_WM_APP_STARTING) + { + app_starting = true; + cur->set_root_cursor(CURSOR_WAIT); + } + } + return 1; + } + case MapRequest: + { + ELOG("MapRequest from wm"); + const XMapRequestEvent* e = &(fl_xevent.xmaprequest); + + XWindowAttributes attrs; + XGetWindowAttributes(fl_display, e->window, &attrs); + if(!attrs.override_redirect) + { + ELOG("--- map from wm ---"); + new Frame(e->window); + + if(app_starting) + { + cur->set_root_cursor(CURSOR_DEFAULT); + app_starting = false; + } + } + + return 1; + } + case ConfigureRequest: + { + ELOG("ConfigureRequest from wm"); + const XConfigureRequestEvent *e = &(fl_xevent.xconfigurerequest); + XConfigureWindow(fl_display, e->window, e->value_mask&~(CWSibling|CWStackMode), + (XWindowChanges*)&(e->x)); + return 1; + } + + default: + return 0; + } + return 0; +} + +/* Clear stack_list and window_list for those + * windows schedulied for removal. + * Expensive operation, so use it with care. + */ +void WindowManager::update_client_list(void) +{ + bool found = false; + + // first clear aot_list + FrameList::iterator last = aot_list.end(); + for(FrameList::iterator it = aot_list.begin(); it != last; ++it) + { + Frame* f = *it; + if(f->destroy_scheduled()) + { + // erase current and let 'it' point to next element + it = aot_list.erase(it); + found = true; + } + } + + // then clear stack_list + if(!found) + { + last = stack_list.end(); + for(FrameList::iterator it = stack_list.begin(); it != last; ++it) + { + Frame* f = *it; + if(f->destroy_scheduled()) + it = stack_list.erase(it); + } + } + + // then window_list + last = window_list.end(); + for(FrameList::iterator it = window_list.begin(); it != last; ++it) + { + Frame* f = *it; + if(f->destroy_scheduled()) + { + // TODO: do I need this ??? + remove_list.push_back(*it); + it = window_list.erase(it); + } + } +} + +/* Used by frames. + * Window manager will check position of last client and + * return possible next one + * + * Accepted values are: current frame width and height, and + * returned is position where it should be placed. + */ +bool WindowManager::query_best_position(int* x, int* y, int w, int h) +{ + const int offset = 20; + + if(window_list.size() <= 0) + return false; + + //Frame* f = window_list[window_list.size()-1]; + Frame* f = *(--window_list.end()); + if(!f) + return false; + + *x = f->x() + offset; + *y = f->y() + offset; + + // if w-h of frame are larger than area + // place them to apropriate corners + if((*x + w) > wm_area.w()) + *x = wm_area.x(); + if((*y + h) > wm_area.h()) + *y = wm_area.y(); + + return true; +} + +Frame* WindowManager::find_xid(Window win) +{ + FrameList::iterator last = window_list.end(); + for(FrameList::iterator it = window_list.begin(); it != last; ++it) + { + Frame* f = *it; + if(f->window() == win) + return f; + } + + return 0; +} + +void WindowManager::restack_windows(void) +{ + TRACE_FUNCTION("void WindowManager::restack_windows(void)"); + + Window* stack = new Window[aot_list.size() + stack_list.size()]; + FrameList::iterator it = aot_list.begin(); + FrameList::iterator last = aot_list.end(); + unsigned int i = 0; + + for(; it != last && i < aot_list.size(); ++it, i++) + stack[i] = fl_xid(*it); + + it = stack_list.begin(); + last = stack_list.end(); + + + for(; it != last && i < aot_list.size() + stack_list.size(); ++it, i++) + stack[i] = fl_xid(*it); + + XRestackWindows(fl_display, stack, stack_list.size()); + delete [] stack; +} + +void WindowManager::clear_focus_windows(void) +{ + if(aot_list.size() > 0) + { + FrameList::iterator it = aot_list.begin(); + FrameList::iterator last = aot_list.end(); + for(; it != last; ++it) + (*it)->unfocus(); + } + + FrameList::iterator it = stack_list.begin(); + FrameList::iterator last = stack_list.end(); + for(; it != last; ++it) + (*it)->unfocus(); +} + +void WindowManager::play_sound(short event) +{ + assert(sound_system != NULL); + sound_system->play(event); +} + + +#ifdef _DEBUG +void WindowManager::register_events(void) +{ + xevent_map[CirculateNotify] = "CirculateNotify"; + xevent_map[CirculateRequest] = "CirculateRequest"; + xevent_map[ConfigureNotify] = "ConfigureNotify"; + xevent_map[ConfigureRequest] = "ConfigureRequest"; + xevent_map[CreateNotify] = "CreateNotify"; + xevent_map[GravityNotify] = "GravityNotify"; + xevent_map[MapNotify] = "MapNotify"; + xevent_map[MapRequest] = "MapRequest"; + xevent_map[ReparentNotify] = "ReparentNotify"; + xevent_map[UnmapNotify] = "UnmapNotify"; + xevent_map[DestroyNotify] = "DestroyNotify"; + xevent_map[PropertyNotify] = "PropertyNotify"; + xevent_map[EnterNotify] = "EnterNotify"; + xevent_map[LeaveNotify] = "LeaveNotify"; + xevent_map[VisibilityNotify] = "VisibilityNotify"; + xevent_map[FocusIn] = "FocusIn"; + xevent_map[FocusOut] = "FocusOut"; + xevent_map[ClientMessage] = "ClientMessage"; + + efltkevent_map[FL_PUSH] = "FL_PUSH"; + efltkevent_map[FL_RELEASE] = "FL_RELEASE"; + efltkevent_map[FL_ENTER] = "FL_ENTER"; + efltkevent_map[FL_LEAVE] = "FL_LEAVE"; + efltkevent_map[FL_DRAG] = "FL_DRAG"; + efltkevent_map[FL_FOCUS] = "FL_FOCUS"; + efltkevent_map[FL_UNFOCUS] = "FL_UNFOCUS"; + efltkevent_map[FL_KEY] = "FL_KEY"; + efltkevent_map[FL_KEYUP] = "FL_KEYUP"; + efltkevent_map[FL_MOVE] = "FL_MOVE"; + efltkevent_map[FL_SHORTCUT] = "FL_SHORTCUT"; + efltkevent_map[FL_ACTIVATE] = "FL_ACTIVATE"; + efltkevent_map[FL_DEACTIVATE]= "FL_DEACTIVATE"; + efltkevent_map[FL_SHOW] = "FL_SHOW"; + efltkevent_map[FL_HIDE] = "FL_HIDE"; + efltkevent_map[FL_MOUSEWHEEL]= "FL_MOUSEWHEEL"; + efltkevent_map[FL_PASTE] = "FL_PASTE"; + efltkevent_map[FL_DND_ENTER] = "FL_DND_ENTER"; + efltkevent_map[FL_DND_DRAG] = "FL_DND_DRAG"; + efltkevent_map[FL_DND_LEAVE] = "FL_DND_LEAVE"; + efltkevent_map[FL_DND_RELEASE] = "FL_DND_RELEASE"; +} +#endif diff --git a/edewm/Windowmanager.h b/edewm/Windowmanager.h new file mode 100644 index 0000000..aa9f963 --- /dev/null +++ b/edewm/Windowmanager.h @@ -0,0 +1,165 @@ +/* + * $Id$ + * + * Edewm, window manager + * Part of Equinox Desktop Environment (EDE). + * Copyright (c) 2000-2006 EDE Authors. + * + * This program is licenced under terms of the + * GNU General Public Licence version 2 or newer. + * See COPYING for details. + */ + +#ifndef _WINDOWMANAGER_H_ +#define _WINDOWMANAGER_H_ + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "Cursor.h" + +#ifdef _DEBUG +#include +#endif + +#include + +/* +class Frame_List : public Fl_Ptr_List { +public: + Frame_List() : Fl_Ptr_List() { } + + void append(Frame *item) { Fl_Ptr_List::append((void *)item); } + void prepend(Frame *item) { Fl_Ptr_List::prepend((void *)item); } + void insert(uint pos, Frame *item) { Fl_Ptr_List::insert(pos, (void *)item); } + void replace(uint pos, Frame *item) { Fl_Ptr_List::replace(pos, (void *)item); } + void remove(uint pos) { Fl_Ptr_List::remove(pos); } + bool remove(Frame *item) { return Fl_Ptr_List::remove((void *)item); } + int index_of(const Frame *w) const { return Fl_Ptr_List::index_of((void*)w); } + Frame *item(uint index) const { return (Frame*)Fl_Ptr_List::item(index); } + + Frame **data() { return (Frame**)items; } + + Frame *operator [](uint ind) const { return (Frame *)items[ind]; } +}; +*/ + +struct WindowManagerConfig +{ + Fl_Color title_active_color; + Fl_Color title_active_color_text; + Fl_Color title_normal_color; + Fl_Color title_normal_color_text; + + int title_label_align; + int title_height; + int title_box_type; + + bool frame_do_opaque; + bool frame_animate; + int frame_animate_speed; + + bool use_theme; +}; + + +// The WindowManager class looks like a window to efltk but is actually the +// screen's root window. This is done by setting xid to "show" it +// rather than have efltk create the window. Class handles all root +// windows X events + +struct Hints; +class Frame; +class CursorHandler; +class SoundSystem; +typedef std::list FrameList; + +class WindowManager : public Fl_Window +{ + private: + bool is_running; + static WindowManager* pinstance; + WindowManagerConfig* wm_conf; + Fl_Rect wm_area; + Window root_win; + Hints* hint_stuff; + + CursorHandler* cur; + SoundSystem* sound_system; + + bool app_starting; + + WindowManager(); + ~WindowManager(); + WindowManager(const WindowManager&); + WindowManager& operator=(WindowManager&); + void register_protocols(void); + void init_internals(void); + void init_clients(void); + + public: + static void init(int argc, char** argv); + static void shutdown(void); + static WindowManager* instance(); + void read_configuration(void); + void read_xset_configuration(void); + void notify_clients(void); + void show(void); + void hide(void) { } // prevent efltk from root window hiding + void draw(void); + int handle(int event); + int handle(XEvent* e); + void update_client_list(void); + bool running(void) { return is_running; } + Window root_window(void) { return root_win; } + void idle(void); + Hints* hints(void) { return hint_stuff; } + void exit(void); + int x(void) { return wm_area.x(); } + int y(void) { return wm_area.y(); } + int w(void) { return wm_area.w(); } + int h(void) { return wm_area.h(); } + + bool query_best_position(int* x, int* y, int w, int h); + Frame* find_xid(Window win); + void restack_windows(void); + void clear_focus_windows(void); + + void play_sound(short event); + + const Cursor root_cursor(void); + const CursorHandler* cursor_handler(void); + void set_cursor(Frame* f, CursorType t); + + //FrameList window_list; + //FrameList remove_list; + + // list of mapped windows (it is not changed excep window is destroyed) + FrameList window_list; + // stacking list of ordinary windows + FrameList stack_list; + // list of destroyed windows (cleared in WindowManager::idle() phase) + FrameList remove_list; + // list of always on top windows (transients etc.) + FrameList aot_list; + + +#ifdef _DEBUG + std::map atom_map; + std::map xevent_map; + std::map efltkevent_map; + + void register_events(void); +#endif +}; + + +bool ValidateDrawable(Drawable d); + +#endif diff --git a/edewm/app.xpm b/edewm/app.xpm new file mode 100644 index 0000000..2c5f3d9 --- /dev/null +++ b/edewm/app.xpm @@ -0,0 +1,21 @@ +/* XPM */ +static char * app_xpm[] = { +"16 16 2 1", +" c None", +". c #FF0000", +" ", +" ", +" ", +" .... . ", +" .... . ", +" .... . ", +" .... . ", +" ... . ", +" . .. ", +" . .... ", +" . .... ", +" . .... ", +" . .... ", +" . .... ", +" ", +" "}; diff --git a/edewm/debug.cpp b/edewm/debug.cpp new file mode 100644 index 0000000..4830436 --- /dev/null +++ b/edewm/debug.cpp @@ -0,0 +1,62 @@ +/* + * $Id$ + * + * Edewm, window manager + * Part of Equinox Desktop Environment (EDE). + * Copyright (c) 2000-2006 EDE Authors. + * + * This program is licenced under terms of the + * GNU General Public Licence version 2 or newer. + * See COPYING for details. + */ + +#include "debug.h" +#include +#include + +#define OUT_TYPE stdout + +void edewm_log(const char* str, ...) +{ +#ifdef _DEBUG + fprintf(OUT_TYPE, "wm: "); + va_list args; + va_start(args, str); + vfprintf(OUT_TYPE, str, args); + fprintf(OUT_TYPE, "\n"); + fflush(OUT_TYPE); +#endif +} +void edewm_warning(const char* str, ...) +{ +#ifdef _DEBUG + fprintf(OUT_TYPE, "wm (warning): "); + va_list args; + va_start(args, str); + vfprintf(OUT_TYPE, str, args); + fprintf(OUT_TYPE, "\n"); + fflush(OUT_TYPE); +#endif +} + +void edewm_fatal(const char* str, ...) +{ +#ifdef _DEBUG + fprintf(OUT_TYPE, "!!! wm (fatal): "); + va_list args; + va_start(args, str); + vfprintf(OUT_TYPE, str, args); + fprintf(OUT_TYPE, "\n"); + fflush(OUT_TYPE); +#endif +} + +void edewm_printf(const char* str, ...) +{ +#ifdef _DEBUG + va_list args; + va_start(args, str); + vfprintf(OUT_TYPE, str, args); + fflush(OUT_TYPE); +#endif +} diff --git a/edewm/debug.h b/edewm/debug.h new file mode 100644 index 0000000..ff243f9 --- /dev/null +++ b/edewm/debug.h @@ -0,0 +1,26 @@ +/* + * $Id$ + * + * Edewm, window manager + * Part of Equinox Desktop Environment (EDE). + * Copyright (c) 2000-2006 EDE Authors. + * + * This program is licenced under terms of the + * GNU General Public Licence version 2 or newer. + * See COPYING for details. + */ + +#ifndef __DEBUG_H__ +#define __DEBUG_H__ + +void edewm_log(const char* str, ...); +void edewm_printf(const char* str, ...); +void edewm_warning(const char* str, ...); +void edewm_fatal(const char* str, ...); + +#define ELOG edewm_log +#define EWARNING edewm_warning +#define EFATAL edewm_fatal +#define EPRINTF edewm_printf + +#endif diff --git a/edewm/locale/fi.po b/edewm/locale/fi.po new file mode 100644 index 0000000..ffb9e61 --- /dev/null +++ b/edewm/locale/fi.po @@ -0,0 +1,89 @@ +# Finnish translation of edewm. +# Copyright (C) 2002 THE edewm'S COPYRIGHT HOLDER +# This file is distributed under the same license as the edewm package. +# Mikko L. , 2002. +# +msgid "" +msgstr "" +"Project-Id-Version: edewm 1.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2005-02-04 12:33+0100\n" +"PO-Revision-Date: 2002-09-16 11:07+0300\n" +"Last-Translator: Mikko L. \n" +"Language-Team: Finnish \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=iso-8859-15\n" +"Content-Transfer-Encoding: 8bit\n" + +#: Desktop.cpp:138 Desktop.cpp:180 +#, c-format +msgid "Workspace %d" +msgstr "Typyt %d" + +#: Frame.cpp:106 +msgid "Untitled" +msgstr "Nimetn" + +#: Frame.cpp:938 +#, c-format +msgid "EDEWM: Internal bug, when restacking (%d != %d)! Exiting... " +msgstr "" + +#: Titlebar.cpp:215 +msgid "Sticky" +msgstr "Kiinte" + +#: Titlebar.cpp:275 Titlebar.cpp:320 +msgid "Set size" +msgstr "" + +#: Titlebar.cpp:276 +msgid "Set size to window:" +msgstr "" + +#: Titlebar.cpp:285 +msgid "width:" +msgstr "" + +#: Titlebar.cpp:287 +msgid "height:" +msgstr "" + +#: Titlebar.cpp:291 +msgid "&OK" +msgstr "" + +#: Titlebar.cpp:294 +msgid "&Cancel" +msgstr "" + +#: Titlebar.cpp:318 Titlebar.cpp:331 +msgid "Maximize" +msgstr "Suurenna" + +#: Titlebar.cpp:319 +msgid "Minimize" +msgstr "Pienenn" + +#: Titlebar.cpp:321 +msgid "To Desktop" +msgstr "Typydlle:" + +#: Titlebar.cpp:322 +msgid "Kill" +msgstr "Tapa" + +#: Titlebar.cpp:323 +msgid "Close" +msgstr "Sulje" + +#: Titlebar.cpp:330 +msgid "Restore" +msgstr "Palauta" + +#: Windowmanager.cpp:90 +#, c-format +msgid "Another window manager is running. You must exit it before running %s." +msgstr "" +"Toinen ikkunointi jrjestelm kynniss. Sinun tytyy lopettaa se ennen kuin " +"voit ajaa: %s" diff --git a/edewm/locale/hu.po b/edewm/locale/hu.po new file mode 100644 index 0000000..2984a51 --- /dev/null +++ b/edewm/locale/hu.po @@ -0,0 +1,85 @@ +msgid "" +msgstr "" +"Project-Id-Version: \n" +"POT-Creation-Date: \n" +"PO-Revision-Date: 2005-02-09 11:21+0100\n" +"Last-Translator: Nemeth Otto \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: Desktop.cpp:138 +#: Desktop.cpp:180 +#, c-format +msgid "Workspace %d" +msgstr "Munkaterület %d" + +#: Frame.cpp:106 +msgid "Untitled" +msgstr "Névtelen" + +#: Frame.cpp:938 +#, c-format +msgid "EDEWM: Internal bug, when restacking (%d != %d)! Exiting... " +msgstr "EDEWM: Belső hiba, restacking (%d != %d)! Kilépés... " + +#: Titlebar.cpp:215 +msgid "Sticky" +msgstr "Ragadós" + +#: Titlebar.cpp:275 +#: Titlebar.cpp:320 +msgid "Set size" +msgstr "Méret beállítása" + +#: Titlebar.cpp:276 +msgid "Set size to window:" +msgstr "Ablakméret beállítása:" + +#: Titlebar.cpp:285 +msgid "width:" +msgstr "szél.:" + +#: Titlebar.cpp:287 +msgid "height:" +msgstr "mag.:" + +#: Titlebar.cpp:291 +msgid "&OK" +msgstr "&OK" + +#: Titlebar.cpp:294 +msgid "&Cancel" +msgstr "Mégs&em" + +#: Titlebar.cpp:318 +#: Titlebar.cpp:331 +msgid "Maximize" +msgstr "Maximalizálás" + +#: Titlebar.cpp:319 +msgid "Minimize" +msgstr "Minimalizálás" + +#: Titlebar.cpp:321 +msgid "To Desktop" +msgstr "Munkaterületre" + +#: Titlebar.cpp:322 +msgid "Kill" +msgstr "Kilövés" + +#: Titlebar.cpp:323 +msgid "Close" +msgstr "Bezárás" + +#: Titlebar.cpp:330 +msgid "Restore" +msgstr "Visszaállítás" + +#: Windowmanager.cpp:90 +#, c-format +msgid "Another window manager is running. You must exit it before running %s." +msgstr "Egy másik ablakkezelő fut. Ki kell lépni belőle mielőtt ezt futtatod: %s." + diff --git a/edewm/locale/id.po b/edewm/locale/id.po new file mode 100644 index 0000000..ad79606 --- /dev/null +++ b/edewm/locale/id.po @@ -0,0 +1,89 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +msgid "" +msgstr "" +"Project-Id-Version: edewm 1.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2005-02-04 12:33+0100\n" +"PO-Revision-Date: 202-11-29 14:20+0700\n" +"Last-Translator: Bambang Purnomosidi D. P. \n" +"Language-Team: id \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=iso-8859-2\n" +"Content-Transfer-Encoding: 8bit\n" + +#: Desktop.cpp:138 Desktop.cpp:180 +#, c-format +msgid "Workspace %d" +msgstr "Ruangkerja %d" + +#: Frame.cpp:106 +msgid "Untitled" +msgstr "Tanpa judul" + +#: Frame.cpp:938 +#, c-format +msgid "EDEWM: Internal bug, when restacking (%d != %d)! Exiting... " +msgstr "" + +#: Titlebar.cpp:215 +msgid "Sticky" +msgstr "Sticky" + +#: Titlebar.cpp:275 Titlebar.cpp:320 +msgid "Set size" +msgstr "" + +#: Titlebar.cpp:276 +msgid "Set size to window:" +msgstr "" + +#: Titlebar.cpp:285 +msgid "width:" +msgstr "" + +#: Titlebar.cpp:287 +msgid "height:" +msgstr "" + +#: Titlebar.cpp:291 +msgid "&OK" +msgstr "" + +#: Titlebar.cpp:294 +msgid "&Cancel" +msgstr "" + +#: Titlebar.cpp:318 Titlebar.cpp:331 +msgid "Maximize" +msgstr "Maksimalkan" + +#: Titlebar.cpp:319 +msgid "Minimize" +msgstr "Minimalkan" + +#: Titlebar.cpp:321 +msgid "To Desktop" +msgstr "Ke Desktop" + +#: Titlebar.cpp:322 +msgid "Kill" +msgstr "" + +#: Titlebar.cpp:323 +msgid "Close" +msgstr "Tutup" + +#: Titlebar.cpp:330 +msgid "Restore" +msgstr "Kembalikan" + +#: Windowmanager.cpp:90 +#, c-format +msgid "Another window manager is running. You must exit it before running %s." +msgstr "" +"Window manager lain sedang berjalan. Anda harus menghentikannya sebelum " +"menjalankan %s." diff --git a/edewm/locale/messages.po.default b/edewm/locale/messages.po.default new file mode 100644 index 0000000..c33a66d --- /dev/null +++ b/edewm/locale/messages.po.default @@ -0,0 +1,63 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#: Desktop.cpp:233 Windowmanager.cpp:97 +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"POT-Creation-Date: 2002-09-16 10:58+0300\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=CHARSET\n" +"Content-Transfer-Encoding: 8bit\n" + +#: Desktop.cpp:247 +#, c-format +msgid "Workspace %d" +msgstr "" + + + +#: Frame.cpp:134 main.cpp:51 +msgid "Untitled" +msgstr "" + + + +#: Titlebar.cpp:211 +msgid "Sticky" +msgstr "" + +#: Titlebar.cpp:247 Titlebar.cpp:257 +msgid "Maximize" +msgstr "" + +#: Titlebar.cpp:248 +msgid "Minimize" +msgstr "" + +#: Titlebar.cpp:249 +msgid "To Desktop" +msgstr "" + +#: Titlebar.cpp:250 +msgid "Close" +msgstr "" + +#: Titlebar.cpp:272 +msgid "Kill" +msgstr "" + +#: Titlebar.cpp:256 +msgid "Restore" +msgstr "" + +#: Windowmanager.cpp:88 +#, c-format +msgid "Another window manager is running. You must exit it before running %s." +msgstr "" diff --git a/edewm/locale/messages.pot b/edewm/locale/messages.pot new file mode 100644 index 0000000..9512350 --- /dev/null +++ b/edewm/locale/messages.pot @@ -0,0 +1,88 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2005-02-04 12:33+0100\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=CHARSET\n" +"Content-Transfer-Encoding: 8bit\n" + +#: Desktop.cpp:138 Desktop.cpp:180 +#, c-format +msgid "Workspace %d" +msgstr "" + +#: Frame.cpp:106 +msgid "Untitled" +msgstr "" + +#: Frame.cpp:938 +#, c-format +msgid "EDEWM: Internal bug, when restacking (%d != %d)! Exiting... " +msgstr "" + +#: Titlebar.cpp:215 +msgid "Sticky" +msgstr "" + +#: Titlebar.cpp:275 Titlebar.cpp:320 +msgid "Set size" +msgstr "" + +#: Titlebar.cpp:276 +msgid "Set size to window:" +msgstr "" + +#: Titlebar.cpp:285 +msgid "width:" +msgstr "" + +#: Titlebar.cpp:287 +msgid "height:" +msgstr "" + +#: Titlebar.cpp:291 +msgid "&OK" +msgstr "" + +#: Titlebar.cpp:294 +msgid "&Cancel" +msgstr "" + +#: Titlebar.cpp:318 Titlebar.cpp:331 +msgid "Maximize" +msgstr "" + +#: Titlebar.cpp:319 +msgid "Minimize" +msgstr "" + +#: Titlebar.cpp:321 +msgid "To Desktop" +msgstr "" + +#: Titlebar.cpp:322 +msgid "Kill" +msgstr "" + +#: Titlebar.cpp:323 +msgid "Close" +msgstr "" + +#: Titlebar.cpp:330 +msgid "Restore" +msgstr "" + +#: Windowmanager.cpp:90 +#, c-format +msgid "Another window manager is running. You must exit it before running %s." +msgstr "" diff --git a/edewm/locale/ru.po b/edewm/locale/ru.po new file mode 100644 index 0000000..b10b539 --- /dev/null +++ b/edewm/locale/ru.po @@ -0,0 +1,90 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2005-02-04 12:33+0100\n" +"PO-Revision-Date: 2002-11-28 HO:MI+ZONE\n" +"Last-Translator: aabbvv \n" +"Language-Team: RUSSIAN \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=koi8-r\n" +"Content-Transfer-Encoding: 8bit\n" + +#: Desktop.cpp:138 Desktop.cpp:180 +#, c-format +msgid "Workspace %d" +msgstr " %d" + +#: Frame.cpp:106 +msgid "Untitled" +msgstr "" + +#: Frame.cpp:938 +#, c-format +msgid "EDEWM: Internal bug, when restacking (%d != %d)! Exiting... " +msgstr "" + +#: Titlebar.cpp:215 +msgid "Sticky" +msgstr " " + +#: Titlebar.cpp:275 Titlebar.cpp:320 +msgid "Set size" +msgstr "" + +#: Titlebar.cpp:276 +msgid "Set size to window:" +msgstr "" + +#: Titlebar.cpp:285 +msgid "width:" +msgstr "" + +#: Titlebar.cpp:287 +msgid "height:" +msgstr "" + +#: Titlebar.cpp:291 +msgid "&OK" +msgstr "" + +#: Titlebar.cpp:294 +msgid "&Cancel" +msgstr "" + +#: Titlebar.cpp:318 Titlebar.cpp:331 +msgid "Maximize" +msgstr "" + +#: Titlebar.cpp:319 +msgid "Minimize" +msgstr "" + +#: Titlebar.cpp:321 +msgid "To Desktop" +msgstr " " + +#: Titlebar.cpp:322 +msgid "Kill" +msgstr "" + +#: Titlebar.cpp:323 +msgid "Close" +msgstr "" + +#: Titlebar.cpp:330 +msgid "Restore" +msgstr "" + +#: Windowmanager.cpp:90 +#, c-format +msgid "Another window manager is running. You must exit it before running %s." +msgstr "" +" . " +" %s." diff --git a/edewm/locale/sk.po b/edewm/locale/sk.po new file mode 100644 index 0000000..d44ddd7 --- /dev/null +++ b/edewm/locale/sk.po @@ -0,0 +1,87 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR Free Software Foundation, Inc. +# FIRST AUTHOR , YEAR. +# +msgid "" +msgstr "" +"Project-Id-Version: edewm 1.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2005-02-04 12:33+0100\n" +"PO-Revision-Date: 2002-04-21 14:50+0200\n" +"Last-Translator: Martin Pekar \n" +"Language-Team: Slovak \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: Desktop.cpp:138 Desktop.cpp:180 +#, c-format +msgid "Workspace %d" +msgstr "Plocha %d" + +#: Frame.cpp:106 +msgid "Untitled" +msgstr "Bez názvu" + +#: Frame.cpp:938 +#, c-format +msgid "EDEWM: Internal bug, when restacking (%d != %d)! Exiting... " +msgstr "" + +#: Titlebar.cpp:215 +msgid "Sticky" +msgstr "Lepkavý" + +#: Titlebar.cpp:275 Titlebar.cpp:320 +msgid "Set size" +msgstr "" + +#: Titlebar.cpp:276 +msgid "Set size to window:" +msgstr "" + +#: Titlebar.cpp:285 +msgid "width:" +msgstr "" + +#: Titlebar.cpp:287 +msgid "height:" +msgstr "" + +#: Titlebar.cpp:291 +msgid "&OK" +msgstr "" + +#: Titlebar.cpp:294 +msgid "&Cancel" +msgstr "" + +#: Titlebar.cpp:318 Titlebar.cpp:331 +msgid "Maximize" +msgstr "Maximalizovať" + +#: Titlebar.cpp:319 +msgid "Minimize" +msgstr "Minimalizovať" + +#: Titlebar.cpp:321 +msgid "To Desktop" +msgstr "Na plochu" + +#: Titlebar.cpp:322 +msgid "Kill" +msgstr "Ukončiť" + +#: Titlebar.cpp:323 +msgid "Close" +msgstr "Zavrieť" + +#: Titlebar.cpp:330 +msgid "Restore" +msgstr "Obnoviť" + +#: Windowmanager.cpp:90 +#, c-format +msgid "Another window manager is running. You must exit it before running %s." +msgstr "" +"Práve beží už iný manažér okien. Musíte ho ukončiť a chcete spustiť %s." diff --git a/edewm/locale/sr.po b/edewm/locale/sr.po new file mode 100644 index 0000000..dd8865c --- /dev/null +++ b/edewm/locale/sr.po @@ -0,0 +1,87 @@ +# EDEWM - Prevod na srpski jezik +# Copyright (C) 2002 EDE Team +# Dejan Lekic Dejan Lekic , 2002. +# +msgid "" +msgstr "" +"Project-Id-Version: EDEWM 0.1\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2005-02-04 12:33+0100\n" +"PO-Revision-Date: 2002-11-21 08:26+0100\n" +"Last-Translator: Dejan Lekic \n" +"Language-Team: LINUKS.org T.T. \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: Desktop.cpp:138 Desktop.cpp:180 +#, c-format +msgid "Workspace %d" +msgstr "Радни простор %d" + +#: Frame.cpp:106 +msgid "Untitled" +msgstr "Неименован" + +#: Frame.cpp:938 +#, c-format +msgid "EDEWM: Internal bug, when restacking (%d != %d)! Exiting... " +msgstr "" + +#: Titlebar.cpp:215 +msgid "Sticky" +msgstr "Стики" + +#: Titlebar.cpp:275 Titlebar.cpp:320 +msgid "Set size" +msgstr "" + +#: Titlebar.cpp:276 +msgid "Set size to window:" +msgstr "" + +#: Titlebar.cpp:285 +msgid "width:" +msgstr "" + +#: Titlebar.cpp:287 +msgid "height:" +msgstr "" + +#: Titlebar.cpp:291 +msgid "&OK" +msgstr "" + +#: Titlebar.cpp:294 +msgid "&Cancel" +msgstr "" + +#: Titlebar.cpp:318 Titlebar.cpp:331 +msgid "Maximize" +msgstr "Максимизуј" + +#: Titlebar.cpp:319 +msgid "Minimize" +msgstr "Минимизуј" + +#: Titlebar.cpp:321 +msgid "To Desktop" +msgstr "На десктоп" + +#: Titlebar.cpp:322 +msgid "Kill" +msgstr "" + +#: Titlebar.cpp:323 +msgid "Close" +msgstr "Затвори" + +#: Titlebar.cpp:330 +msgid "Restore" +msgstr "Врати" + +#: Windowmanager.cpp:90 +#, c-format +msgid "Another window manager is running. You must exit it before running %s." +msgstr "" +"Други менаџер прозора је активан. Мораћете га угасити пре покретања %s." diff --git a/edewm/main.cpp b/edewm/main.cpp new file mode 100644 index 0000000..3669d1a --- /dev/null +++ b/edewm/main.cpp @@ -0,0 +1,54 @@ +/* + * $Id$ + * + * Edewm, window manager + * Part of Equinox Desktop Environment (EDE). + * Copyright (c) 2000-2006 EDE Authors. + * + * This program is licenced under terms of the + * GNU General Public Licence version 2 or newer. + * See COPYING for details. + */ + +#include "Windowmanager.h" +#include "debug.h" +#include + +#include +#include + +#include +#include +#include +#include + +bool got_signal = false; + + +void exit_signal(int signum) +{ + EWARNING("* Exiting (got signal %d) *", signum); + got_signal = true; +} + +int main(int argc, char ** argv) +{ + signal(SIGTERM, exit_signal); + signal(SIGKILL, exit_signal); + signal(SIGINT, exit_signal); + + Fl::args(argc, argv); + fl_init_locale_support("edewm", PREFIX"/share/locale"); + + WindowManager::init(argc, argv); + Fl_Style::load_theme(); + + while(!got_signal && WindowManager::instance()->running()) + { + Fl::wait(); + WindowManager::instance()->idle(); + } + + WindowManager::shutdown(); + return 0; +} diff --git a/edewm/mask.xpm b/edewm/mask.xpm new file mode 100644 index 0000000..c8a9cae --- /dev/null +++ b/edewm/mask.xpm @@ -0,0 +1,15 @@ +/* XPM */ +static char * mask_xpm[] = { +"10 10 2 1", +" c None", +". c #000000", +"........ ", +"...... ", +"..... ", +".... ", +"... ", +".. ", +". ", +". ", +" ", +" "}; diff --git a/edewm/tests/Makefile b/edewm/tests/Makefile new file mode 100644 index 0000000..1ab2529 --- /dev/null +++ b/edewm/tests/Makefile @@ -0,0 +1,38 @@ +# +# $Id$ +# +# Part of Equinox Desktop Environment (EDE). +# Copyright (c) 2000-2006 EDE Authors. +# +# This program is licenced under terms of the +# GNU General Public Licence version 2 or newer. +# See COPYING for details. + +include ../../makeinclude + +define make_test +ALL += $1 +$1 : $1.cpp + echo Compiling $$<... + $(CXX) $(CXXFLAGS) $$< -o $$@ $(LIBS) +endef + +# Note: $(eval...) must be used instead plain $(call...) +# since variables will not be expanded correctly + +$(eval $(call make_test, basic_moveresize)) + +sound_test.o : sound_test.cpp + echo "Compiling $<..." + $(CXX) $(CXXFLAGS) -c $< +Sound.o : ../Sound.cpp + echo "Compiling $<..." + $(CXX) $(CXXFLAGS) -c $< +sound_test: sound_test.o Sound.o + $(CXX) sound_test.o Sound.o ../debug.o -o $@ $(LIBS) + +all: $(ALL) sound_test + +clean: + $(RM) $(ALL) + $(RM) *.o diff --git a/edewm/tests/basic_moveresize.cpp b/edewm/tests/basic_moveresize.cpp new file mode 100644 index 0000000..01ce29f --- /dev/null +++ b/edewm/tests/basic_moveresize.cpp @@ -0,0 +1,95 @@ +#include +#include +#include +#include +#include +#include + +#define MRSIZE 2 + +void cb_move_left(Fl_Widget*, void* ww) +{ + Fl_Window* win = (Fl_Window*) ww; + printf("move left(before) x: %i y: %i\n", win->x(), win->y()); + win->position(win->x() - MRSIZE, win->y()); + printf("move left(after) x: %i y: %i\n", win->x(), win->y()); +} + +void cb_move_right(Fl_Widget*, void* ww) +{ + Fl_Window* win = (Fl_Window*) ww; + printf("move right(before) x: %i y: %i\n", win->x(), win->y()); + win->position(win->x() + MRSIZE, win->y()); + printf("move right(after) x: %i y: %i\n", win->x(), win->y()); +} + +void cb_move_up(Fl_Widget*, void* ww) +{ + Fl_Window* win = (Fl_Window*) ww; + printf("move up(before) x: %i y: %i\n", win->x(), win->y()); + win->position(win->x(), win->y() - MRSIZE); + printf("move up(after) x: %i y: %i\n", win->x(), win->y()); +} + +void cb_move_down(Fl_Widget*, void* ww) +{ + Fl_Window* win = (Fl_Window*) ww; + printf("move down(before) x: %i y: %i\n", win->x(), win->y()); + win->position(win->x(), win->y() + MRSIZE); + printf("move down(after) x: %i y: %i\n", win->x(), win->y()); +} + + +int main (int argc, char **argv) +{ + Fl_Window* win = new Fl_Window(300, 290, "Basic Window Operations"); + win->shortcut(0xff1b); + + Fl_Box* bbb = new Fl_Box(10, 10, 280, 50, "Below buttons should apply changes to this window"); + bbb->align(FL_ALIGN_INSIDE|FL_ALIGN_WRAP); + + Fl_Group* move_group = new Fl_Group(10, 85, 280, 75, "Move"); + move_group->box(FL_ENGRAVED_BOX); + move_group->align(FL_ALIGN_TOP|FL_ALIGN_LEFT); + + Fl_Button* move_up = new Fl_Button(130, 10, 25, 25, "^"); + move_up->callback(cb_move_up, win); + //move_left->label_type(FL_SYMBOL_LABEL); + + Fl_Button* move_down = new Fl_Button(130, 35, 25, 25, "v"); + move_down->callback(cb_move_down, win); + //move_right->label_type(FL_SYMBOL_LABEL); + + Fl_Button* move_left = new Fl_Button(105, 35, 25, 25, "<"); + move_left->callback(cb_move_left, win); + //move_up->label_type(FL_SYMBOL_LABEL); + + Fl_Button* move_right = new Fl_Button(155, 35, 25, 25, ">"); + move_right->callback(cb_move_right, win); + //move_down->label_type(FL_SYMBOL_LABEL); + + move_group->end(); + + + Fl_Group* resize_group = new Fl_Group(10, 190, 280, 75, "Resize"); + resize_group->box(FL_ENGRAVED_BOX); + resize_group->align(FL_ALIGN_TOP|FL_ALIGN_LEFT); + + Fl_Button* resize_up = new Fl_Button(130, 10, 25, 25, "^"); + //resize_left->label_type(FL_SYMBOL_LABEL); + + Fl_Button* resize_down = new Fl_Button(130, 35, 25, 25, "v"); + //resize_right->label_type(FL_SYMBOL_LABEL); + + Fl_Button* resize_left = new Fl_Button(105, 35, 25, 25, "<"); + //resize_up->label_type(FL_SYMBOL_LABEL); + + Fl_Button* resize_right = new Fl_Button(155, 35, 25, 25, ">"); + //resize_down->label_type(FL_SYMBOL_LABEL); + + resize_group->end(); + + win->end(); + win->show(argc, argv); + return Fl::run(); +} diff --git a/edewm/tests/basic_moveresize.fld b/edewm/tests/basic_moveresize.fld new file mode 100644 index 0000000..d7dd61c --- /dev/null +++ b/edewm/tests/basic_moveresize.fld @@ -0,0 +1,61 @@ +# data file for the eFLTK User Interface Designer (eFLUID) +version 2.0003 +header_name {.h} +code_name {.cpp} +gridx 5 +gridy 5 +snap 3 +Function {} {open +} { + Fl_Window {} { + label {Basic Window Operations} open + xywh {361 170 300 290} resizable visible + } { + Fl_Box {} { + label {Below buttons should apply changes to this window} + xywh {10 10 280 50} align FL_ALIGN_INSIDE|FL_ALIGN_WRAP + } + Fl_Group {} { + label Move open + xywh {10 85 280 75} align FL_ALIGN_TOP|FL_ALIGN_LEFT box ENGRAVED_BOX + } { + Fl_Button {} { + label {@<} + xywh {130 10 25 25} label_type SYMBOL_LABEL + } + Fl_Button {} { + label {@<} + xywh {130 35 25 25} label_type SYMBOL_LABEL + } + Fl_Button {} { + label {@<} + xywh {105 35 25 25} label_type SYMBOL_LABEL + } + Fl_Button {} { + label {@>} + xywh {155 35 25 25} label_type SYMBOL_LABEL + } + } + Fl_Group {} { + label Resize open selected + xywh {10 190 280 75} align FL_ALIGN_TOP|FL_ALIGN_LEFT box ENGRAVED_BOX + } { + Fl_Button {} { + label {@<} + xywh {130 10 25 25} label_type SYMBOL_LABEL + } + Fl_Button {} { + label {@<} + xywh {130 35 25 25} label_type SYMBOL_LABEL + } + Fl_Button {} { + label {@<} + xywh {105 35 25 25} label_type SYMBOL_LABEL + } + Fl_Button {} { + label {@>} + xywh {155 35 25 25} label_type SYMBOL_LABEL + } + } + } +} diff --git a/edewm/tests/demo.ogg b/edewm/tests/demo.ogg new file mode 100644 index 0000000..4091a9f Binary files /dev/null and b/edewm/tests/demo.ogg differ diff --git a/edewm/tests/sound_test.cpp b/edewm/tests/sound_test.cpp new file mode 100644 index 0000000..e000351 --- /dev/null +++ b/edewm/tests/sound_test.cpp @@ -0,0 +1,14 @@ +#include "../Sound.h" +#include + +int main() +{ + puts("playing...\n"); + SoundSystem ss; + ss.init(); + ss.play("demo.ogg"); + ss.shutdown(); + puts("done\n"); + + return 0; +} diff --git a/edewm/tests/testpositions.sh b/edewm/tests/testpositions.sh new file mode 100644 index 0000000..15cceac --- /dev/null +++ b/edewm/tests/testpositions.sh @@ -0,0 +1,70 @@ +#!/bin/sh +# +# $Id$ +# +#= +#= Usage: testpositions.sh [OPTIONS] +#= +#= Test position where will be placed newly created windows. +#= +#= Options: +#= -p [program] run program +#= -t [number] run [program] [number] times +#= -h show this help +#= +#= Example: testpositions.sh -e gvim -t 1000, which +#= will run 1000 instances of gvim. +#= +#= NOTE: if you try this with some heavier programs +#= (mozilla, ooffice, etc.) swapping and possible X crashes +#= are not due window manager. Just warned you ! +#= + +PROGRAM="xterm" +TIMES="10" + +help() +{ + sed -ne "/^#= /{ s/^#= //p }" $0 + exit 0 +} + +main() +{ + if [ $# -eq 0 ]; then + help + fi + + argv=$@ + for argv do + case $argv in + -h) + help + continue;; + -p) + unset PROGRAM + continue;; + -t) + unset TIMES + continue;; + esac + + if [ "$PROGRAM" = "" ];then + PROGRAM=$argv + continue + elif [ "$TIMES" = "" ];then + TIMES=$argv + else + echo "Bad parameter '$argv'." + echo "Run $0 -h for options." + exit 0 + fi + done + + for((i = 1; i <= $TIMES; i++)) + do + `$PROGRAM`& + done +} + +main $@ diff --git a/edialog/Jamfile b/edialog/Jamfile new file mode 100644 index 0000000..b41df6a --- /dev/null +++ b/edialog/Jamfile @@ -0,0 +1,14 @@ +# +# $Id$ +# +# Part of Equinox Desktop Environment (EDE). +# Copyright (c) 2000-2007 EDE Authors. +# +# This program is licenced under terms of the +# GNU General Public Licence version 2 or newer. +# See COPYING for details. + +SubDir TOP edialog ; + +MakeProgram edialog : edialog.cpp ; +ExtractStrings locale : edialog.cpp ; diff --git a/edialog/Makefile b/edialog/Makefile new file mode 100644 index 0000000..f14e5ab --- /dev/null +++ b/edialog/Makefile @@ -0,0 +1,17 @@ + +CPPFILES = edialog.cpp +TARGET = edialog + +include ../makeinclude + +install: + $(INSTALL_PROGRAM) $(TARGET) $(bindir) + $(INSTALL_LOCALE) + +uninstall: + $(RM) $(bindir)/$(TARGET) + +clean: + $(RM) $(TARGET) + $(RM) *.o + diff --git a/edialog/edialog.cpp b/edialog/edialog.cpp new file mode 100644 index 0000000..1514e2e --- /dev/null +++ b/edialog/edialog.cpp @@ -0,0 +1,237 @@ +// EDialog - copyleft (c) Vedran Ljubovic 2005 +// This program is licenced under GNU General Public License v2 or greater + + +#include +#include +#include +#include + +using namespace fltk; + + +// --- compat. modes enum + +enum { + KDIALOGMODE = 0 +}; + + +// Common functions + +void errormsg(char* msg) { + fprintf (stderr, "edialog: %s\n", msg); + exit(1); +} + + +void showhelp() { + printf ("edialog - Show dialogs using FLTK2\n"); + printf ("Copyright (c) Vedran Ljubovic 2005\n"); + printf ("This program is licensed under GNU General Public License v2 or greater\n\n"); + printf ("Displays a dialog box. Return value corresponds to button pressed (e.g 0 = Ok, 1 = Cancel...)\n\n"); + printf ("Options:\n"); + printf (" --kdialog - kdialog compatibility mode (default)\n"); + printf (" (see kdialog --help for list)\n"); + exit(0); +} + + +// Functions for dialogs + +void YesNo(char* param) { + if (param[0] == '\0') errormsg ("Required parameter missing."); + exit(ask(param)); +} + +void YesNoCancel(char* param) { + if (param[0] == '\0') errormsg ("Required parameter missing."); + exit(choice(param,yes,no,cancel)); +} + +void WarningYesNo(char* param) { + if (param[0] == '\0') errormsg ("Required parameter missing."); + exit(choice_alert(param,yes,no,"")); +} + +void WarningContinueCancel(char* param) { + if (param[0] == '\0') errormsg ("Required parameter missing."); + exit(choice_alert(param,"Continue",cancel,0)); +} + +void WarningYesNoCancel(char* param) { + if (param[0] == '\0') errormsg ("Required parameter missing."); + exit(choice_alert(param,yes,no,cancel)); +} + +void Sorry(char* param) { + if (param[0] == '\0') errormsg ("Required parameter missing."); + alert(param); + exit(0); +} + +void Error(char* param) { + errormsg("Not implemented yet."); + // Displays a red X and plays "error" sound + +// if (param[0] == '\0') errormsg ("Required parameter missing."); +// alert(param); +// exit(0); +} + +void MsgBox(char* param) { + if (param[0] == '\0') errormsg ("Required parameter missing."); + message(param); + exit(0); +} + +void InputBox(char* param) { + if (param[0] == '\0') errormsg ("Required parameter missing."); + char *title = strtok(param," "); + char *defval = strtok(NULL," "); + printf ("%s\n",input(title,defval)); + exit(0); +} + +void Password(char* param) { + // NOTE: kdialog doesn't support default value for password + // possibly for security reasons? + if (param[0] == '\0') errormsg ("Required parameter missing."); + char *title = strtok(param," "); + char *defval = strtok(NULL," "); + printf ("%s\n",password(title,defval)); + exit(0); +} + +void TextBox(char* param) { + errormsg("Not implemented yet."); +} + +void ComboBox(char* param) { + errormsg("Not implemented yet."); +} + +void Menu(char* param) { + errormsg("Not implemented yet."); +} + +void CheckList(char* param) { + errormsg("Not implemented yet."); +} + +void RadioList(char* param) { + errormsg("Not implemented yet."); +} + +void PassivePopup(char* param) { + errormsg("Not implemented yet."); +} + +void GetOpenFilename(char* param) { + errormsg("Not implemented yet."); +} + +void GetSaveFilename(char* param) { + errormsg("Not implemented yet."); +} + +void GetExistingDirectory(char* param) { + errormsg("Not implemented yet."); +} + +void GetOpenUrl(char* param) { + errormsg("Not implemented yet."); +} + +void GetSaveUrl(char* param) { + errormsg("Not implemented yet."); +} + +void GetIcon(char* param) { + errormsg("Not implemented yet."); +} + +void ProgressBar(char* param) { + errormsg("Not implemented yet."); +} + + + +// ----------- These are charts for various compatibility modes + +struct paramslist { + char* option; + void (*func)(char*); +}; + +// kdialog - KDE dialog +paramslist kdialogopts[] = { + {"--yesno", YesNo}, + {"--yesnocancel", YesNoCancel}, + {"--warningyesno", WarningYesNo}, + {"--warningcontinuecancel", WarningContinueCancel}, + {"--warningyesnocancel", WarningYesNoCancel}, + {"--sorry", Sorry}, + {"--error", Error}, + {"--msgbox", MsgBox}, + {"--inputbox", InputBox}, + {"--password", Password}, + {"--textbox", TextBox}, + {"--combobox", ComboBox}, + {"--menu", Menu}, + {"--checklist", CheckList}, + {"--radiolist", RadioList}, + {"--passivepopup", PassivePopup}, + {"--getopenfilename", GetOpenFilename}, + {"--getsavefilename", GetSaveFilename}, + {"--getexistingdirectory", GetExistingDirectory}, + {"--getopenurl", GetOpenUrl}, + {"--getsaveurl", GetSaveUrl}, + {"--geticon", GetIcon}, + {"--progressbar", ProgressBar}, + {""} +}; + + +// parse command line parameters +int main (int argc, char **argv) { + int compat_mode = KDIALOGMODE; + bool param_recognized[100]; + for (int i=0;i<100;i++) param_recognized[i]=false; + + // Switches and modifiers + for (int i=1; ioption[0] != '\0') { + if (strcmp(argv[i],ptr->option) == 0) { + char *params = strdup(""); + i++; + while ((ifunc(params); + } + ptr++; + } + // function should exit() + // so we can get here only if parameter isn't recognized + if (param_recognized[i] == false) { + showhelp(); + } + } + + // No parameters passed or just modifiers + showhelp(); +} diff --git a/edisplayconf/Jamfile b/edisplayconf/Jamfile new file mode 100644 index 0000000..214780b --- /dev/null +++ b/edisplayconf/Jamfile @@ -0,0 +1,17 @@ +# +# $Id$ +# +# Part of Equinox Desktop Environment (EDE). +# Copyright (c) 2000-2007 EDE Authors. +# +# This program is licenced under terms of the +# GNU General Public Licence version 2 or newer. +# See COPYING for details. + + +SubDir TOP edisplayconf ; + +SOURCE = edisplayconf.cpp conf.cpp ; + +MakeProgram edisplayconf : $(SOURCE) ; +ExtractStrings locale : $(SOURCE) ; diff --git a/edisplayconf/Makefile b/edisplayconf/Makefile new file mode 100644 index 0000000..b5ecee2 --- /dev/null +++ b/edisplayconf/Makefile @@ -0,0 +1,22 @@ + +CPPFILES = edisplayconf.cpp conf.cpp ../edelib2/Util.cpp ../edelib2/Config.cpp ../edelib2/Run.cpp ../edelib2/process.cpp ../edelib2/pty.cpp +TARGET = edisplayconf + +POFILES = locale/ru.po\ + locale/sr.po\ + locale/sk.po\ + locale/hu.po\ + +include ../makeinclude + +install: + $(INSTALL_PROGRAM) $(TARGET) $(bindir) + $(INSTALL_LOCALE) + +uninstall: + $(RM) $(bindir)/$(TARGET) + +clean: + $(RM) $(TARGET) + $(RM) *.o + diff --git a/edisplayconf/conf.cpp b/edisplayconf/conf.cpp new file mode 100644 index 0000000..6293943 --- /dev/null +++ b/edisplayconf/conf.cpp @@ -0,0 +1,130 @@ +/* + * $Id$ + * + * X server properties + * Part of Equinox Desktop Environment (EDE). + * Copyright (c) 2000-2006 EDE Authors. + * + * This program is licenced under terms of the + * GNU General Public Licence version 2 or newer. + * See COPYING for details. + */ + +#include "edisplayconf.h" +#include "conf.h" +#include "exset.h" +#include "../edelib2/Config.h" //#include +// if I move Config.h above exset.h, I get "'Font' does not name a type" in Xlib.h + +using namespace edelib; + + +extern edisplayconf *app; +Config config(Config::find_file("ede.conf",1)); +Exset xset; + +int get_value(const char *key, int def_value) +{ + static int val; + config.read(key, val, def_value); + return val; +} + +void do_xset() +{ + xset.set_mouse((int)app->slider_accel->value(),(int)app->slider_thresh->value()); + xset.set_bell((int)app->slider_volume->value(),(int)app->slider_pitch->value(),(int)app->slider_duration->value()); + xset.set_keybd((int)app->check_autorepeat->value(), (int)app->slider_click->value()); + xset.set_pattern((int)app->slider_delay->value(), (int)app->slider_pattern->value()); + xset.set_check_blank((int)app->check_blanking->value()); + xset.set_blank((int)app->radio_blank->value()); + +} + + +void read_disp_configuration() +{ + config.set_section("Mouse"); + app->slider_accel->value(get_value("Accel",4)); // Default 4 + app->slider_thresh->value(get_value("Thresh",4)); // Default 4 + config.set_section("Bell"); + app->slider_volume->value(get_value("Volume",50)); // default 50 + app->slider_pitch->value(get_value("Pitch",440)); // Default 440 + app->slider_duration->value(get_value("Duration",200)); // Default 200 + config.set_section("Keyboard"); + app->check_autorepeat->value(get_value("Repeat",1)); // Default 1 + app->slider_click->value(get_value("ClickVolume",50)); // Default 50 + app->slider_delay->value(get_value("Delay",15)); // Default 15 + config.set_section("Screen"); + app->check_blanking->value(get_value("CheckBlank",1)); // Default 1 + app->slider_pattern->value(get_value("Pattern",2)); // Default = 2 + + int pattern = get_value("RadioPattern",0); + int blank = get_value("RadioBlank",1); + app->radio_blank->value(blank); // Default 1 + app->radio_pattern->value(pattern); // Default 1 + + + if( pattern ) + app->slider_pattern->activate(); + else + app->slider_pattern->deactivate(); +} + +void write_configuration() +{ + config.set_section(config.create_section("Mouse")); + config.write("Accel",(int)app->slider_accel->value()); + config.write("Thresh",(int)app->slider_thresh->value()); + + config.set_section(config.create_section("Bell")); + config.write("Volume",(int)app->slider_volume->value()); + config.write("Pitch",(int)app->slider_pitch->value()); + config.write("Duration",(int)app->slider_duration->value()); + + config.set_section(config.create_section("Keyboard")); + config.write("Repeat",(int)app->check_autorepeat->value()); + config.write("ClickVolume",(int)app->slider_click->value()); + + config.set_section(config.create_section("Screen")); + config.write("Delay",(int)app->slider_delay->value()); + config.write("Pattern",(int)app->slider_pattern->value()); + config.write("CheckBlank",(int)app->check_blanking->value()); + config.write("RadioBlank", (int)app->radio_blank->value()); + config.write("RadioPattern",(int) app->radio_pattern->value()); + + config.flush(); + do_xset(); +} + + + + +void cancelCB() +{ + app->_finish = true; +} + +void testbellCB() +{ + xset.test_bell(); +} + +void TestBlankCB() +{ + xset.test_blank(); +} + + +void applyCB() +{ + write_configuration(); +} + +void okCB() +{ + + write_configuration(); + app->_finish = true; +} + diff --git a/edisplayconf/conf.h b/edisplayconf/conf.h new file mode 100644 index 0000000..95e2b8a --- /dev/null +++ b/edisplayconf/conf.h @@ -0,0 +1,11 @@ +#ifndef conf_h +#define conf_h + +void cancelCB(); +void testbellCB(); +void TestBlankCB(); +void applyCB(); +void okCB(); +void read_disp_configuration(); + +#endif diff --git a/edisplayconf/edisplayconf.cpp b/edisplayconf/edisplayconf.cpp new file mode 100644 index 0000000..11108da --- /dev/null +++ b/edisplayconf/edisplayconf.cpp @@ -0,0 +1,243 @@ +// generated by Fast Light User Interface Designer (fluid) version 2.0100 + +#include "edisplayconf.h" +/* + * $Id$ + * + * X server properties + * Part of Equinox Desktop Environment (EDE). + * Copyright (c) 2000-2006 EDE Authors. + * + * This program is licenced under terms of the + * GNU General Public Licence version 2 or newer. + * See COPYING for details. + */ +#include +#include +#include "conf.h" +#include "../edelib2/NLS.h" +//#include +#include + +inline void edisplayconf::cb_win_i(fltk::Window*, void*) { + _finish = true; +} +void edisplayconf::cb_win(fltk::Window* o, void* v) { + ((edisplayconf*)(o->user_data()))->cb_win_i(o,v); +} + +inline void edisplayconf::cb_Test_i(fltk::Button*, void*) { + testbellCB(); +} +void edisplayconf::cb_Test(fltk::Button* o, void* v) { + ((edisplayconf*)(o->parent()->parent()->parent()->user_data()))->cb_Test_i(o,v); +} + +inline void edisplayconf::cb_but_activate_i(fltk::Button*, void*) { + TestBlankCB(); +} +void edisplayconf::cb_but_activate(fltk::Button* o, void* v) { + ((edisplayconf*)(o->parent()->parent()->parent()->user_data()))->cb_but_activate_i(o,v); +} + +inline void edisplayconf::cb_radio_blank_i(fltk::RadioButton*, void*) { + radioCB(); +} +void edisplayconf::cb_radio_blank(fltk::RadioButton* o, void* v) { + ((edisplayconf*)(o->parent()->parent()->parent()->parent()->user_data()))->cb_radio_blank_i(o,v); +} + +inline void edisplayconf::cb_radio_pattern_i(fltk::RadioButton*, void*) { + radioCB(); +} +void edisplayconf::cb_radio_pattern(fltk::RadioButton* o, void* v) { + ((edisplayconf*)(o->parent()->parent()->parent()->parent()->user_data()))->cb_radio_pattern_i(o,v); +} + +inline void edisplayconf::cb_Cancel_i(fltk::Button*, void*) { + cancelCB(); +} +void edisplayconf::cb_Cancel(fltk::Button* o, void* v) { + ((edisplayconf*)(o->parent()->user_data()))->cb_Cancel_i(o,v); +} + +inline void edisplayconf::cb_but_kbd_apply_i(fltk::Button*, void*) { + applyCB(); +} +void edisplayconf::cb_but_kbd_apply(fltk::Button* o, void* v) { + ((edisplayconf*)(o->parent()->user_data()))->cb_but_kbd_apply_i(o,v); +} + +inline void edisplayconf::cb_OK_i(fltk::ReturnButton*, void*) { + okCB(); +} +void edisplayconf::cb_OK(fltk::ReturnButton* o, void* v) { + ((edisplayconf*)(o->parent()->user_data()))->cb_OK_i(o,v); +} + +edisplayconf::edisplayconf() { + fltk::Window* w; + {fltk::Window* o = win = new fltk::Window(265, 335, "Display configuration"); + w = o; + o->set_vertical(); + o->callback((fltk::Callback*)cb_win, (void*)(this)); + o->begin(); + {fltk::TabGroup* o = new fltk::TabGroup(5, 5, 260, 285); + o->set_vertical(); + o->begin(); + {fltk::Group* o = group_mouse = new fltk::Group(0, 24, 255, 260, "Mouse"); + o->set_vertical(); + o->align(fltk::ALIGN_LEFT); + o->begin(); + {fltk::ValueSlider* o = slider_accel = new fltk::ValueSlider(20, 30, 220, 18, "Acceleration"); + o->maximum(10); + o->step(1); + o->value(2); + o->align(fltk::ALIGN_TOP); + } + {fltk::ValueSlider* o = slider_thresh = new fltk::ValueSlider(20, 75, 220, 18, "Threshold (pixels)"); + o->maximum(20); + o->step(1); + o->value(4); + o->align(fltk::ALIGN_TOP); + } + o->end(); + } + {fltk::Group* o = group_bell = new fltk::Group(0, 25, 255, 259, "Bell"); + o->set_vertical(); + o->hide(); + o->begin(); + {fltk::ValueSlider* o = slider_volume = new fltk::ValueSlider(20, 30, 220, 18, "Volume in %"); + o->maximum(100); + o->step(1); + o->value(50); + o->align(fltk::ALIGN_TOP); + } + {fltk::ValueSlider* o = slider_pitch = new fltk::ValueSlider(20, 75, 220, 18, "Pitch in Hz"); + o->minimum(100); + o->maximum(1000); + o->step(1); + o->value(440); + o->align(fltk::ALIGN_TOP); + } + {fltk::ValueSlider* o = slider_duration = new fltk::ValueSlider(20, 120, 220, 18, "Duration in ms"); + o->maximum(1000); + o->step(1); + o->value(200); + o->align(fltk::ALIGN_TOP); + } + {fltk::Button* o = new fltk::Button(175, 170, 60, 25, "Test"); + o->callback((fltk::Callback*)cb_Test); + } + o->end(); + } + {fltk::Group* o = group_keyboard = new fltk::Group(0, 25, 255, 259, "Keyboard"); + o->set_vertical(); + o->align(fltk::ALIGN_TOP|fltk::ALIGN_LEFT); + o->hide(); + o->begin(); + {fltk::CheckButton* o = check_autorepeat = new fltk::CheckButton(24, 20, 221, 20, " Repeat key activated"); + o->selection_color((fltk::Color)2); + //o->set_flag(fltk::VALUE); + } + {fltk::ValueSlider* o = slider_click = new fltk::ValueSlider(25, 67, 220, 18, "Click volume %"); + o->maximum(100); + o->step(1); + o->value(50); + o->align(fltk::ALIGN_TOP); + } + o->end(); + } + {fltk::Group* o = group_screen = new fltk::Group(0, 25, 255, 259, "Screen"); + o->set_vertical(); + o->hide(); + o->begin(); + {fltk::Button* o = but_activate = new fltk::Button(167, 190, 80, 25, "&Test"); + o->callback((fltk::Callback*)cb_but_activate); + } + new fltk::InvisibleBox(10, 0, 234, 55); + {fltk::ValueSlider* o = slider_delay = new fltk::ValueSlider(27, 71, 210, 18, "Activation delay (min)"); + o->minimum(5); + o->maximum(120); + o->step(1); + o->value(15); + o->align(fltk::ALIGN_TOP); + } + {fltk::CheckButton* o = check_blanking = new fltk::CheckButton(15, 20, 222, 20, " Screen blanker activated"); + o->selection_color((fltk::Color)2); + //o->set_flag(fltk::VALUE); + } + new fltk::InvisibleBox(10, 99, 234, 37); + {fltk::ValueSlider* o = slider_pattern = new fltk::ValueSlider(27, 155, 210, 18, "Pattern change delay (min)"); + o->minimum(1); + o->maximum(5); + o->step(0); + o->value(2); + o->align(fltk::ALIGN_TOP); + o->deactivate(); + } + {fltk::Group* o = new fltk::Group(35, 108, 210, 27); + o->begin(); + {fltk::RadioButton* o = radio_blank = new fltk::RadioButton(0, 0, 105, 20, "Blank"); + o->selection_color((fltk::Color)1); + //o->set_flag(fltk::VALUE); + o->callback((fltk::Callback*)cb_radio_blank); + } + {fltk::RadioButton* o = radio_pattern = new fltk::RadioButton(107, 5, 95, 20, "Pattern"); + o->selection_color((fltk::Color)1); + o->callback((fltk::Callback*)cb_radio_pattern); + } + o->end(); + } + o->end(); + } + o->end(); + } + {fltk::Button* o = new fltk::Button(190, 300, 70, 25, "&Cancel"); + o->callback((fltk::Callback*)cb_Cancel); + o->align(fltk::ALIGN_CENTER); + } + {fltk::Button* o = but_kbd_apply = new fltk::Button(115, 300, 70, 25, "&Apply"); + o->callback((fltk::Callback*)cb_but_kbd_apply); + } + {fltk::ReturnButton* o = new fltk::ReturnButton(40, 300, 70, 25, "OK"); + o->shortcut(0xd); + o->callback((fltk::Callback*)cb_OK); + } + o->end(); + o->resizable(o); + } +} + +edisplayconf::~edisplayconf() { +} + +void edisplayconf::Run() { + _finish = false; + win->show(); + while (!_finish) fltk::wait(); + win->hide(); +} + +void edisplayconf::make_window() { +} + +void edisplayconf::radioCB() { + int l_blank; + + l_blank = (int)radio_blank->value(); + if (l_blank) + slider_pattern->deactivate(); + else + slider_pattern->activate(); +} + +int main(int ac,char **av) { + //fl_init_locale_support("edisplayconf", PREFIX"/share/locale"); + app = new edisplayconf(); + read_disp_configuration(); + app->Run(); + delete app; + return 0; +} +edisplayconf *app; diff --git a/edisplayconf/edisplayconf.fl b/edisplayconf/edisplayconf.fl new file mode 100644 index 0000000..245ef6a --- /dev/null +++ b/edisplayconf/edisplayconf.fl @@ -0,0 +1,188 @@ +# data file for the FLTK User Interface Designer (FLUID) +version 2.1000 +images_dir ./ +header_name {.h} +code_name {.cpp} +gridx 5 +gridy 5 +snap 3 +decl {/* + * $Id$ + * + * X server properties + * Part of Equinox Desktop Environment (EDE). + * Copyright (c) 2000-2006 EDE Authors. + * + * This program is licenced under terms of the + * GNU General Public Licence version 2 or newer. + * See COPYING for details. + */} {} + +decl {\#include } {} + +decl {\#include } {} + +decl {\#include "conf.h"} {} + +decl {\#include "../edelib2/NLS.h"} {} + +decl {//\#include } {} + +decl {\#include } {} + +class edisplayconf {open +} { + decl {bool _finish;} {public + } + Function {edisplayconf()} {open + } { + {fltk::Window} win { + label {Display configuration} + callback {_finish = true;} open + private xywh {386 222 265 335} resizable visible + } { + {fltk::TabGroup} {} {open + xywh {5 5 260 285} + } { + {fltk::Group} group_mouse { + label Mouse open selected + private xywh {0 24 255 260} align 4 + } { + {fltk::ValueSlider} slider_accel { + label Acceleration + xywh {20 30 220 18} align 1 maximum 10 step 1 linesize 0 value 2 + } + {fltk::ValueSlider} slider_thresh { + label {Threshold (pixels)} + xywh {20 75 220 18} align 1 maximum 20 step 1 linesize 0 value 4 + } + } + {fltk::Group} group_bell { + label Bell open + private xywh {0 25 255 259} hide + } { + {fltk::ValueSlider} slider_volume { + label {Volume in %} + xywh {20 30 220 18} align 1 maximum 100 step 1 linesize 0 value 50 + } + {fltk::ValueSlider} slider_pitch { + label {Pitch in Hz} + xywh {20 75 220 18} align 1 minimum 100 maximum 1000 step 1 linesize 0 value 440 + } + {fltk::ValueSlider} slider_duration { + label {Duration in ms} + xywh {20 120 220 18} align 1 maximum 1000 step 1 linesize 0 value 200 + } + {fltk::Button} {} { + label Test + callback {testbellCB();} + xywh {175 170 60 25} + } + } + {fltk::Group} group_keyboard { + label Keyboard open + private xywh {0 25 255 259} align 5 hide + } { + {fltk::CheckButton} check_autorepeat { + label { Repeat key activated} + xywh {24 20 221 20} selection_color 2 value 1 + } + {fltk::ValueSlider} slider_click { + label {Click volume %} + xywh {25 67 220 18} align 1 maximum 100 step 1 linesize 0 value 50 + } + } + {fltk::Group} group_screen { + label Screen open + xywh {0 25 255 259} hide + } { + {fltk::Button} but_activate { + label {&Test} + callback {TestBlankCB();} + xywh {167 190 80 25} + } + {fltk::InvisibleBox} {} { + xywh {10 0 234 55} + } + {fltk::ValueSlider} slider_delay { + label {Activation delay (min)} + xywh {27 71 210 18} align 1 minimum 5 maximum 120 step 1 linesize 0 value 15 + } + {fltk::CheckButton} check_blanking { + label { Screen blanker activated} + xywh {15 20 222 20} selection_color 2 value 1 + } + {fltk::InvisibleBox} {} { + xywh {10 99 234 37} + } + {fltk::ValueSlider} slider_pattern { + label {Pattern change delay (min)} + xywh {27 155 210 18} align 1 deactivate minimum 1 maximum 5 step 0 linesize 1202590843 value 2 + } + {fltk::Group} {} {open + xywh {35 108 210 27} + } { + {fltk::RadioButton} radio_blank { + label Blank + callback {radioCB();} + xywh {0 0 105 20} selection_color 1 value 1 + } + {fltk::RadioButton} radio_pattern { + label Pattern + callback {radioCB();} + xywh {107 5 95 20} selection_color 1 + } + } + } + } + {fltk::Button} {} { + label {&Cancel} + callback {cancelCB();} + xywh {190 300 70 25} align 16 + } + {fltk::Button} but_kbd_apply { + label {&Apply} + callback {applyCB();} + xywh {115 300 70 25} + } + {fltk::ReturnButton} {} { + label OK + callback {okCB();} + xywh {40 300 70 25} shortcut 0xd + } + } + } + Function {~edisplayconf()} {open + } {} + Function {Run()} {open + } { + code {_finish = false; + win->show(); + while (!_finish) fltk::wait(); + win->hide();} {} + } + Function {make_window()} {} {} + Function {radioCB()} {open + } { + code {int l_blank; + + l_blank = (int)radio_blank->value(); + if (l_blank) + slider_pattern->deactivate(); + else + slider_pattern->activate();} {} + } +} + +Function {main(int ac,char **av)} {open return_type int +} { + code {//fl_init_locale_support("edisplayconf", PREFIX"/share/locale"); +app = new edisplayconf(); +read_disp_configuration(); +app->Run(); +delete app; +return 0;} {} +} + +decl {edisplayconf *app;} {public +} diff --git a/edisplayconf/edisplayconf.fld b/edisplayconf/edisplayconf.fld new file mode 100644 index 0000000..95d534b --- /dev/null +++ b/edisplayconf/edisplayconf.fld @@ -0,0 +1,174 @@ +# data file for the FLTK User Interface Designer (FLUID) +version 2,0003 +images_dir ./ +i18n +header_name {.h} +code_name {.cpp} +gridx 5 +gridy 5 +snap 3 +decl {\#include } {} + +decl {\#include } {} + +decl {\#include "conf.h"} {} + +decl {\#include } {} + +decl {\#include } {} + +class edisplayconf {open +} { + decl {bool _finish;} {public + } + Function {edisplayconf()} {open + } { + Fl_Window win { + label {Display configuration} + callback {_finish = true;} open + private xywh {211 112 265 335} hide + } { + Fl_Tabs {} {open + xywh {5 5 255 285} + } { + Fl_Group group_mouse { + label Mouse open + private xywh {0 20 255 265} align 4 + } { + Fl_Value_Slider slider_accel { + label Acceleration + xywh {25 25 220 18} type HORIZONTAL align 1 maximum 10 step 1 value 2 + } + Fl_Value_Slider slider_thresh { + label {Threshold (pixels)} + xywh {25 65 220 18} type HORIZONTAL align 1 maximum 20 step 1 value 4 + } + } + Fl_Group group_bell { + label Bell open + private xywh {0 20 255 265} hide + } { + Fl_Value_Slider slider_volume { + label {Volume in %} + xywh {25 25 220 18} type HORIZONTAL align 1 maximum 100 step 1 value 50 + } + Fl_Value_Slider slider_pitch { + label {Pitch in Hz} + xywh {25 70 220 18} type HORIZONTAL align 1 minimum 100 maximum 1000 step 1 value 440 + } + Fl_Value_Slider slider_duration { + label {Duration in ms} + xywh {25 115 220 18} type HORIZONTAL align 1 maximum 1000 step 1 value 200 + } + Fl_Button {} { + label Test + callback {testbellCB();} + xywh {180 165 60 25} + } + } + Fl_Group group_keyboard { + label Keyboard open + private xywh {0 20 255 265} align 5 hide + } { + Fl_Check_Button check_autorepeat { + label { Repeat key activated} + xywh {24 25 221 20} selection_color 2 value 1 + } + Fl_Value_Slider slider_click { + label {Click volume %} + xywh {25 65 220 18} type HORIZONTAL align 1 maximum 100 step 1 value 50 + } + } + Fl_Group group_screen { + label Screen open selected + xywh {0 20 255 265} hide + } { + Fl_Button but_activate { + label {&Test} + callback {TestBlankCB();} + xywh {165 187 80 25} + } + Fl_Box {} { + xywh {10 1 234 55} + } + Fl_Value_Slider slider_delay { + label {Activation delay (min)} + xywh {25 77 220 18} type HORIZONTAL align 1 minimum 5 maximum 120 step 1 value 15 + } + Fl_Check_Button check_blanking { + label { Screen blanker activated} + xywh {23 25 222 20} selection_color 2 value 1 + } + Fl_Box {} { + xywh {10 100 234 37} + } + Fl_Value_Slider slider_pattern { + label {Pattern change delay (min)} + xywh {25 152 220 18} type HORIZONTAL align 1 deactivate minimum 1 maximum 5 step 0 value 2 + } + Fl_Group {} {open + xywh {30 105 210 25} + } { + Fl_Round_Button radio_blank { + label Blank + callback {radioCB();} + xywh {0 5 105 20} type RADIO selection_color 1 value 1 + } + Fl_Round_Button radio_pattern { + label Pattern + callback {radioCB();} + xywh {115 5 95 20} type RADIO selection_color 1 + } + } + } + } + Fl_Button {} { + label {&Cancel} + callback {cancelCB();} + xywh {190 300 70 25} align 16 + } + Fl_Button but_kbd_apply { + label {&Apply} + callback {applyCB();} + xywh {115 300 70 25} + } + Fl_Return_Button {} { + label OK + callback {okCB();} + xywh {40 300 70 25} shortcut 0xd + } + } + } + Function {~edisplayconf()} {} {} + Function {Run()} {open + } { + code {_finish = false; + win->show(); + while (!_finish) Fl::wait(); + win->hide();} {} + } + Function {make_window()} {} {} + Function {radioCB()} {open + } { + code {int l_blank; + + l_blank = (int)radio_blank->value(); + if (l_blank) + slider_pattern->deactivate(); + else + slider_pattern->activate();} {} + } +} + +Function {main(int ac,char **av)} {open return_type int +} { + code {fl_init_locale_support("edisplayconf", PREFIX"/share/locale"); +app = new edisplayconf(); +read_disp_configuration(); +app->Run(); +delete app; +return 0;} {} +} + +decl {edisplayconf *app;} {public +} diff --git a/edisplayconf/edisplayconf.h b/edisplayconf/edisplayconf.h new file mode 100644 index 0000000..c065007 --- /dev/null +++ b/edisplayconf/edisplayconf.h @@ -0,0 +1,75 @@ +// generated by Fast Light User Interface Designer (fluid) version 2.0100 + +#ifndef edisplayconf_h +#define edisplayconf_h +#include +#include +#include +#include +#include +#include +#include +#include +#include + +class edisplayconf { +public: + bool _finish; + edisplayconf(); +private: + fltk::Window *win; + inline void cb_win_i(fltk::Window*, void*); + static void cb_win(fltk::Window*, void*); + fltk::Group *group_mouse; +public: + fltk::ValueSlider *slider_accel; + fltk::ValueSlider *slider_thresh; +private: + fltk::Group *group_bell; +public: + fltk::ValueSlider *slider_volume; + fltk::ValueSlider *slider_pitch; + fltk::ValueSlider *slider_duration; +private: + inline void cb_Test_i(fltk::Button*, void*); + static void cb_Test(fltk::Button*, void*); + fltk::Group *group_keyboard; +public: + fltk::CheckButton *check_autorepeat; + fltk::ValueSlider *slider_click; + fltk::Group *group_screen; + fltk::Button *but_activate; +private: + inline void cb_but_activate_i(fltk::Button*, void*); + static void cb_but_activate(fltk::Button*, void*); +public: + fltk::ValueSlider *slider_delay; + fltk::CheckButton *check_blanking; + fltk::ValueSlider *slider_pattern; + fltk::RadioButton *radio_blank; +private: + inline void cb_radio_blank_i(fltk::RadioButton*, void*); + static void cb_radio_blank(fltk::RadioButton*, void*); +public: + fltk::RadioButton *radio_pattern; +private: + inline void cb_radio_pattern_i(fltk::RadioButton*, void*); + static void cb_radio_pattern(fltk::RadioButton*, void*); + inline void cb_Cancel_i(fltk::Button*, void*); + static void cb_Cancel(fltk::Button*, void*); +public: + fltk::Button *but_kbd_apply; +private: + inline void cb_but_kbd_apply_i(fltk::Button*, void*); + static void cb_but_kbd_apply(fltk::Button*, void*); + inline void cb_OK_i(fltk::ReturnButton*, void*); + static void cb_OK(fltk::ReturnButton*, void*); +public: + ~edisplayconf(); + void Run(); + void make_window(); + void radioCB(); +}; +int main(int ac,char **av); +extern edisplayconf *app; +#endif diff --git a/edisplayconf/exset.h b/edisplayconf/exset.h new file mode 100644 index 0000000..da12dac --- /dev/null +++ b/edisplayconf/exset.h @@ -0,0 +1,76 @@ +#ifndef exset_h +#define exset_h + +#include //#include +#include "../edelib2/Run.h" //#include + +#include +#include + +#include +#include + +using namespace edelib; + +class Exset { + +public: + Exset(void) {} + ~Exset() {} + + char str[80]; + + void set_pattern(int delay, int pattern = -1){ + if( pattern != -1 ){ + sprintf(str,"xset s %d %d",delay*60,pattern*60); + run_program(str); + }else{ + sprintf(str,"xset s %d",delay*60); + run_program(str); + } + } + void set_check_blank(int blank){ + sprintf(str,"xset s %s",blank ? "on" : "off"); + run_program(str); + } + void set_blank(int blank){ + sprintf(str,"xset s %s",blank ? "blank" : "noblank"); + run_program(str); + } + + void test_blank() { run_program("xset s activate"); } + void test_bell() { run_program("xkbbell"); } + + void set_mouse(int accel, int thresh){ + XChangePointerControl(fltk::xdisplay, true, true, accel, + 1, thresh); + } + + + void set_bell(int volume, int pitch, int duration, int sound = 0){ + XKeyboardControl _ctrl; + unsigned long mask = KBBellPercent | KBBellPitch | KBBellDuration; + + _ctrl.bell_percent = volume; + _ctrl.bell_pitch = pitch; + _ctrl.bell_duration = duration; + + set_xset(&_ctrl,mask); + } + + void set_keybd( int repeat, int clicks) { + XKeyboardControl _ctrl; + unsigned long mask = KBKeyClickPercent | KBAutoRepeatMode; + + _ctrl.key_click_percent = clicks; + _ctrl.auto_repeat_mode = (repeat ? AutoRepeatModeOn : AutoRepeatModeOff); + + set_xset(&_ctrl,mask); + } + + void set_xset(XKeyboardControl * ctrl, unsigned long mask){ + XChangeKeyboardControl(fltk::xdisplay, mask, ctrl); + } +}; +#endif + diff --git a/edisplayconf/locale/hu.po b/edisplayconf/locale/hu.po new file mode 100644 index 0000000..e743756 --- /dev/null +++ b/edisplayconf/locale/hu.po @@ -0,0 +1,99 @@ +msgid "" +msgstr "" +"Project-Id-Version: \n" +"POT-Creation-Date: \n" +"PO-Revision-Date: 2005-02-09 11:21+0100\n" +"Last-Translator: Nemeth Otto \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: edisplayconf.cpp:70 +msgid "Display configuration" +msgstr "Felület beállításai" + +#: edisplayconf.cpp:74 +msgid "Mouse" +msgstr "Egér" + +#: edisplayconf.cpp:76 +msgid "Acceleration" +msgstr "Gyorsulás" + +#: edisplayconf.cpp:83 +msgid "Threshold (pixels)" +msgstr "Határérték (képpont)" + +#: edisplayconf.cpp:92 +msgid "Bell" +msgstr "Csengő" + +#: edisplayconf.cpp:94 +msgid "Volume in %" +msgstr "Hangerő %" + +#: edisplayconf.cpp:101 +msgid "Pitch in Hz" +msgstr "Frekvencia" + +#: edisplayconf.cpp:109 +msgid "Duration in ms" +msgstr "Időtartam (ms)" + +#: edisplayconf.cpp:116 +msgid "Test" +msgstr "Próba" + +#: edisplayconf.cpp:121 +msgid "Keyboard" +msgstr "Billentyűzet" + +#: edisplayconf.cpp:124 +msgid " Repeat key activated" +msgstr "Billentyűzet ismétlés" + +#: edisplayconf.cpp:128 +msgid "Click volume %" +msgstr "Hangerő %" + +#: edisplayconf.cpp:137 +msgid "Screen" +msgstr "Képernyő" + +#: edisplayconf.cpp:139 +msgid "&Test" +msgstr "Pró&ba" + +#: edisplayconf.cpp:143 +msgid "Activation delay (min)" +msgstr "Aktiválás kezdete (perc)" + +#: edisplayconf.cpp:151 +msgid " Screen blanker activated" +msgstr "Képernyő sötétítés" + +#: edisplayconf.cpp:156 +msgid "Pattern change delay (min)" +msgstr "Embléma változás (perc)" + +#: edisplayconf.cpp:166 +msgid "Blank" +msgstr "Sötétítés" + +#: edisplayconf.cpp:172 +msgid "Pattern" +msgstr "Embléma" + +#: edisplayconf.cpp:183 +msgid "&Cancel" +msgstr "Mégs&em" + +#: edisplayconf.cpp:187 +msgid "&Apply" +msgstr "&Alkalmaz" + +#: edisplayconf.cpp:190 +msgid "OK" +msgstr "OK" + diff --git a/edisplayconf/locale/id.po b/edisplayconf/locale/id.po new file mode 100644 index 0000000..647d5e7 --- /dev/null +++ b/edisplayconf/locale/id.po @@ -0,0 +1,104 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR Free Software Foundation, Inc. +# FIRST AUTHOR , YEAR. +# +msgid "" +msgstr "" +"Project-Id-Version: edisplayconf 1.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2005-02-04 12:31+0100\n" +"PO-Revision-Date: 202-11-29 14:29+0700\n" +"Last-Translator: Bambang Purnomosidi D. P. \n" +"Language-Team: id \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=iso-8859-2\n" +"Content-Transfer-Encoding: 8bit\n" + +#: edisplayconf.cpp:70 +msgid "Display configuration" +msgstr "Konfigurasi tampilan" + +#: edisplayconf.cpp:74 +msgid "Mouse" +msgstr "Mouse" + +#: edisplayconf.cpp:76 +msgid "Acceleration" +msgstr "Akselerasi" + +#: edisplayconf.cpp:83 +msgid "Threshold (pixels)" +msgstr "Threshold (pixel)" + +#: edisplayconf.cpp:92 +msgid "Bell" +msgstr "Bel" + +#: edisplayconf.cpp:94 +msgid "Volume in %" +msgstr "Volumen dalam %" + +#: edisplayconf.cpp:101 +msgid "Pitch in Hz" +msgstr "Pitch dalam Hz" + +#: edisplayconf.cpp:109 +msgid "Duration in ms" +msgstr "Durasi dalam milidetik" + +#: edisplayconf.cpp:116 +#, fuzzy +msgid "Test" +msgstr "&Tes" + +#: edisplayconf.cpp:121 +msgid "Keyboard" +msgstr "Keyboard" + +#: edisplayconf.cpp:124 +msgid " Repeat key activated" +msgstr " tombol Repeat diaktifkan" + +#: edisplayconf.cpp:128 +msgid "Click volume %" +msgstr "Klik volumen %" + +#: edisplayconf.cpp:137 +msgid "Screen" +msgstr "Layar" + +#: edisplayconf.cpp:139 +msgid "&Test" +msgstr "&Tes" + +#: edisplayconf.cpp:143 +msgid "Activation delay (min)" +msgstr "Waktu tunda aktivasi (menit)" + +#: edisplayconf.cpp:151 +msgid " Screen blanker activated" +msgstr " Pengosong layar diaktifkan" + +#: edisplayconf.cpp:156 +msgid "Pattern change delay (min)" +msgstr "Waktu tunda perubahan pola (menit)" + +#: edisplayconf.cpp:166 +msgid "Blank" +msgstr "Kosong" + +#: edisplayconf.cpp:172 +msgid "Pattern" +msgstr "Pola" + +#: edisplayconf.cpp:183 +msgid "&Cancel" +msgstr "&Batal" + +#: edisplayconf.cpp:187 +msgid "&Apply" +msgstr "&Aktifkan" + +#: edisplayconf.cpp:190 +msgid "OK" +msgstr "" diff --git a/edisplayconf/locale/messages.pot b/edisplayconf/locale/messages.pot new file mode 100644 index 0000000..65447c8 --- /dev/null +++ b/edisplayconf/locale/messages.pot @@ -0,0 +1,105 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2005-02-04 12:31+0100\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=CHARSET\n" +"Content-Transfer-Encoding: 8bit\n" + +#: edisplayconf.cpp:70 +msgid "Display configuration" +msgstr "" + +#: edisplayconf.cpp:74 +msgid "Mouse" +msgstr "" + +#: edisplayconf.cpp:76 +msgid "Acceleration" +msgstr "" + +#: edisplayconf.cpp:83 +msgid "Threshold (pixels)" +msgstr "" + +#: edisplayconf.cpp:92 +msgid "Bell" +msgstr "" + +#: edisplayconf.cpp:94 +msgid "Volume in %" +msgstr "" + +#: edisplayconf.cpp:101 +msgid "Pitch in Hz" +msgstr "" + +#: edisplayconf.cpp:109 +msgid "Duration in ms" +msgstr "" + +#: edisplayconf.cpp:116 +msgid "Test" +msgstr "" + +#: edisplayconf.cpp:121 +msgid "Keyboard" +msgstr "" + +#: edisplayconf.cpp:124 +msgid " Repeat key activated" +msgstr "" + +#: edisplayconf.cpp:128 +msgid "Click volume %" +msgstr "" + +#: edisplayconf.cpp:137 +msgid "Screen" +msgstr "" + +#: edisplayconf.cpp:139 +msgid "&Test" +msgstr "" + +#: edisplayconf.cpp:143 +msgid "Activation delay (min)" +msgstr "" + +#: edisplayconf.cpp:151 +msgid " Screen blanker activated" +msgstr "" + +#: edisplayconf.cpp:156 +msgid "Pattern change delay (min)" +msgstr "" + +#: edisplayconf.cpp:166 +msgid "Blank" +msgstr "" + +#: edisplayconf.cpp:172 +msgid "Pattern" +msgstr "" + +#: edisplayconf.cpp:183 +msgid "&Cancel" +msgstr "" + +#: edisplayconf.cpp:187 +msgid "&Apply" +msgstr "" + +#: edisplayconf.cpp:190 +msgid "OK" +msgstr "" diff --git a/edisplayconf/locale/ru.po b/edisplayconf/locale/ru.po new file mode 100644 index 0000000..55160b0 --- /dev/null +++ b/edisplayconf/locale/ru.po @@ -0,0 +1,104 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR Free Software Foundation, Inc. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2005-02-04 12:31+0100\n" +"PO-Revision-Date: 2002-11-28 HO:MI+ZONE\n" +"Last-Translator: aabbvv \n" +"Language-Team: RUSSIAN \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=koi8-r\n" +"Content-Transfer-Encoding: 8bit\n" + +#: edisplayconf.cpp:70 +msgid "Display configuration" +msgstr " " + +#: edisplayconf.cpp:74 +msgid "Mouse" +msgstr "" + +#: edisplayconf.cpp:76 +msgid "Acceleration" +msgstr "" + +#: edisplayconf.cpp:83 +msgid "Threshold (pixels)" +msgstr " " + +#: edisplayconf.cpp:92 +msgid "Bell" +msgstr "" + +#: edisplayconf.cpp:94 +msgid "Volume in %" +msgstr ", %" + +#: edisplayconf.cpp:101 +msgid "Pitch in Hz" +msgstr ", " + +#: edisplayconf.cpp:109 +msgid "Duration in ms" +msgstr ", " + +#: edisplayconf.cpp:116 +msgid "Test" +msgstr "" + +#: edisplayconf.cpp:121 +msgid "Keyboard" +msgstr "" + +#: edisplayconf.cpp:124 +msgid " Repeat key activated" +msgstr " ޣ" + +#: edisplayconf.cpp:128 +msgid "Click volume %" +msgstr " , %" + +#: edisplayconf.cpp:137 +msgid "Screen" +msgstr "" + +#: edisplayconf.cpp:139 +msgid "&Test" +msgstr "" + +#: edisplayconf.cpp:143 +msgid "Activation delay (min)" +msgstr " " + +#: edisplayconf.cpp:151 +msgid " Screen blanker activated" +msgstr " ޣ" + +#: edisplayconf.cpp:156 +msgid "Pattern change delay (min)" +msgstr " , " + +#: edisplayconf.cpp:166 +msgid "Blank" +msgstr " " + +#: edisplayconf.cpp:172 +msgid "Pattern" +msgstr "" + +#: edisplayconf.cpp:183 +msgid "&Cancel" +msgstr "" + +#: edisplayconf.cpp:187 +msgid "&Apply" +msgstr "" + +#: edisplayconf.cpp:190 +msgid "OK" +msgstr "" diff --git a/edisplayconf/locale/sk.po b/edisplayconf/locale/sk.po new file mode 100644 index 0000000..9a976a2 --- /dev/null +++ b/edisplayconf/locale/sk.po @@ -0,0 +1,104 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR Free Software Foundation, Inc. +# FIRST AUTHOR , YEAR. +# +msgid "" +msgstr "" +"Project-Id-Version: edisplayconf 1.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2005-02-04 12:31+0100\n" +"PO-Revision-Date: 2002-04-21 14:50+0200\n" +"Last-Translator: Martin Pekar \n" +"Language-Team: Slovak \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: edisplayconf.cpp:70 +msgid "Display configuration" +msgstr "Nastavenie obrazovky" + +#: edisplayconf.cpp:74 +msgid "Mouse" +msgstr "Myš" + +#: edisplayconf.cpp:76 +msgid "Acceleration" +msgstr "Zrýchlenie" + +#: edisplayconf.cpp:83 +msgid "Threshold (pixels)" +msgstr "Threshold (v pixeloch)" + +#: edisplayconf.cpp:92 +msgid "Bell" +msgstr "Zvonček" + +#: edisplayconf.cpp:94 +msgid "Volume in %" +msgstr "Hlasitosť v %" + +#: edisplayconf.cpp:101 +msgid "Pitch in Hz" +msgstr "Pitch v Hz" + +#: edisplayconf.cpp:109 +msgid "Duration in ms" +msgstr "Trvanie v ms" + +#: edisplayconf.cpp:116 +#, fuzzy +msgid "Test" +msgstr "&Test" + +#: edisplayconf.cpp:121 +msgid "Keyboard" +msgstr "Klávesnica" + +#: edisplayconf.cpp:124 +msgid " Repeat key activated" +msgstr " Aktivované opakovanie kláves" + +#: edisplayconf.cpp:128 +msgid "Click volume %" +msgstr "Hlasitosť kliknutia %" + +#: edisplayconf.cpp:137 +msgid "Screen" +msgstr "Obrazovka" + +#: edisplayconf.cpp:139 +msgid "&Test" +msgstr "&Test" + +#: edisplayconf.cpp:143 +msgid "Activation delay (min)" +msgstr "Čas aktivatácie (min)" + +#: edisplayconf.cpp:151 +msgid " Screen blanker activated" +msgstr " Aktivovaný šetrič obrazovky" + +#: edisplayconf.cpp:156 +msgid "Pattern change delay (min)" +msgstr "Čas zmeny vzoru (min)" + +#: edisplayconf.cpp:166 +msgid "Blank" +msgstr "Žiadny" + +#: edisplayconf.cpp:172 +msgid "Pattern" +msgstr "Vzor" + +#: edisplayconf.cpp:183 +msgid "&Cancel" +msgstr "&Zrušiť" + +#: edisplayconf.cpp:187 +msgid "&Apply" +msgstr "&Použiť" + +#: edisplayconf.cpp:190 +msgid "OK" +msgstr "" diff --git a/edisplayconf/locale/sr.po b/edisplayconf/locale/sr.po new file mode 100644 index 0000000..ce3e523 --- /dev/null +++ b/edisplayconf/locale/sr.po @@ -0,0 +1,104 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR Free Software Foundation, Inc. +# FIRST AUTHOR , YEAR. +# +msgid "" +msgstr "" +"Project-Id-Version: EDISPLAYCONF 1.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2005-02-04 12:31+0100\n" +"PO-Revision-Date: 2002-11-27 04:46+0100\n" +"Last-Translator: Dejan Lekic \n" +"Language-Team: LINUKS.org T.T. \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: edisplayconf.cpp:70 +msgid "Display configuration" +msgstr "Прикажи конфигурацију" + +#: edisplayconf.cpp:74 +msgid "Mouse" +msgstr "Миш" + +#: edisplayconf.cpp:76 +msgid "Acceleration" +msgstr "Акцелерација" + +#: edisplayconf.cpp:83 +msgid "Threshold (pixels)" +msgstr "Праг (у пикселима)" + +#: edisplayconf.cpp:92 +msgid "Bell" +msgstr "Звоно" + +#: edisplayconf.cpp:94 +msgid "Volume in %" +msgstr "Јачина у %" + +#: edisplayconf.cpp:101 +msgid "Pitch in Hz" +msgstr "Ниво у Hz" + +#: edisplayconf.cpp:109 +msgid "Duration in ms" +msgstr "Трајање у ms" + +#: edisplayconf.cpp:116 +#, fuzzy +msgid "Test" +msgstr "&Тест" + +#: edisplayconf.cpp:121 +msgid "Keyboard" +msgstr "Тастатура" + +#: edisplayconf.cpp:124 +msgid " Repeat key activated" +msgstr " Активиран тастер за понављање" + +#: edisplayconf.cpp:128 +msgid "Click volume %" +msgstr "Јачина клика %" + +#: edisplayconf.cpp:137 +msgid "Screen" +msgstr "Скрин" + +#: edisplayconf.cpp:139 +msgid "&Test" +msgstr "&Тест" + +#: edisplayconf.cpp:143 +msgid "Activation delay (min)" +msgstr "Пауза за активирање (мин)" + +#: edisplayconf.cpp:151 +msgid " Screen blanker activated" +msgstr "Скрин бланкер активиран" + +#: edisplayconf.cpp:156 +msgid "Pattern change delay (min)" +msgstr "Мењање шаблона након (мин)" + +#: edisplayconf.cpp:166 +msgid "Blank" +msgstr "Бланк" + +#: edisplayconf.cpp:172 +msgid "Pattern" +msgstr "Шаблон" + +#: edisplayconf.cpp:183 +msgid "&Cancel" +msgstr "&Одустани" + +#: edisplayconf.cpp:187 +msgid "&Apply" +msgstr "&Примени" + +#: edisplayconf.cpp:190 +msgid "OK" +msgstr "" diff --git a/efiler/EDE_DirTree.cpp b/efiler/EDE_DirTree.cpp new file mode 100644 index 0000000..ad091a8 --- /dev/null +++ b/efiler/EDE_DirTree.cpp @@ -0,0 +1,395 @@ +// +// "$Id$" +// +// FileBrowser routines. +// +// Copyright 1999-2006 by Michael Sweet. +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Library General Public +// License as published by the Free Software Foundation; either +// version 2 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 +// Library General Public License for more details. +// +// You should have received a copy of the GNU Library General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 +// USA. +// +// Please report all bugs and problems on the following page: +// +// http://www.fltk.org/str.php +// +// Contents: +// +// FileBrowser::full_height() - Return the height of the list. +// FileBrowser::item_height() - Return the height of a list item. +// FileBrowser::item_width() - Return the width of a list item. +// FileBrowser::item_draw() - Draw a list item. +// FileBrowser::FileBrowser() - Create a FileBrowser widget. +// FileBrowser::load() - Load a directory into the browser. +// FileBrowser::filter() - Set the filename filter. +// + +// +// Include necessary header files... +// + +#include "EDE_DirTree.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +// This library is hopelessly single-platform + + +#include "../edelib2/Icon.h" +#include "../edelib2/Util.h" +#include "../edelib2/NLS.h" + +#include + + +#define MAX_TREE_DEPTH 100 + + + +using namespace fltk; + +// +// 'FileBrowser::FileBrowser()' - Create a FileBrowser widget. +// + + + +// Fn that makes sure path ends with slash +// (ensure that path allocation is large enough to take one extra char) +void make_end_with_slash(char* path) { + int i=strlen(path); + if (path[i-1] != '/') { + path[i]='/'; + path[i+1]='\0'; + } +} + + + + + + +DirTree::DirTree(int X, // I - Upper-lefthand X coordinate + int Y, // I - Upper-lefthand Y coordinate + int W, // I - Width in pixels + int H, // I - Height in pixels + const char *l) // I - Label text + : Browser(X, Y, W, H, l) { + // Initialize the filter pattern, current directory, and icon size... + //pattern_ = "*"; + //directory_ = ""; + //icon_size_ = 12.0f; + //filetype_ = FILES; + show_hidden_ = false; + + //Symbol* fileSmall = edelib::Icon::get(DEFAULT_ICON,edelib::Icon::SMALL); + //set_symbol(Browser::LEAF, fileSmall, fileSmall); +} + + + +// Filesystem data +// TODO: find better icons for Amiga, Macintosh etc. + +static struct { + char id[15]; + char uiname[50]; + char icon[20]; +} filesystems[] = { +// Filesystems that should be ignored + {"auto", "", ""}, // removables will be added another way + {"autofs", "", ""}, // removables will be added another way + {"binfmt_misc", "", ""}, + {"debugfs", "", ""}, + {"devfs", "", ""}, + {"devpts", "", ""}, + {"fd", "", ""}, + {"fdesc", "", ""}, + {"kernfs", "", ""}, + {"proc", "", ""}, + {"procfs", "", ""}, + {"swap", "", ""}, + {"sysfs", "", ""}, + {"tmpfs", "", ""}, + {"usbfs", "", ""}, + +// Common filesystems + {"ext2", "Linux disk (%s)", "hdd_unmount"}, + {"ext2fs", "Linux disk (%s)", "hdd_unmount"}, + {"ext3", "Linux disk (%s)", "hdd_unmount"}, + {"reiserfs", "Linux disk (%s)", "hdd_unmount"}, + {"ffs", "BSD disk (%s)", "hdd_unmount"}, + {"ufs", "Unix disk (%s)", "hdd_unmount"}, + {"dos", "Windows disk (%s)", "win_mount"}, + {"fat", "Windows disk (%s)", "win_mount"}, + {"msdos", "Windows disk (%s)", "win_mount"}, + {"ntfs", "Windows disk (%s)", "win_mount"}, + {"pcfs", "Windows disk (%s)", "win_mount"}, + {"umsdos", "Windows disk (%s)", "win_mount"}, + {"vfat", "Windows disk (%s)", "win_mount"}, + {"cd9660", "CD-ROM (%s)", "cdrom_unmount"}, + {"cdfs", "CD-ROM (%s)", "cdrom_unmount"}, + {"cdrfs", "CD-ROM (%s)", "cdrom_unmount"}, + {"hsfs", "CD-ROM (%s)", "cdrom_unmount"}, + {"iso9660", "CD-ROM (%s)", "cdrom_unmount"}, + {"isofs", "CD-ROM (%s)", "cdrom_unmount"}, + {"udf", "DVD-ROM (%s)", "dvd_unmount"}, + {"cifs", "Shared directory (%s)", "server"}, + {"nfs", "Shared directory (%s)", "server"}, + {"nfs4", "Shared directory (%s)", "server"}, + {"smbfs", "Shared directory (%s)", "server"}, + {"cramfs", "Virtual (RAM) disk (%s)", "memory"}, + {"mfs", "Virtual (RAM) disk (%s)", "memory"}, + {"ramfs", "Virtual (RAM) disk (%s)", "memory"}, + {"romfs", "Virtual (RAM) disk (%s)", "memory"}, + {"union", "Virtual (RAM) disk (%s)", "memory"}, // not accurate, but good enough + {"unionfs", "Virtual (RAM) disk (%s)", "memory"}, // not accurate, but good enough + {"jfs", "IBM AIX disk (%s)", "hdd_unmount"}, + {"xfs", "SGI IRIX disk (%s)", "hdd_unmount"}, + + +// Other filesystems + {"coherent", "Unix disk (%s)", "hdd_unmount"}, + {"sysv", "Unix disk (%s)", "hdd_unmount"}, + {"xenix", "Unix disk (%s)", "hdd_unmount"}, + {"adfs", "RiscOS disk (%s)", "hdd_unmount"}, + {"filecore", "RiscOS disk (%s)", "hdd_unmount"}, + {"ados", "Amiga disk (%s)", "hdd_unmount"}, + {"affs", "Amiga disk (%s)", "hdd_unmount"}, + {"afs", "AFS shared directory (%s)", "server"}, + {"befs", "BeOS disk (%s)", "hdd_unmount"}, + {"bfs", "UnixWare disk (%s)", "hdd_unmount"}, + {"efs", "SGI IRIX disk (%s)", "hdd_unmount"}, + {"ext", "Old Linux disk (%s)", "hdd_unmount"}, + {"hfs", "Macintosh disk (%s)", "hdd_unmount"}, // Also used for HP-UX filesystem!! + {"hpfs", "OS/2 disk (%s)", "hdd_unmount"}, +// {"lfs", "BSD LFS disk (%s)", "hdd_unmount"}, // This is said to not work + {"minix", "Minix disk (%s)", "hdd_unmount"}, + {"ncpfs", "NetWare shared directory (%s)", "server"}, + {"nwfs", "NetWare shared directory (%s)", "server"}, + {"qns", "QNX disk (%s)", "hdd_unmount"}, + {"supermount", "Removable disk (%s)", "cdrom_umnount"}, // ??? + {"xiafs", "Old Linux disk (%s)", "hdd_unmount"}, + +// Virtual filesystems (various views of existing files) +// How often are these used? +// {"cachefs", "Unix virtual disk ?? (%s)", "memory"}, +// {"lofs", "Solaris virtual disk ?? (%s)", "memory"}, +// {"null", "BSD virtual disk ?? (%s)", "memory"}, +// {"nullfs", "BSD virtual disk ?? (%s)", "memory"}, +// {"overlay", "BSD virtual disk ?? (%s)", "memory"}, +// {"portal", "BSD virtual disk ?? (%s)", "memory"}, +// {"portalfs", "BSD virtual disk ?? (%s)", "memory"}, +// {"umap", "BSD virtual disk ?? (%s)", "memory"}, +// {"umapfs", "BSD virtual disk ?? (%s)", "memory"}, + + {"", "", ""} +}; + +// +// 'FileBrowser::load()' - Load basic directory list into browser +// + +int // O - Number of files loaded +DirTree::load() +{ + + int num_files=0; + char buffer[PATH_MAX]; // buffer for labels + Group* o; // generic pointer + + this->begin(); + + // Top level icon + Group* system = (Group*)add_group(_("System"), 0, 0, edelib::Icon::get("tux",edelib::Icon::TINY)); + + // Home icon + snprintf(buffer,PATH_MAX,_("%s's Home"), getenv("USER")); + o = (Group*)add_group(strdup(buffer), system, 0, edelib::Icon::get("folder_home",edelib::Icon::TINY)); + strncpy(buffer,getenv("HOME"),PATH_MAX); + // Home env. var. often doesn't end with slash + make_end_with_slash(buffer); + o->user_data(strdup(buffer)); + + // Root icon + o = (Group*)add_group(_("Whole disk"), system, 0, edelib::Icon::get("folder_red",edelib::Icon::TINY)); + o->user_data(strdup("/")); + + num_files=3; + + // Read mtab/fstab/whatever + FILE *mtab; // /etc/mtab or /etc/mnttab file + char line[1024]; // Input line + char device[1024], mountpoint[1024], fs[1024]; + + // mtab doesn't contain removable entries, but we will find another way + // to add them (some day) + + mtab = fopen("/etc/mnttab", "r"); // Fairly standard + if (mtab == NULL) + mtab = fopen("/etc/mtab", "r"); // More standard + if (mtab == NULL) + mtab = fopen("/etc/fstab", "r"); // Otherwise fallback to full list + if (mtab == NULL) + mtab = fopen("/etc/vfstab", "r"); // Alternate full list file + + while (mtab!= NULL && fgets(line, sizeof(line), mtab) != NULL) { + if (line[0] == '#' || line[0] == '\n') + continue; + if (sscanf(line, "%s%s%s", device, mountpoint, fs) != 3) + continue; + + make_end_with_slash(mountpoint); + + // Stuff that should be invisible cause we already show it + if (strcmp(mountpoint,"/") == 0) continue; // root + if (strcmp(mountpoint,getenv("HOME")) == 0) continue; // home dir + + // Device name without "/dev/" + char *shortdev = strrchr(device,'/'); + if (shortdev==NULL) shortdev=device; else shortdev++; + + // Go through list of known filesystems + for (int i=0; filesystems[i].id[0] != '\0'; i++) { + if (strcmp(fs, filesystems[i].id) == 0) { + if (filesystems[i].uiname[0] == '\0') break; // skipping this fs + + snprintf(buffer, PATH_MAX, filesystems[i].uiname, shortdev); + o = (Group*)add_group(strdup(buffer), system, 0, edelib::Icon::get(filesystems[i].icon, edelib::Icon::TINY)); + o->user_data(strdup(mountpoint)); + num_files++; + } + } + } + + this->end(); + system->set_flag(fltk::OPENED); + + this->redraw(); + + return (num_files); +} + +// Browser method for opening (expanding) a subtree +// We override this method so we could scan directory tree on demand +bool DirTree::set_item_opened(bool open) { + // Eliminate bogus call + if (!item()) return false; + // This is what we do different from Browser: +//fprintf (stderr, "Children: %d\n",children(current_index(),current_level()+1)); + if (open && children(current_index(),current_level()+1)<=0) { + dirent** files; + char* directory = (char*)item()->user_data(); + char filename[PATH_MAX]; + + // NOTE we default to casenumericsort! + int num_files = filename_list(directory, &files, casenumericsort); + Group* current = (Group*)item(); + + for (int i=0; id_name[0] == '.' && show_hidden_==false) continue; + if (!strcmp(files[i]->d_name,"./") || !strcmp(files[i]->d_name,"../")) continue; + + snprintf(filename, PATH_MAX, "%s%s", directory, files[i]->d_name); +//fprintf(stderr, "Testing: %s\n",filename); + if (filename_isdir(filename)) { + // Strip slash from label + char *n = strdup(files[i]->d_name); + n[strlen(n)-1] = '\0'; + Group* o = (Group*)add_group(n, current, 0, edelib::Icon::get("folder", edelib::Icon::TINY)); + o->user_data(strdup(filename)); + } + } + } + return Browser::set_item_opened(open); +} + + +// Recursively find tree entry whose user_data() (system path) +// contains the largest portion of given path +// Best match is focused, return value tells if perfect match was found +bool DirTree::set_current(const char* path) { + int tree[MAX_TREE_DEPTH]; + + // Copy of path where we add slash as needed + char mypath[PATH_MAX]; + strncpy(mypath,path,PATH_MAX-2); + make_end_with_slash(mypath); + + // There is always exactly one toplevel entry - "System" + tree[0]=0; + set_item(tree,1); + bool t = find_best_match(mypath,tree,1); + set_focus(); + // Expand current item + set_item_opened(true); + return t; +} + +// Recursive function called by set_current() +bool DirTree::find_best_match(const char* path, int* tree, int level) { + uint bestlen=0; + int bestindex=-1; + int n_children = children(tree,level); + + // Given entry has no children + // let's forward this result to first caller + if (n_children == -1) return false; + + // Look at all children of given entry and find the best match + for (int i=0; iuser_data(); + if (strlen(p)>strlen(path)) continue; // too specific + if ((strncmp(path, p, strlen(p)) == 0) && (strlen(p)>bestlen)) { + bestlen=strlen(p); + bestindex=i; + } + } + + // No matches found + if (bestindex==-1) return false; + + // Focus on best match + tree[level]=bestindex; + goto_index(tree,level); +//char* p = (char*)child(tree,level)->user_data(); +//fprintf (stderr, "Found: %s\n", p); + + // Is this a perfect match? + if (bestlen == strlen(path)) return true; + + // Can the best item be further expanded? + set_item_opened(true); + + // Try its children (if none, it will return false) + return find_best_match(path, tree, level+1); +} + + + +// +// End of "$Id$". +// diff --git a/efiler/EDE_DirTree.h b/efiler/EDE_DirTree.h new file mode 100644 index 0000000..37dec8d --- /dev/null +++ b/efiler/EDE_DirTree.h @@ -0,0 +1,94 @@ +// +// "$Id$" +// +// FileBrowser definitions. +// +// Copyright 1999-2006 by Michael Sweet. +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Library General Public +// License as published by the Free Software Foundation; either +// version 2 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 +// Library General Public License for more details. +// +// You should have received a copy of the GNU Library General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 +// USA. +// +// Please report all bugs and problems on the following page: +// +// http://www.fltk.org/str.php +// + +// +// Include necessary header files... +// + +#ifndef edelib_DirTree_h +#define edelib_DirTree_h + +#include +#include + +//namespace fltk { + + +// +// FileBrowser class... +// + +class DirTree : public fltk::Browser +{ + + +public: + + DirTree(int, int, int, int, const char * = 0); + + /*float icon_size() const { + return (icon_size_ <0? (2.0f* textsize()) : icon_size_); + } + void icon_size(float f) { icon_size_ = f; redraw(); };*/ + + // Set given directory as current. Returns false if directory doesn't exist + // (the closest parent directory will be selected) + bool set_current(const char* path); + + // Load base directories into widget + int load(); + + // Browser method for opening (expanding) a subtree + // We override this method so we could scan directory tree on demand + bool set_item_opened(bool); + + // adding or inserting a line into the fileBrowser + //void insert(int n, const char* label, fltk::FileIcon* icon); + //void insert(int n, const char* label, void* data){fltk::Menu::insert(n, label,data);} + //void add(const char * line, fltk::FileIcon* icon); + + // Return full system path to given item + const char* system_path(int i) const { + return (const char*)child(i)->user_data(); } + + // Showing or not showing the hidden files, that's the question: +public: + // sets this flag if you want to see the hidden files in the browser + void show_hidden(bool show) { show_hidden_= show; } + bool show_hidden() const {return show_hidden_;} +private: + bool show_hidden_; + bool find_best_match(const char* path, int* indexes, int level); +}; + +//} + +#endif // !_Fl_File_Browser_H_ + +// +// End of "$Id$". +// diff --git a/efiler/EDE_FileBrowser.cpp b/efiler/EDE_FileBrowser.cpp new file mode 100644 index 0000000..fa4049f --- /dev/null +++ b/efiler/EDE_FileBrowser.cpp @@ -0,0 +1,416 @@ +// +// "$Id$" +// +// FileBrowser routines. +// +// Copyright 1999-2006 by Michael Sweet. +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Library General Public +// License as published by the Free Software Foundation; either +// version 2 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 +// Library General Public License for more details. +// +// You should have received a copy of the GNU Library General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 +// USA. +// +// Please report all bugs and problems on the following page: +// +// http://www.fltk.org/str.php +// +// Contents: +// +// FileBrowser::full_height() - Return the height of the list. +// FileBrowser::item_height() - Return the height of a list item. +// FileBrowser::item_width() - Return the width of a list item. +// FileBrowser::item_draw() - Draw a list item. +// FileBrowser::FileBrowser() - Create a FileBrowser widget. +// FileBrowser::load() - Load a directory into the browser. +// FileBrowser::filter() - Set the filename filter. +// + +// +// Include necessary header files... +// + +#include "EDE_FileBrowser.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef __CYGWIN__ +# include +#elif defined(WIN32) +# include +# include +// Apparently Borland C++ defines DIRECTORY in , which +// interfers with the FileIcon enumeration of the same name. +# ifdef DIRECTORY +# undef DIRECTORY +# endif // DIRECTORY +#endif // __CYGWIN__ + +#ifdef __EMX__ +# define INCL_DOS +# define INCL_DOSMISC +# include +#endif // __EMX__ + +// CodeWarrior (__MWERKS__) gets its include paths confused, so we +// temporarily disable this... +#if defined(__APPLE__) && !defined(__MWERKS__) +# include +# include +# include +#endif // __APPLE__ && !__MWERKS__ + +#include "../edelib2/Icon.h" +#include "../edelib2/Util.h" +#include "../edelib2/MimeType.h" +#include "../edelib2/NLS.h" + +#define DEFAULT_ICON "misc-vedran" +#define FOLDER_ICON "folder" +#define UPDIR_ICON "undo" + +#include + +#include +#include +#include + +#include + +using namespace fltk; +using namespace edelib; + + + +// Event handler for EditBox +int EditBox::handle(int event) { + if (!this->visible()) return parent()->handle(event); + bool above=false; + //fprintf(stderr,"Editbox event: %d (%s)\n",event,event_name(event)); + + // Change filename + if (event==KEY && (event_key()==ReturnKey || event_key()==KeypadEnter)) { + // split old filename to path and file + char path[PATH_MAX], file[PATH_MAX]; + strcpy(path, (char*)editing_->user_data()); + if (path[strlen(path)-1] == '/') path[strlen(path)-1]='\0'; + char *p = strrchr(path,'/'); + if (p==0 || *p=='\0') { + strcpy(file,path); + path[0]='\0'; + } else { // usual case + p++; + strcpy(file,p); + *p='\0'; + } + + if (strlen(file)!=strlen(text()) || strcmp(file,text())!=0) { + // Create new filename + strncat(path, text(), PATH_MAX-strlen(path)); + char oldname[PATH_MAX]; + strcpy(oldname, (char*)editing_->user_data()); + if (rename(oldname, path) == -1) { + alert(tsprintf(_("Could not rename file! Error was:\n\t%s"), strerror(errno))); + } else { + // Update browser + free(editing_->user_data()); + editing_->user_data(strdup(path)); + const char* l = editing_->label(); + editing_->label(tasprintf("%s%s",text(),strchr(l, '\t'))); + } + } + + above=true; + } + + // Hide editbox + if (above || ( event==KEY && event_key()==EscapeKey ) ) { + this->hide(); + return 1; + } + Input::handle(event); +} + + +// We override hide method to ensure certain things done +void EditBox::hide() { + Input::hide(); + // Remove box so it doesn't get in the way + this->x(0); + this->y(0); + this->w(0); + this->h(0); + // Return the browser item into "visible" state + if (editing_) { + editing_->textcolor(textcolor()); + editing_->redraw(); + parent()->take_focus(); + } +} + + + +// Column widths and titles +// TODO: make more configurable + +const char *labels[] = {_("Name"),_("Type"),_("Size"),_("Date"),0}; +int widths[] = {200, 150, 100, 150, 0}; + + +// +// 'FileBrowser::FileBrowser()' - Create a FileBrowser widget. +// + + +FileBrowser::FileBrowser(int X, // I - Upper-lefthand X coordinate + int Y, // I - Upper-lefthand Y coordinate + int W, // I - Width in pixels + int H, // I - Height in pixels + const char *l) // I - Label text + : Browser(X, Y, W, H, l) { + // Initialize the filter pattern, current directory, and icon size... + pattern_ = "*"; + directory_ = ""; + //icon_size_ = 12.0f; + filetype_ = BOTH; + show_hidden_ = false; + show_dotdot_ = true; + column_labels(labels); + column_widths(widths); + + // Editbox + editbox_ = new EditBox (0, 0, 0, 0); + editbox_->box(BORDER_FRAME); + editbox_->parent(this); + editbox_->hide(); +} + + +// +// 'FileBrowser::load()' - Load a directory into the browser. +// + +int // O - Number of files loaded +FileBrowser::load(const char *directory,// I - Directory to load + File_Sort_F *sort) // I - Sort function to use +{ + int i; // Looping var + int num_files; // Number of files in directory + int num_dirs; // Number of directories in list + char filename[PATH_MAX]; // Current file + //FileIcon *icon; // Icon to use + + +// printf("FileBrowser::load(\"%s\")\n", directory); + + if (!directory) + return (0); + + clear(); + directory_ = directory; + + if (directory_[0] == '\0') + { + // + // No directory specified; for UNIX list all mount points. For DOS + // list all valid drive letters... + // + + // TODO! + fprintf (stderr, "Drive list not implemented yet"); + return 0; + } + + // Scan directory and store list in **files + dirent **files; + num_files = fltk::filename_list(directory_, &files, sort); + if (num_files <= 0) return (0); + + // Allocate array for icons + Item** icon_array = (Item**) malloc (sizeof(Item*) * num_files + 1); + // fill array with zeros, for easier detection if item exists + for (i=0; iuser_data(strdup(filename)); + } + + // Main loop for populating browser + for (i = 0; i < num_files; i ++) { + if (strcmp(files[i]->d_name, "./")==0) + continue; + + char *n = files[i]->d_name; // shorter + + snprintf(filename, PATH_MAX, "%s%s", directory_, n); + + if (strcmp(n, ".")==0 || strcmp(n, "./")==0 || (!show_hidden_ && (n[0]=='.' || n[strlen(n)-1]=='~') ) ) + continue; + fltk::check(); //update interface + + // Add directory + if (filetype_ != FILES && fltk::filename_isdir(filename)) { + num_dirs ++; + + // strip slash from filename + char *fn = strdup(n); + if (fn[strlen(fn)-1] == '/') + fn[strlen(fn)-1] = '\0'; + + Item* o = new Item ( Icon::get ( FOLDER_ICON,Icon::TINY ), fn); + Menu::insert(*o, num_dirs-1); + o->user_data(strdup(filename)); // we keep full path for callback + icon_array[i]=o; + + // Add file + } else if (filetype_ != DIRECTORIES && fltk::filename_match(n, pattern_)) { + Item* o = new Item(Icon::get(DEFAULT_ICON,Icon::TINY), strdup(n)); + Menu::add(*o); + o->user_data(strdup(filename)); // we keep full path for callback + icon_array[i]=o; + } + } // end for + + this->redraw(); + + // + // Detect icon mimetypes etc. + // + + MimeType *m = new MimeType(); + + for (i=0; id_name); + m->set(filename); + + // change label to complete data in various tabs + char *label; + if (strncmp(m->id(),"directory",9)==0) { + // Strip slash from filename + char *n = strdup(files[i]->d_name); + n[strlen(n)-1] = '\0'; + asprintf(&label, "%s\t%s\t\t%s", n, m->type_string(), nice_time(filename_mtime(filename))); + free(n); + } else + asprintf(&label, "%s\t%s\t%s\t%s", files[i]->d_name, m->type_string(), nice_size(filename_size(filename)), nice_time(filename_mtime(filename))); + icon_array[i]->label(label); + + // icon + icon_array[i]->image(m->icon(Icon::TINY)); + + icon_array[i]->redraw(); + free(files[i]); + } + delete m; + free(files); + + return (num_files); +} + + +// +// 'FileBrowser::filter()' - Set the filename filter. +// +// I - Pattern string +void FileBrowser::filter(const char *pattern) { + // If pattern is NULL set the pattern to "*"... + if (pattern) pattern_ = pattern; + else pattern_ = "*"; +} + + + +// We override the fltk standard event handling to detect when +// user is clicking on already selected item and show filename editbox + +int FileBrowser::handle(int event) { + const int iconspace=20; + + // Handle all events in editbox + if (editbox_->visible()) { + if (event == PUSH && !event_inside(Rectangle(editbox_->x(), editbox_->y(), editbox_->w(), editbox_->h()))) + editbox_->hide(); + else + return editbox_->handle(event); + } + + if (event==PUSH && !event_clicks() && + // Don't accept clicks outside first column: + event_x()child(i)->y() && + // Handle last child + (i==children()-1 || event_y()y()) && + child(i)->flags()&SELECTED && + // Make sure only one item is selected: + child(i)==item() && + // Can't rename "up directory" + strcmp(child(i)->label(),"../") != 0) { + // "hide" item + editbox_->textcolor(child(i)->textcolor()); + child(i)->textcolor(child(i)->color()); + child(i)->throw_focus(); + + // deselect all + set_item_selected(false); + //deselect(); + + // Show editbox at item coordinates + editbox_->x(this->x()+child(i)->x()+iconspace); + editbox_->y(child(i)->y()); + editbox_->w(150); + editbox_->h(20); + editbox_->show(); + + // Copy last part of path to editbox + char*p = strdup((char*)child(i)->user_data()); + if (p[strlen(p)-1] == '/') p[strlen(p)-1]='\0'; + char*q = strrchr(p,'/'); + if (q!=0) + editbox_->text(q+1); + else + editbox_->text(p); + free(p); + /*char*p = strdup((char*)this->user_data()); + editbox_->text(filename_name(p));*/ + + editbox_->take_focus(); + editbox_->editing(child(i)); + return 0; + } + return Browser::handle(event); +} + + +// +// End of "$Id$". +// diff --git a/efiler/EDE_FileBrowser.h b/efiler/EDE_FileBrowser.h new file mode 100644 index 0000000..4cf0665 --- /dev/null +++ b/efiler/EDE_FileBrowser.h @@ -0,0 +1,146 @@ +// +// "$Id$" +// +// FileBrowser definitions. +// +// Copyright 1999-2006 by Michael Sweet. +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Library General Public +// License as published by the Free Software Foundation; either +// version 2 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 +// Library General Public License for more details. +// +// You should have received a copy of the GNU Library General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 +// USA. +// +// Please report all bugs and problems on the following page: +// +// http://www.fltk.org/str.php +// + +// +// Include necessary header files... +// + +#ifndef edelib_FileBrowser_h +#define edelib_FileBrowser_h + +#include +#include +#include + +//namespace fltk { + + +// Class for the little input box used when we edit an item + +// FIXME: Why can this box be resized???? +// TODO: When editbox appears, select filename part and leave extension not-selected +// (as in Konqueror) + +class EditBox : public fltk::Input { + fltk::Widget* editing_; +public: + EditBox(int x, int y, int w, int h, const char* label = 0) : fltk::Input(x,y,w,h,label) , editing_(0) {} + void editing(fltk::Widget*w) { editing_=w; } + int handle (int event); + void hide(); +}; + + +/*! \class edelib::FileBrowser + +This class can be used as a drop-in replacement for fltk::FileBrowser because +it has much of the same API. In addition, it has the following features: + - uses edelib::MimeType and edelib::Icon to display file icons + - multicolumn view with columns: file name, type, size, date of last +modification and file permissions + - sorting by each column, by clicking on column headers or programmatically + - renaming files by clicking on a already selected file + - drag&drop support + - several other properties for fine tuning of display. + +By convention, real filename with full path of each item is stored in its +user_data() so you can easily access it from item callback or using the +const char* system_path(int index) method. + +Events that take place on double clicking, dropping files, popup menu etc. +should be implemented in callback, which enables you to create read-write +or read-only widgets as desired (e.g. in file chooser). + +*/ + +// +// FileBrowser class... +// + +class FileBrowser : public fltk::Browser +{ + int filetype_; + const char *directory_; + //float icon_size_; + const char *pattern_; + EditBox *editbox_; + + bool show_dotdot_; + +public: + enum { FILES, DIRECTORIES, BOTH }; + + FileBrowser(int, int, int, int, const char * = 0); + + /*float icon_size() const { + return (icon_size_ <0? (2.0f* textsize()) : icon_size_); + } + void icon_size(float f) { icon_size_ = f; redraw(); };*/ + + void filter(const char *pattern); + const char *filter() const { return (pattern_); }; + + int load(const char *directory, fltk::File_Sort_F *sort = (fltk::File_Sort_F*) fltk::casenumericsort); + +/* float textsize() const { return (fltk::Browser::textsize()); }; + void textsize(float s) { fltk::Browser::textsize(s); icon_size_ = (uchar)(3 * s / 2); };*/ + + int filetype() const { return (filetype_); }; + void filetype(int t) { filetype_ = t; }; + const char * directory() const {return directory_;} + + void show_up_directory(bool t) { show_dotdot_ = t; } + + // adding or inserting a line into the fileBrowser + //void insert(int n, const char* label, fltk::FileIcon* icon); + //void insert(int n, const char* label, void* data){fltk::Menu::insert(n, label,data);} + //void add(const char * line, fltk::FileIcon* icon); + + // Return full system path to given item + const char* system_path(int i) const { return (const char*)child(i)->user_data(); } + + // We override handle for displaying editbox + int handle(int); + // Showing or not showing the hidden files, that's the question: +public: + // sets this flag if you want to see the hidden files in the browser + void show_hidden(bool show) { show_hidden_= show; } + bool show_hidden() const {return show_hidden_;} +private: + bool show_hidden_; + + static void editbox_cb(Widget*,void*); + int editing; +}; + +//} + +#endif // !_Fl_File_Browser_H_ + +// +// End of "$Id$". +// diff --git a/efiler/Makefile b/efiler/Makefile new file mode 100644 index 0000000..0c29013 --- /dev/null +++ b/efiler/Makefile @@ -0,0 +1,17 @@ + +CPPFILES = efiler.cpp EDE_FileBrowser.cpp EDE_DirTree.cpp ../edelib2/MimeType.cpp ../edelib2/Run.cpp ../edelib2/process.cpp ../edelib2/pty.cpp ../edelib2/Config.cpp ../edelib2/Icon.cpp ../edelib2/Util.cpp ../edelib2/about_dialog.cpp +TARGET = efiler + +include ../makeinclude + +install: + $(INSTALL_PROGRAM) $(TARGET) $(bindir) + $(INSTALL_LOCALE) + +uninstall: + $(RM) $(bindir)/$(TARGET) + +clean: + $(RM) $(TARGET) + $(RM) *.o + diff --git a/efiler/efiler.cpp b/efiler/efiler.cpp new file mode 100644 index 0000000..48faf5b --- /dev/null +++ b/efiler/efiler.cpp @@ -0,0 +1,954 @@ +/* + * $Id$ + * + * EFiler - EDE File Manager + * Part of Equinox Desktop Environment (EDE). + * Copyright (c) 2000-2006 EDE Authors. + * + * This program is licenced under terms of the + * GNU General Public Licence version 2 or newer. + * See COPYING for details. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +//#include +#include +#include + +#include "../edelib2/about_dialog.h" +#include "../edelib2/Icon.h" +#include "../edelib2/MimeType.h" +#include "../edelib2/NLS.h" +#include "../edelib2/Run.h" +#include "../edelib2/Util.h" + +#include "EDE_FileBrowser.h" +#include "EDE_DirTree.h" + + +#define DEFAULT_ICON "misc-vedran" + + +using namespace fltk; +using namespace edelib; + + + +Window *win; +TiledGroup* tile; +ScrollGroup* sgroup; +FileBrowser* fbrowser; +DirTree* dirtree; +char current_dir[PATH_MAX]; +static bool semaphore=false; +bool showhidden = false; +bool showtree = false; + +char **cut_copy_buffer = 0; +bool operation_is_copy = false; + + + + +/*----------------------------------------------------------------- + Icon View implementation + +NOTE: This will eventually be moved into a separate class. We know +there are ugly/unfinished stuff here, but please be patient. +-------------------------------------------------------------------*/ + + +// Prototype (loaddir is called from button_press and vice versa +void loaddir(const char* path); + +// Callback for icons in icon view +void button_press(Widget* w, void*) { + if (event_clicks() || event_key() == ReturnKey) { + if (!w->user_data() || (strlen((char*)w->user_data())==0)) + alert(_("Unknown file type")); + else if (strncmp((char*)w->user_data(),"efiler ",7)==0) { + // don't launch new efiler instance + char tmp[PATH_MAX]; + strncpy(tmp,(char*)w->user_data()+7,PATH_MAX); + + // remove quotes + if (tmp[0] == '\'' || tmp[0] == '"') + memmove(tmp,tmp+1,strlen(tmp)-1); + int i=strlen(tmp)-2; + if (tmp[i] == '\'' || tmp[i] == '"') + tmp[i] = '\0'; + + loaddir(tmp); + } else { + fprintf(stderr, "Running: %s\n", (char*)w->user_data()); + run_program((char*)w->user_data(),false,false,true); + } + } + if (event_is_click()) w->take_focus(); + fprintf (stderr, "Event: %s (%d)\n",event_name(event()), event()); +} + + +// This function populates the icon view +// For convinience, it is now also called from other parts of code +// and also calls FileBrowser->load(path) which does the same +// thing for listview if neccessary + +void loaddir(const char *path) { + // If user clicks too fast, it can cause problems + if (semaphore) { + return; + } + semaphore=true; + + // Set current_dir + if (filename_isdir(path)) { + if (path[0] == '~') // Expand tilde + snprintf(current_dir,PATH_MAX,"%s/%s",getenv("HOME"),path+1); + else + strcpy(current_dir,path); + } else + strcpy(current_dir,getenv("HOME")); + // Trailing slash should always be there + if (current_dir[strlen(current_dir)-1] != '/') strcat(current_dir,"/"); +fprintf (stderr, "loaddir(%s) = (%s)\n",path,current_dir); + + // Update directory tree + dirtree->set_current(current_dir); + + // set window label + win->label(tasprintf(_("%s - File manager"), current_dir)); + + // Update file browser... + if (fbrowser->visible()) { fbrowser->load(current_dir); semaphore=false; return; } + + // some constants - TODO: move to configuration + int startx=0, starty=0; + int sizex=90, sizey=58; + int spacex=5, spacey=5; + + // variables used later + Button **icon_array; + int icon_num=0; + dirent **files; + + // Clean up window + sgroup->remove_all(); + sgroup->begin(); + + // List all files in directory + icon_num = fltk::filename_list(current_dir, &files, alphasort); // no sort needed because icons have coordinates + icon_array = (Button**) malloc (sizeof(Button*) * icon_num + 1); + // fill array with zeros, for easier detection if button exists + for (int i=0; id_name; //shortcut + + // don't show ./ (current directory) + if (strcmp(n,"./")==0) continue; + + // hide files with dot except ../ (up directory) + if (!showhidden && (n[0] == '.') && (strcmp(n,"../")!=0)) continue; + + // hide files ending with tilde (backup) - NOTE + if (!showhidden && (n[strlen(n)-1] == '~')) continue; + + Button* o = new Button(myx, myy, sizex, sizey); + o->box(NO_BOX); + //o->labeltype(SHADOW_LABEL); + o->labelcolor(BLACK); + o->callback((Callback*)button_press); + o->align(ALIGN_INSIDE|ALIGN_CENTER|ALIGN_WRAP); + //o->when(WHEN_CHANGED|WHEN_ENTER_KEY); + + o->label(n); + o->image(Icon::get(DEFAULT_ICON,Icon::SMALL)); + + myx=myx+sizex+spacex; + // 4 - edges + if (myx+sizex > sgroup->w()) { myx=startx; myy=myy+sizey+spacey; } + + icon_array[i] = o; + } + sgroup->end(); + // Give first icon the focus + sgroup->child(0)->take_focus(); + + sgroup->redraw(); + + // Init mimetypes + MimeType *m = new MimeType; + + // Detect icon mimetypes etc. + for (int i=0; id_name); + m->set(fullpath); + +fprintf(stderr,"Adding: %s (%s), cmd: '%s'\n", fullpath, m->id(), m->command()); + + // tooltip + char *tooltip; + if (strcmp(m->id(),"directory")==0) + asprintf(&tooltip, "%s - %s", files[i]->d_name, m->type_string()); + else + asprintf(&tooltip, "%s (%s) - %s", files[i]->d_name, nice_size(filename_size(fullpath)), m->type_string()); + icon_array[i]->tooltip(tooltip); + + // icon + icon_array[i]->image(m->icon(Icon::SMALL)); + + // get command to execute + if (strcmp(files[i]->d_name,"../")==0) { + // up directory - we don't want ../ poluting filename + char exec[PATH_MAX]; + int slashes=0, j; + for (j=strlen(current_dir); j>0; j--) { + if (current_dir[j]=='/') slashes++; + if (slashes==2) break; + } + if (slashes<2) + sprintf(exec,"efiler /"); + else { + sprintf(exec,"efiler "); + strncat(exec,current_dir,j); + } + icon_array[i]->user_data(strdup(exec)); + + } else if (m->command() && (strlen(m->command())>0)) + icon_array[i]->user_data(strdup(m->command())); + else + icon_array[i]->user_data(0); + + // make sure label isn't too large + // TODO: move this to draw() method + int lx,ly; + icon_array[i]->measure_label(lx,ly); + int pos=strlen(icon_array[i]->label()); + if (pos>252) pos=252; + char fixlabel[256]; + while (lx>sizex) { + strncpy(fixlabel,icon_array[i]->label(),pos); + fixlabel[pos]='\0'; + strcat(fixlabel,"..."); + icon_array[i]->label(strdup(fixlabel)); + icon_array[i]->measure_label(lx,ly); + pos--; + } + icon_array[i]->redraw(); + } + // MimeType destructor + delete m; + + sgroup->redraw(); + semaphore=false; +} + + +/*----------------------------------------------------------------- + Directory tree + + (only callback, since most of the real work is done in class) +-------------------------------------------------------------------*/ + +void dirtree_cb(Widget* w, void*) { + if (!event_clicks() && event_key() != ReturnKey) return; + char *d = (char*) dirtree->item()->user_data(); + if (d && strlen(d)>0) loaddir(d); +} + + +/*----------------------------------------------------------------- + List view + + (only callback, since most of the real work is done in class) +-------------------------------------------------------------------*/ + +void fbrowser_cb(Widget* w, void*) { + // Take only proper callbacks + if (!event_clicks() && event_key() != ReturnKey) return; + + // Construct filename + const char *c = fbrowser->system_path(fbrowser->value()); + char filename[PATH_MAX]; + if (strncmp(c+strlen(c)-3,"../",3)==0) { + // User clicked on "..", we go up + strcpy(filename,current_dir); // both are [PATH_MAX] + filename[strlen(filename)-1] = '\0'; // remove trailing slash in a directory + char *c2 = strrchr(filename,'/'); // find previous slash + if (c2) *(c2+1) = '\0'; // cut everything after this slash + else strcpy(filename,"/"); // if nothing is found, filename becomes "/" + } else { + strncpy(filename,c,PATH_MAX); + } + + // Change directory + if (filename_isdir(filename)) + loaddir(filename); + + // Let elauncher handle this file... + else + run_program(tsprintf("file:%s",filename),false,false,true); +} + + + +/*----------------------------------------------------------------- + File moving and copying operations +-------------------------------------------------------------------*/ + +ProgressBar* cut_copy_progress; +bool stop_now; +bool overwrite_all, skip_all; + +// Execute cut or copy operation when List View is active +void do_cut_copy_fbrowser(bool m_copy) { + // Count selected icons, for malloc + int num = fbrowser->children(); + int nselected = 0; + for (int i=0; iselected(i)) nselected++; + + // Clear cut/copy buffer and optionally ungray the previously cutted icons + if (cut_copy_buffer) { + for (int i=0; cut_copy_buffer[i]; i++) + free(cut_copy_buffer[i]); + free(cut_copy_buffer); + if (!operation_is_copy) { + for (int i=0; ichild(i)->textcolor(BLACK); // FIXME: use color from style + } + } + + // Allocate buffer + cut_copy_buffer = (char**)malloc(sizeof(char*) * (nselected+2)); + + // Add selected files to buffer and optionally grey icons (for cut effect) + int buf=0; + for (int i=0; i<=num; i++) { + if (fbrowser->selected(i)) { + cut_copy_buffer[buf] = strdup(fbrowser->system_path(i)); + if (!m_copy) fbrowser->child(i)->textcolor(GRAY50); + buf++; + } + } + cut_copy_buffer[buf] = 0; + operation_is_copy = m_copy; + + // Deselect all + fbrowser->deselect(); +} + +// Execute cut or copy operation when Icon View is active + +// (this one will become obsolete when IconBrowser class gets the same API +// as FileBrowser) + +void do_cut_copy_sgroup(bool m_copy) { + + // Group doesn't support type(MULTI) so only one item can be selected + + int num = fbrowser->children(); + + // Clear cut/copy buffer and optionally ungray the previously cutted icon + if (cut_copy_buffer) { + for (int i=0; cut_copy_buffer[i]; i++) + free(cut_copy_buffer[i]); + free(cut_copy_buffer); + if (!operation_is_copy) { + for (int i=0; ichild(i)->textcolor(BLACK); // FIXME: use color from style + } + } + + // Allocate buffer + cut_copy_buffer = (char**)malloc(sizeof(char*) * 3); + + // Add selected files to buffer and optionally grey icons (for cut effect) + // FIXME: label doesn't contain filename!! + asprintf(&cut_copy_buffer[0], "%s%s", current_dir, sgroup->child(sgroup->focus_index())->label()); + if (!m_copy) sgroup->child(sgroup->focus_index())->textcolor(GRAY50); + cut_copy_buffer[1]=0; + operation_is_copy=m_copy; +} + + +// Helper functions for paste: + +// Tests if two files are on the same filesystem +bool is_on_same_fs(const char* file1, const char* file2) { + FILE *mtab; // /etc/mtab or /etc/mnttab file + static char filesystems[50][PATH_MAX]; + static int fs_number=0; + + // On first access read filesystems + if (fs_number == 0) { + mtab = fopen("/etc/mnttab", "r"); // Fairly standard + if (mtab == NULL) + mtab = fopen("/etc/mtab", "r"); // More standard + if (mtab == NULL) + mtab = fopen("/etc/fstab", "r"); // Otherwise fallback to full list + if (mtab == NULL) + mtab = fopen("/etc/vfstab", "r"); // Alternate full list file + + char line[PATH_MAX]; // Input line + char device[PATH_MAX], mountpoint[PATH_MAX], fs[PATH_MAX]; + while (mtab!= NULL && fgets(line, sizeof(line), mtab) != NULL) { + if (line[0] == '#' || line[0] == '\n') + continue; + if (sscanf(line, "%s%s%s", device, mountpoint, fs) != 3) + continue; + strcpy(filesystems[fs_number],mountpoint); + fs_number++; + } + fclose (mtab); + + if (fs_number == 0) return false; // some kind of error + } + + // Find filesystem for file1 (largest mount point match) + char *max; + int maxlen = 0; + for (int i=0; imaxlen)) { + maxlen=mylen; + max = filesystems[i]; + } + } + if (maxlen == 0) return false; // some kind of error + + // See if file2 matches the same filesystem + return (strncmp(file2,max,maxlen)==0); +} + + +// Copy single file. Returns true if operation should continue +bool my_copy(const char* src, const char* dest) { + FILE *fold, *fnew; + int c; + + if (strcmp(src,dest)==0) + // this shouldn't happen + return true; + + if (filename_exist(dest)) { + // if both src and dest are directories, do nothing + if (filename_isdir(src) && filename_isdir(dest)) + return true; + + int c = -1; + if (!overwrite_all && !skip_all) { + c = choice_alert(tsprintf(_("File already exists: %s. What to do?"), dest), _("&Overwrite"), _("Over&write all"), _("*&Skip"), _("Skip &all"), 0); // asterisk (*) means default + } + if (c==1) overwrite_all=true; + if (c==3) skip_all=true; + if (c==2 || skip_all) { + return true; + } + // At this point either c==0 (overwrite) or overwrite_all == true + + // copy directory over file + if (filename_isdir(src)) + unlink(dest); + + // copy file over directory + // TODO: we will just skip this case, but ideally there should be + // another warning + if (filename_isdir(dest)) + return true; + } + + if (filename_isdir(src)) { + if (mkdir (dest, umask(0))==0) + return true; // success + int q = choice_alert(tsprintf(_("Cannot create directory %s"),dest), _("*&Continue"), _("&Stop"), 0); + if (q == 0) return true; else return false; + } + + if ( ( fold = fopen( src, "rb" ) ) == NULL ) { + int q = choice_alert(tsprintf(_("Cannot read file %s"),src), _("*&Continue"), _("&Stop"), 0); + if (q == 0) return true; else return false; + } + + if ( ( fnew = fopen( dest, "wb" ) ) == NULL ) + { + fclose ( fold ); + int q = choice_alert(tsprintf(_("Cannot create file %s"),dest), _("*&Continue"), _("&Stop"), 0); + if (q == 0) return true; else return false; + } + + while (!feof(fold)) { + c = fgetc(fold); + fputc(c, fnew); + } + // TODO: Add more error handling using ferror() + fclose(fold); + fclose(fnew); + return true; +} + + +// Recursive function that creates a list of all files to be +// copied, expanding directories etc. The total number of elements +// will be stored in listsize. Returns false if user decided to +// interrupt copying. +bool create_list(const char* src, char** &list, int &list_size, int &list_capacity) { + // Grow list if neccessary + if (list_size >= list_capacity-1) { + list_capacity += 1000; + list = (char**)realloc(list, sizeof(char**)*list_capacity); + } + + // We add both files and diretories to list + list[list_size++] = strdup(src); + + if (filename_isdir(src)) { + char new_src[PATH_MAX]; + dirent **files; + // FIXME: use same sort as currently used + // FIXME: detect errors on accessing folder + int num_files = fltk::filename_list(src, &files, casenumericsort); + for (int i=0; id_name,"./")==0 || strcmp(files[i]->d_name,"../")==0) continue; + snprintf(new_src, PATH_MAX, "%s%s", src, files[i]->d_name); + fltk::check(); // update gui + if (stop_now || !create_list(new_src, list, list_size, list_capacity)) + return false; + } + } + return true; +} + + +// Callback for Stop button on progress window +void stop_copying_cb(Widget*,void* v) { + stop_now=true; + // Let's inform user that we're stopping... + InvisibleBox* caption = (InvisibleBox*)v; + caption->label(_("Stopping...")); + caption->redraw(); + caption->parent()->redraw(); +} + +// Execute paste operation - this will copy or move files based on last +// operation +void do_paste() { + + if (!cut_copy_buffer || !cut_copy_buffer[0]) return; + + overwrite_all=false; skip_all=false; + + // Moving files on same filesystem is trivial + // We don't even need a progress bar + if (!operation_is_copy && is_on_same_fs(current_dir, cut_copy_buffer[0])) { + for (int i=0; cut_copy_buffer[i]; i++) { + char *newname; + asprintf(&newname, "%s%s", current_dir, filename_name(cut_copy_buffer[i])); + if (filename_exist(newname)) { + int c = -1; + if (!overwrite_all && !skip_all) { + c = choice_alert(tsprintf(_("File already exists: %s. What to do?"), newname), _("&Overwrite"), _("Over&write all"), _("*&Skip"), _("Skip &all")); // * means default + } + if (c==1) overwrite_all=true; + if (c==3) skip_all=true; + if (c==2 || skip_all) { + free(cut_copy_buffer[i]); + continue; // go to next entry + } + // At this point c==0 (Overwrite) or overwrite_all == true + unlink(newname); + } + rename(cut_copy_buffer[i],newname); + free(cut_copy_buffer[i]); + } + free(cut_copy_buffer); + cut_copy_buffer=0; + loaddir(current_dir); // Update display + return; + + // + // Real file moving / copying using recursive algorithm + // + + } else { + stop_now = false; + + // Create srcdir string + char *srcdir = strdup(cut_copy_buffer[0]); + char *p = strrchr(srcdir,'/'); + if (*(p+1) == '\0') { // slash is last - find one before + *p = '\0'; + p = strrchr(srcdir,'/'); + } + *(p+1) = '\0'; + + if (strcmp(srcdir,current_dir)==0) { + alert(_("You cannot copy a file onto itself!")); + return; + } + + // Draw progress dialog + Window* progress_window = new Window(350,150); + if (operation_is_copy) + progress_window->label(_("Copying files")); + else + progress_window->label(_("Moving files")); + progress_window->set_modal(); + progress_window->begin(); + InvisibleBox* caption = new InvisibleBox(20,20,310,25, _("Counting files in directories")); + caption->align(ALIGN_LEFT|ALIGN_INSIDE); + cut_copy_progress = new ProgressBar(20,60,310,20); + Button* stop_button = new Button(145,100,60,40, _("&Stop")); + stop_button->callback(stop_copying_cb,caption); + progress_window->end(); + progress_window->show(); + + // How many items do we copy? + int copy_items=0; + for (; cut_copy_buffer[copy_items]; copy_items++); + // Set ProgressBar range accordingly + cut_copy_progress->range(0,copy_items,1); + cut_copy_progress->position(0); + + // Count files in directories + int list_size = 0, list_capacity = 1000; + char** files_list = (char**)malloc(sizeof(char**)*list_capacity); + for (int i=0; iposition(i+1); + fltk::check(); // check to see if user pressed Stop + } + free (cut_copy_buffer); + cut_copy_buffer=0; + + // Now copying those files + if (!stop_now) { + char label[150]; + char dest[PATH_MAX]; + cut_copy_progress->range(0, list_size, 1); + cut_copy_progress->position(0); + + for (int i=0; ilabel(label); + caption->redraw(); + if (stop_now || !my_copy(files_list[i], dest)) + break; + cut_copy_progress->position(cut_copy_progress->position()+1); + fltk::check(); // check to see if user pressed Stop + } + } + progress_window->hide(); + + // Deallocate files_list[][] + for (int i=0; ivisible()) + w = sgroup->child(sgroup->focus_index()); + else + w = fbrowser; + event_clicks(2); + w->do_callback(); +} +void location_cb(Widget*, void*) { + const char *dir = dir_chooser(_("Choose location"),current_dir); + if (dir) loaddir(dir); +} +void quit_cb(Widget*, void*) {exit(0);} + + +// Edit menu callbacks + +void cut_cb(Widget*, void*) { + if (sgroup->visible()) + do_cut_copy_sgroup(false); + else + do_cut_copy_fbrowser(false); +} + +void copy_cb(Widget*, void*) { + if (sgroup->visible()) + do_cut_copy_sgroup(true); + else + do_cut_copy_fbrowser(true); +} + +void paste_cb(Widget*, void*) { + do_paste(); +} + + +// View menu + +void switchview() { + if (sgroup->visible()) { + sgroup->hide(); + fbrowser->show(); + fbrowser->take_focus(); + } else { + sgroup->show(); + fbrowser->hide(); + sgroup->take_focus(); + } + // We update the inactive view only when it's shown i.e. now + loaddir(current_dir); +} + +void iconsview_cb(Widget*,void*) { + // When user presses F8 we switch view regardles of which is visible + // However, when menu option is chosen we only switch *to* iconview + if (fbrowser->visible() || event_key() == F8Key) switchview(); +} +void listview_cb(Widget*,void*) { if (sgroup->visible()) switchview(); } + +void showhidden_cb(Widget* w, void*) { + // Presently, fbrowser has show_hidden() method while icon view + // respects value of showhidden global variable + + Item *i = (Item*)w; + if (showhidden) { + showhidden=false; + i->clear(); + } else { + showhidden=true; + i->set(); + } + if (fbrowser->visible()) fbrowser->show_hidden(showhidden); + // Reload current view + loaddir(current_dir); +} + +void showtree_cb(Widget*,void*) { + if (!showtree) { + tile->position(1,0,150,0); + showtree=true; + } else { + tile->position(150,0,0,0); + showtree=false; + } +} +void refresh_cb(Widget*,void*) { + loaddir(current_dir); + // TODO: reload directory tree as well- +} +void case_cb(Widget*,void*) { + fprintf(stderr,"Not implemented yet...\n"); +} + + +// Help menu + +void about_cb(Widget*, void*) { about_dialog("EFiler", "0.1", _("EDE File Manager"));} + + + +/*----------------------------------------------------------------- + GUI design +-------------------------------------------------------------------*/ + + +int main (int argc, char **argv) { + win = new fltk::Window(600, 400); + win->color(WHITE); + win->begin(); + + // Main menu + {MenuBar *m = new MenuBar(0, 0, 600, 25); + m->begin(); + {ItemGroup *o = new ItemGroup(_("&File")); + o->begin(); + {Item *o = new Item(_("&Open")); + o->callback(open_cb); + o->shortcut(CTRL+'o'); + } + {Item *o = new Item(_("Open &with...")); + //o->callback(open_cb); + //o->shortcut(CTRL+'o'); + } + new Divider(); + {Item *o = new Item(_("Open &location")); + o->callback(location_cb); + //o->shortcut(CTRL+'o'); + } + new Divider(); + {Item *o = new Item(_("&Quit")); + o->callback(quit_cb); + o->shortcut(CTRL+'q'); + } + o->end(); + } + {ItemGroup *o = new ItemGroup(_("&Edit")); + o->begin(); + {Item *o = new Item(_("&Cut")); + o->callback(cut_cb); + o->shortcut(CTRL+'x'); + } + {Item *o = new Item(_("C&opy")); + o->callback(copy_cb); + o->shortcut(CTRL+'c'); + } + {Item *o = new Item(_("&Paste")); + o->callback(paste_cb); + o->shortcut(CTRL+'v'); + } + {Item *o = new Item(_("&Rename")); + //o->callback(open_cb); + o->shortcut(F2Key); + } + {Item *o = new Item(_("&Delete")); + //o->callback(open_cb); + o->shortcut(DeleteKey); + } + new Divider(); + {Item *o = new Item(_("&Preferences...")); + o->shortcut(CTRL+'p'); + } + o->end(); + } + {ItemGroup *o = new ItemGroup(_("&View")); + o->begin(); + {Item *o = new Item(_("&Icons")); + o->type(Item::RADIO); + o->shortcut(F8Key); + o->set(); + o->callback(iconsview_cb); + } + {Item *o = new Item(_("&Detailed List")); + o->type(Item::RADIO); + o->callback(listview_cb); + } + new Divider(); + {Item *o = new Item(_("&Show hidden")); + o->type(Item::TOGGLE); + o->callback(showhidden_cb); + } + {Item *o = new Item(_("Directory &Tree")); + o->type(Item::TOGGLE); + o->shortcut(F9Key); + o->callback(showtree_cb); + } + new Divider(); + {Item *o = new Item(_("&Refresh")); + //o->type(); + o->callback(refresh_cb); + o->shortcut(F5Key); + } + {ItemGroup *o = new ItemGroup(_("S&ort")); + o->begin(); + {Item *o = new Item(_("&Case sensitive")); + //o->type(); + o->callback(case_cb); + } + o->end(); + } + o->end(); + } + {ItemGroup *o = new ItemGroup(_("&Help")); + o->begin(); + {Item *o = new Item(_("&About File Manager")); + o->shortcut(); + o->callback(about_cb); + } + o->end(); + } + m->end(); + } + + // Main tiled group + {tile = new TiledGroup(0, 25, 600, 375); + tile->color(WHITE); + tile->begin(); + + // Directory tree + {dirtree = new DirTree(0, 0, 150, 375); + dirtree->box(DOWN_BOX); + dirtree->color(WHITE); + dirtree->load(); + dirtree->callback(dirtree_cb); + dirtree->when(WHEN_CHANGED|WHEN_ENTER_KEY); + } + + // Icon view + {sgroup = new ScrollGroup(150, 0, 450, 375); + sgroup->box(DOWN_BOX); + sgroup->color(WHITE); + // sgroup->highlight_color(WHITE); + // sgroup->selection_color(WHITE); + sgroup->align(ALIGN_LEFT|ALIGN_TOP); + // g->label("There are no files in current directory"); + } + + // List view + {fbrowser = new FileBrowser(150, 0, 450, 375); + fbrowser->box(DOWN_BOX); + fbrowser->color(WHITE); + fbrowser->callback(fbrowser_cb); + // sgroup->align(ALIGN_LEFT|ALIGN_TOP); + // g->label("There are no files in current directory"); + fbrowser->when(WHEN_ENTER_KEY); + //fbrowser->labelsize(12); + fbrowser->type(Browser::MULTI); + fbrowser->hide(); + } + tile->end(); + } + + // We hide dirtree and browser expands to fill space + tile->position(150,0,1,0); + + win->end(); + win->resizable(tile); + win->icon(Icon::get("folder",Icon::TINY)); + win->show(); + + if (argc==1) { // No params + loaddir (""); + } else { + loaddir (argv[1]); + } + + return fltk::run(); +} diff --git a/efinder/Jamfile b/efinder/Jamfile new file mode 100644 index 0000000..9798316 --- /dev/null +++ b/efinder/Jamfile @@ -0,0 +1,16 @@ +# +# $Id$ +# +# Part of Equinox Desktop Environment (EDE). +# Copyright (c) 2000-2007 EDE Authors. +# +# This program is licenced under terms of the +# GNU General Public Licence version 2 or newer. +# See COPYING for details. + +SubDir TOP efinder ; + +SOURCE = efinder.cpp eglob.cpp ; + +MakeEfltkProgram efinder : $(SOURCE) ; +ExtractStrings locale : $(SOURCE) ; diff --git a/efinder/Makefile b/efinder/Makefile new file mode 100644 index 0000000..2a31aea --- /dev/null +++ b/efinder/Makefile @@ -0,0 +1,21 @@ + +CPPFILES = efinder.cpp eglob.cpp +TARGET = efinder + +POFILES = locale/ru.po\ + locale/sk.po\ + locale/hu.po + +include ../makeinclude + +install: + $(INSTALL_PROGRAM) $(TARGET) $(bindir) + $(INSTALL_LOCALE) + +uninstall: + $(RM) $(bindir)/$(TARGET) + +clean: + $(RM) $(TARGET) + $(RM) *.o + diff --git a/efinder/efinder.cpp b/efinder/efinder.cpp new file mode 100644 index 0000000..c4231cc --- /dev/null +++ b/efinder/efinder.cpp @@ -0,0 +1,497 @@ +// generated by Extended Fast Light User Interface Designer (eFluid) version 2.0003 + +#include "efinder.h" +// Copyright (c) 2000. - 2005. EDE Authors +// This program is licenced under terms of the +// GNU General Public Licence version 2 or newer. +// See COPYING for details. +#include "eglob.h" +Fl_Window* permWindow; + +static void cb_Read(Fl_Check_Button*, void*) { + toggle_permission(S_IRUSR); +} + +static void cb_Write(Fl_Check_Button*, void*) { + toggle_permission(S_IWUSR); +} + +static void cb_Execute(Fl_Check_Button*, void*) { + toggle_permission(S_IXUSR); +} + +static void cb_Set(Fl_Check_Button*, void*) { + toggle_permission(S_ISUID); +} + +static void cb_Read1(Fl_Check_Button*, void*) { + toggle_permission(S_IRGRP); +} + +static void cb_Write1(Fl_Check_Button*, void*) { + toggle_permission(S_IWGRP); +} + +static void cb_Execute1(Fl_Check_Button*, void*) { + toggle_permission(S_IXGRP); +} + +static void cb_Set1(Fl_Check_Button*, void*) { + toggle_permission(S_ISGID); +} + +static void cb_Read2(Fl_Check_Button*, void*) { + toggle_permission(S_IROTH); +} + +static void cb_Write2(Fl_Check_Button*, void*) { + toggle_permission(S_IWOTH); +} + +static void cb_Execute2(Fl_Check_Button*, void*) { + toggle_permission(S_IXOTH); +} + +static void cb_Sticky(Fl_Check_Button*, void*) { + toggle_permission(S_ISVTX); +} + +static void cb_Close(Fl_Button*, void*) { + permWindow->hide(); +} + +void createPermWindow() { + Fl_Window* w; + {Fl_Window* o = permWindow = new Fl_Window(355, 175, _("Permissions")); + w = o; + o->shortcut(0xff1b); + {Fl_Group* o = new Fl_Group(10, 30, 110, 90, _("Owner")); + o->box(FL_ENGRAVED_BOX); + o->align(FL_ALIGN_TOP|FL_ALIGN_LEFT); + {Fl_Check_Button* o = new Fl_Check_Button(5, 5, 85, 25, _("Read")); + o->callback((Fl_Callback*)cb_Read); + } + {Fl_Check_Button* o = new Fl_Check_Button(5, 25, 85, 25, _("Write")); + o->callback((Fl_Callback*)cb_Write); + } + {Fl_Check_Button* o = new Fl_Check_Button(5, 45, 85, 25, _("Execute")); + o->callback((Fl_Callback*)cb_Execute); + } + {Fl_Check_Button* o = new Fl_Check_Button(5, 65, 85, 25, _("Set UID")); + o->callback((Fl_Callback*)cb_Set); + } + o->end(); + } + {Fl_Group* o = new Fl_Group(125, 30, 105, 90, _("Group")); + o->box(FL_ENGRAVED_BOX); + o->align(FL_ALIGN_TOP|FL_ALIGN_LEFT); + {Fl_Check_Button* o = new Fl_Check_Button(5, 5, 85, 25, _("Read")); + o->callback((Fl_Callback*)cb_Read1); + } + {Fl_Check_Button* o = new Fl_Check_Button(5, 25, 85, 25, _("Write")); + o->callback((Fl_Callback*)cb_Write1); + } + {Fl_Check_Button* o = new Fl_Check_Button(5, 45, 85, 25, _("Execute")); + o->callback((Fl_Callback*)cb_Execute1); + } + {Fl_Check_Button* o = new Fl_Check_Button(5, 65, 85, 25, _("Set GID")); + o->callback((Fl_Callback*)cb_Set1); + } + o->end(); + } + {Fl_Group* o = new Fl_Group(235, 30, 110, 90, _("Other")); + o->box(FL_ENGRAVED_BOX); + o->align(FL_ALIGN_TOP|FL_ALIGN_LEFT); + {Fl_Check_Button* o = new Fl_Check_Button(5, 5, 85, 25, _("Read")); + o->callback((Fl_Callback*)cb_Read2); + } + {Fl_Check_Button* o = new Fl_Check_Button(5, 25, 85, 25, _("Write")); + o->callback((Fl_Callback*)cb_Write2); + } + {Fl_Check_Button* o = new Fl_Check_Button(5, 45, 85, 25, _("Execute")); + o->callback((Fl_Callback*)cb_Execute2); + } + {Fl_Check_Button* o = new Fl_Check_Button(5, 65, 95, 25, _("Sticky")); + o->callback((Fl_Callback*)cb_Sticky); + } + o->end(); + } + {Fl_Button* o = new Fl_Button(140, 140, 85, 25, _("&Close")); + o->callback((Fl_Callback*)cb_Close); + } + o->end(); + o->resizable(o); + } + permWindow->end(); + permWindow->show(); +} +Fl_Window* findWindow; +Fl_Input* pathInput; + +static void cb_Browse(Fl_Button*, void*) { + const char *f = fl_select_dir(0, _("Select directory")); + if (f) { + pathInput->value(f); + } +;} +Fl_Input* filterInput; +Fl_Check_Button* recursiveCheck; +Fl_Value_Input* fileLimitValue; +Fl_Input* containsInput; +Fl_Check_Button* caseSensitiveCheck; +Fl_Check_Button* useRegexpCheck; +Fl_Input_Browser* fileTypeBrowser; +Fl_Check_Button* stayOnSingleCheck; +Fl_Check_Button* considerPermValue; + +static void cb_considerPermValue(Fl_Check_Button*, void*) { + if (considerPermValue->value()) + createPermWindow(); +} +Fl_Check_Button* considerUserValue; + +static void cb_considerUserValue(Fl_Check_Button*, void*) { + if (considerUserValue->value()) { + userGroup->activate(); + } + else { + userGroup->deactivate(); + } +;} +Fl_Group* userGroup; +Fl_Input_Browser* userIdChoice; +Fl_Input_Browser* groupIdChoice; +Fl_Check_Button* considerSizeValue; + +static void cb_considerSizeValue(Fl_Check_Button*, void*) { + if (considerSizeValue->value()) { + sizeGroup->activate(); + } + else { + sizeGroup->deactivate(); + } +;} +Fl_Group* sizeGroup; +Fl_Value_Input* sizeGValue; +Fl_Value_Input* sizeMValue; +Fl_Check_Button* considerTimeValue; + +static void cb_considerTimeValue(Fl_Check_Button*, void*) { + if (considerTimeValue->value()) { + timeGroup1->activate(); + timeValue->activate(); + timeGroup2->activate(); + } + else { + timeGroup1->deactivate(); + timeValue->deactivate(); + timeGroup2->deactivate(); + } +;} +Fl_Group* timeGroup1; +Fl_Round_Button* modifiedRadio; +Fl_Round_Button* changedRadio; +Fl_Round_Button* accessedRadio; +Fl_Value_Input* timeValue; +Fl_Group* timeGroup2; +Fl_Round_Button* minutesRadio; +Fl_Round_Button* hoursRadio; +Fl_Round_Button* daysRadio; +Fl_Round_Button* mounthsRadio; +Fl_Check_Button* doNotLookIntoBinaryCheck; +Fl_Check_Button* outputCountCheck; +Fl_Round_Button* matchAnywhereRadio; +Fl_Round_Button* matchWordsRadio; +Fl_Round_Button* matchLinesRadio; +Fl_Round_Button* invertMatchRadio; +Fl_ListView* searchList; +Fl_Box* statusLine; +Fl_Button* searchButton; + +static void cb_searchButton(Fl_Button*, void*) { + findCB(); +} + +static void cb_Cancel(Fl_Button*, void*) { + exit(0); +} +Fl_Button* stopButton; + +static void cb_stopButton(Fl_Button*, void*) { + stopSearch(); +} + +void createFindWindow() { + Fl_Window* w; + {Fl_Window* o = findWindow = new Fl_Window(480, 385, _("Find")); + w = o; + o->shortcut(0xff1b); + {Fl_Tabs* o = new Fl_Tabs(3, 5, 473, 235); + o->color((Fl_Color)0xfffffffe); + {Fl_Group* o = new Fl_Group(1, 23, 471, 211, _("Find")); + {Fl_Group* o = new Fl_Group(7, 20, 460, 100, _("Find")); + o->box(FL_ENGRAVED_BOX); + o->align(FL_ALIGN_TOP|FL_ALIGN_LEFT); + {Fl_Group* o = new Fl_Group(5, 5, 450, 30); + {Fl_Input* o = pathInput = new Fl_Input(70, 5, 285, 23, _("Path:")); + o->align(FL_ALIGN_LEFT|FL_ALIGN_WRAP); + o->parent()->resizable(o); + char *tmp = fl_get_homedir(); + o->value(tmp); + delete []tmp; + } + {Fl_Button* o = new Fl_Button(360, 5, 80, 23, _("&Browse...")); + o->callback((Fl_Callback*)cb_Browse); + o->tooltip(_("Find path.")); + } + o->end(); + } + {Fl_Input* o = filterInput = new Fl_Input(75, 40, 370, 23, _("File filter:")); + o->align(FL_ALIGN_LEFT|FL_ALIGN_WRAP); + o->value("*"); + o->parent()->resizable(o); + } + {Fl_Group* o = new Fl_Group(25, 65, 430, 32); + {Fl_Check_Button* o = recursiveCheck = new Fl_Check_Button(50, 0, 155, 30, _("Search subdirectories")); + o->value(1); + o->align(FL_ALIGN_LEFT|FL_ALIGN_INSIDE|FL_ALIGN_CLIP|FL_ALIGN_WRAP); + } + {Fl_Group* o = new Fl_Group(200, 0, 220, 32); + {Fl_Value_Input* o = fileLimitValue = new Fl_Value_Input(175, 5, 45, 20, _("Limit results to first n files:")); + o->step(1); + o->value(64); + o->align(FL_ALIGN_LEFT|FL_ALIGN_CLIP|FL_ALIGN_WRAP); + } + o->end(); + } + o->end(); + } + o->end(); + } + {Fl_Group* o = new Fl_Group(7, 140, 459, 65, _("Content")); + o->box(FL_ENGRAVED_BOX); + o->align(FL_ALIGN_TOP|FL_ALIGN_LEFT); + {Fl_Input* o = containsInput = new Fl_Input(75, 10, 370, 23, _("Containing:")); + o->align(FL_ALIGN_LEFT|FL_ALIGN_WRAP); + o->parent()->resizable(o); + } + {Fl_Group* o = new Fl_Group(75, 35, 370, 25); + {Fl_Check_Button* o = caseSensitiveCheck = new Fl_Check_Button(0, 0, 140, 25, _("Case sensitive")); + o->align(FL_ALIGN_LEFT|FL_ALIGN_INSIDE|FL_ALIGN_WRAP); + } + {Fl_Check_Button* o = useRegexpCheck = new Fl_Check_Button(140, 0, 230, 25, _("Extended regexp")); + o->align(FL_ALIGN_LEFT|FL_ALIGN_INSIDE|FL_ALIGN_WRAP); + } + o->end(); + } + o->end(); + } + {Fl_Box* o = new Fl_Box(7, 206, 455, 2); + o->parent()->resizable(o); + } + o->parent()->resizable(o); + o->end(); + } + {Fl_Group* o = new Fl_Group(1, 23, 471, 211, _("Filter options")); + o->hide(); + {Fl_Group* o = new Fl_Group(7, 20, 459, 32, _("Considerations")); + o->box(FL_ENGRAVED_BOX); + o->align(FL_ALIGN_TOP|FL_ALIGN_LEFT); + {Fl_Input_Browser* o = fileTypeBrowser = new Fl_Input_Browser(70, 5, 145, 23, _("File type:")); o->begin(); + o->align(FL_ALIGN_LEFT|FL_ALIGN_WRAP); + new Fl_Item(_("Any kind")); + new Fl_Item(_("Regular")); + new Fl_Item(_("Directory")); + new Fl_Item(_("Symlink")); + new Fl_Item(_("Socket")); + new Fl_Item(_("Block device")); + new Fl_Item(_("Character device")); + new Fl_Item(_("FIFO")); + o->parent()->resizable(o); + + o->value("Any kind"); + o->end(); + } + {Fl_Check_Button* o = stayOnSingleCheck = new Fl_Check_Button(225, 4, 230, 23, _("Stay on single filesystem")); + o->align(FL_ALIGN_LEFT|FL_ALIGN_INSIDE|FL_ALIGN_CLIP|FL_ALIGN_WRAP); + } + o->end(); + } + {Fl_Group* o = new Fl_Group(7, 50, 459, 155); + o->box(FL_ENGRAVED_BOX); + {Fl_Check_Button* o = considerPermValue = new Fl_Check_Button(5, 5, 115, 25, _("Permissions")); + o->callback((Fl_Callback*)cb_considerPermValue); + } + {Fl_Check_Button* o = considerUserValue = new Fl_Check_Button(5, 30, 115, 25, _("User/group:")); + o->callback((Fl_Callback*)cb_considerUserValue); + } + {Fl_Group* o = userGroup = new Fl_Group(120, 30, 325, 25); + o->deactivate(); + {Fl_Input_Browser* o = userIdChoice = new Fl_Input_Browser(70, 2, 72, 20, _("User id:")); o->begin(); + o->align(FL_ALIGN_LEFT|FL_ALIGN_WRAP); + o->value("Anyone"); + jam("/etc/passwd", userIdChoice); + o->end(); + } + {Fl_Input_Browser* o = groupIdChoice = new Fl_Input_Browser(240, 2, 72, 20, _("Group id:")); o->begin(); + o->align(FL_ALIGN_LEFT|FL_ALIGN_WRAP); + o->value("Anyone"); + jam("/etc/group", groupIdChoice); + o->end(); + } + o->end(); + } + {Fl_Check_Button* o = considerSizeValue = new Fl_Check_Button(5, 55, 80, 23, _("Size:")); + o->callback((Fl_Callback*)cb_considerSizeValue); + o->align(FL_ALIGN_LEFT|FL_ALIGN_INSIDE|FL_ALIGN_WRAP); + } + {Fl_Group* o = sizeGroup = new Fl_Group(85, 55, 360, 25); + o->box(FL_FLAT_BOX); + o->deactivate(); + {Fl_Value_Input* o = sizeGValue = new Fl_Value_Input(90, 2, 70, 20, _("greater than:")); + o->step(1); + } + {Fl_Value_Input* o = sizeMValue = new Fl_Value_Input(275, 2, 70, 20, _("and less than(KB):")); + o->step(1); + } + o->end(); + } + {Fl_Check_Button* o = considerTimeValue = new Fl_Check_Button(5, 80, 135, 25, _("Time:")); + o->callback((Fl_Callback*)cb_considerTimeValue); + } + {Fl_Group* o = timeGroup1 = new Fl_Group(140, 85, 110, 60); + o->box(FL_FLAT_BOX); + o->deactivate(); + {Fl_Round_Button* o = modifiedRadio = new Fl_Round_Button(0, 0, 105, 20, _("Modified")); + o->type(Fl_Round_Button::RADIO); + } + {Fl_Round_Button* o = changedRadio = new Fl_Round_Button(0, 20, 105, 20, _("Changed")); + o->type(Fl_Round_Button::RADIO); + } + {Fl_Round_Button* o = accessedRadio = new Fl_Round_Button(0, 40, 105, 20, _("Accessed")); + o->type(Fl_Round_Button::RADIO); + } + o->end(); + } + {Fl_Group* o = new Fl_Group(255, 90, 80, 60); + {Fl_Value_Input* o = timeValue = new Fl_Value_Input(5, 33, 65, 20, _("in previous:")); + o->maximum(100); + o->step(1); + o->align(FL_ALIGN_TOP|FL_ALIGN_LEFT|FL_ALIGN_CLIP|FL_ALIGN_WRAP); + o->deactivate(); + } + o->end(); + } + {Fl_Group* o = timeGroup2 = new Fl_Group(335, 85, 110, 60); + o->box(FL_FLAT_BOX); + o->deactivate(); + {Fl_Group* o = new Fl_Group(0, 0, 105, 60); + {Fl_Round_Button* o = minutesRadio = new Fl_Round_Button(0, 0, 105, 15, _("Minutes")); + o->type(Fl_Round_Button::RADIO); + } + {Fl_Round_Button* o = hoursRadio = new Fl_Round_Button(0, 15, 105, 15, _("Hours")); + o->type(Fl_Round_Button::RADIO); + } + {Fl_Round_Button* o = daysRadio = new Fl_Round_Button(0, 30, 105, 15, _("Days")); + o->type(Fl_Round_Button::RADIO); + } + {Fl_Round_Button* o = mounthsRadio = new Fl_Round_Button(0, 45, 105, 15, _("Mounths")); + o->type(Fl_Round_Button::RADIO); + } + o->end(); + } + o->end(); + } + {Fl_Box* o = new Fl_Box(440, 5, 10, 145); + o->parent()->resizable(o); + } + o->parent()->resizable(o); + o->end(); + } + o->end(); + } + {Fl_Group* o = new Fl_Group(1, 23, 471, 211, _("Content options")); + o->hide(); + {Fl_Group* o = new Fl_Group(7, 20, 459, 185, _("General considerations")); + o->box(FL_ENGRAVED_BOX); + o->align(FL_ALIGN_TOP|FL_ALIGN_LEFT); + {Fl_Check_Button* o = doNotLookIntoBinaryCheck = new Fl_Check_Button(15, 10, 270, 23, _("Do not look into binary files")); + o->value(1); + } + {Fl_Check_Button* o = outputCountCheck = new Fl_Check_Button(15, 37, 270, 23, _("Output count of matching lines")); + o->value(1); + } + {Fl_Round_Button* o = matchAnywhereRadio = new Fl_Round_Button(15, 72, 255, 20, _("Match anywhere")); + o->type(Fl_Round_Button::RADIO); + o->value(1); + } + {Fl_Round_Button* o = matchWordsRadio = new Fl_Round_Button(15, 95, 255, 20, _("Match whole words only")); + o->type(Fl_Round_Button::RADIO); + } + {Fl_Round_Button* o = matchLinesRadio = new Fl_Round_Button(15, 118, 255, 20, _("Match whole lines only")); + o->type(Fl_Round_Button::RADIO); + } + {Fl_Round_Button* o = invertMatchRadio = new Fl_Round_Button(15, 141, 255, 20, _("Output files where no match is found")); + o->type(Fl_Round_Button::RADIO); + } + {Fl_Box* o = new Fl_Box(285, 10, 160, 165); + o->parent()->resizable(o); + } + o->parent()->resizable(o); + o->end(); + } + o->end(); + } + {Fl_Group* o = new Fl_Group(1, 23, 471, 211, _("About")); + o->hide(); + {Fl_Box* o = new Fl_Box(21, 32, 424, 135, _("(C) Copyright 2000-2005. EDE Authors.\n\n Efinder is using the code from xfglob whic\ +h is\n (C) Copyright 2000-2001 by Edscott Wilson Garcia.")); + o->align(FL_ALIGN_INSIDE|FL_ALIGN_WRAP); + } + o->end(); + } + o->end(); + } + {Fl_ListView* o = searchList = new Fl_ListView(3, 245, 473, 85); o->begin(); + o->align(FL_ALIGN_TOP|FL_ALIGN_LEFT); + searchList->type(searchList->type() | Fl_ListView::MULTI_SELECTION); + searchList->add_column(_("Filename"), 200); + searchList->add_column(_("Size"), 79); + searchList->add_column(_("Last modified"), 125); + searchList->add_column(_("Rights"), 65); + searchList->column_flags(0, FL_ALIGN_LEFT); + searchList->column_flags(1, FL_ALIGN_CENTER); + searchList->column_flags(2, FL_ALIGN_CENTER); + searchList->column_flags(3, FL_ALIGN_RIGHT); + o->end(); + Fl_Group::current()->resizable(o); + } + {Fl_Box* o = statusLine = new Fl_Box(3, 362, 473, 20); + o->box(FL_THIN_DOWN_BOX); + o->align(FL_ALIGN_LEFT|FL_ALIGN_INSIDE); + o->when(FL_WHEN_CHANGED); + } + {Fl_Group* o = new Fl_Group(3, 330, 473, 30); + {Fl_Button* o = searchButton = new Fl_Button(222, 3, 80, 25, _("&Find")); + o->shortcut(0xff0d); + o->callback((Fl_Callback*)cb_searchButton); + o->tooltip(_("Start the searching.")); + } + {Fl_Button* o = new Fl_Button(392, 3, 80, 25, _("&Cancel")); + o->callback((Fl_Callback*)cb_Cancel); + } + {Fl_Button* o = stopButton = new Fl_Button(307, 3, 80, 25, _("&Stop")); + o->callback((Fl_Callback*)cb_stopButton); + o->tooltip(_("Stop the searching.")); + } + {Fl_Box* o = new Fl_Box(7, 5, 210, 20); + o->parent()->resizable(o); + } + o->end(); + } + o->size_range(o->w(), o->h()); + o->end(); + } + findWindow->end(); + findWindow->show(); +} diff --git a/efinder/efinder.fld b/efinder/efinder.fld new file mode 100644 index 0000000..a01bc88 --- /dev/null +++ b/efinder/efinder.fld @@ -0,0 +1,470 @@ +# data file for the eFLTK User Interface Designer (eFLUID) +version 2,0003 +images_dir ./ +i18n +header_name {.h} +code_name {.cpp} +gridx 5 +gridy 5 +snap 3 +decl {// Finder for EDE is (C) Copyright 2001-2002 by Martin Pekar, this program is provided under the terms of GNU GPL v.2, see file COPYING for more information.} {} + +decl {\#include "eglob.h"} {} + +Function {createPermWindow()} {return_type void +} { + Fl_Window permWindow { + label Permissions open + xywh {282 274 355 175} hide resizable + } { + Fl_Group {} { + label Owner open + xywh {10 30 110 90} align FL_ALIGN_TOP|FL_ALIGN_LEFT box ENGRAVED_BOX + } { + Fl_Check_Button {} { + label Read + callback {toggle_permission(S_IRUSR);} + xywh {5 5 85 25} + } + Fl_Check_Button {} { + label Write + callback {toggle_permission(S_IWUSR);} + xywh {5 25 85 25} + } + Fl_Check_Button {} { + label Execute + callback {toggle_permission(S_IXUSR);} + xywh {5 45 85 25} + } + Fl_Check_Button {} { + label {Set UID} + callback {toggle_permission(S_ISUID);} + xywh {5 65 85 25} + } + } + Fl_Group {} { + label Group open + xywh {125 30 105 90} align FL_ALIGN_TOP|FL_ALIGN_LEFT box ENGRAVED_BOX + } { + Fl_Check_Button {} { + label Read + callback {toggle_permission(S_IRGRP);} + xywh {5 5 85 25} + } + Fl_Check_Button {} { + label Write + callback {toggle_permission(S_IWGRP);} + xywh {5 25 85 25} + } + Fl_Check_Button {} { + label Execute + callback {toggle_permission(S_IXGRP);} + xywh {5 45 85 25} + } + Fl_Check_Button {} { + label {Set GID} + callback {toggle_permission(S_ISGID);} + xywh {5 65 85 25} + } + } + Fl_Group {} { + label Other open + xywh {235 30 110 90} align FL_ALIGN_TOP|FL_ALIGN_LEFT box ENGRAVED_BOX + } { + Fl_Check_Button {} { + label Read + callback {toggle_permission(S_IROTH);} + xywh {5 5 85 25} + } + Fl_Check_Button {} { + label Write + callback {toggle_permission(S_IWOTH);} + xywh {5 25 85 25} + } + Fl_Check_Button {} { + label Execute + callback {toggle_permission(S_IXOTH);} + xywh {5 45 85 25} + } + Fl_Check_Button {} { + label Sticky + callback {toggle_permission(S_ISVTX);} + xywh {5 65 95 25} + } + } + Fl_Button {} { + label {&Close} + callback {permWindow->hide();} + xywh {140 140 85 25} + } + } + code {permWindow->end(); +permWindow->show();} {} +} + +Function {createFindWindow()} {open return_type void +} { + Fl_Window findWindow { + label Find open + xywh {283 179 480 385} resizable + extra_code {o->size_range(o->w(), o->h());} visible + } { + Fl_Tabs {} {open + xywh {3 5 473 235} color 0xfffffffe + } { + Fl_Group {} { + label Find open + xywh {1 23 471 211} hide + extra_code {o->parent()->resizable(o);} + } { + Fl_Group {} { + label Find open + xywh {7 20 460 100} align FL_ALIGN_TOP|FL_ALIGN_LEFT box ENGRAVED_BOX + } { + Fl_Group {} {open + xywh {5 5 450 30} + } { + Fl_Input pathInput { + label {Path:} + xywh {70 5 285 23} align FL_ALIGN_LEFT|FL_ALIGN_WRAP + extra_code {o->parent()->resizable(o); +char *tmp = fl_get_homedir(); +o->value(tmp); +delete []tmp;} + } + Fl_Button {} { + label {&Browse...} + callback {const char *f = fl_select_dir(0, _("Select directory")); + if (f) { + pathInput->value(f); + }} + tooltip {Find path.} + xywh {360 5 80 23} + extra_code {\#include } + } + } + Fl_Input filterInput { + label {File filter:} + xywh {75 40 370 23} align FL_ALIGN_LEFT|FL_ALIGN_WRAP + extra_code {o->value("*"); +o->parent()->resizable(o);} + } + Fl_Group {} {open + xywh {25 65 430 32} + } { + Fl_Check_Button recursiveCheck { + label {Search subdirectories} + xywh {50 0 155 30} align FL_ALIGN_LEFT|FL_ALIGN_INSIDE|FL_ALIGN_CLIP|FL_ALIGN_WRAP value 1 + } + Fl_Group {} {open + xywh {200 0 220 32} + } { + Fl_Value_Input fileLimitValue { + label {Limit results to first n files:} + xywh {175 5 45 20} align FL_ALIGN_LEFT|FL_ALIGN_CLIP|FL_ALIGN_WRAP step 1 value 64 + } + } + } + } + Fl_Group {} { + label Content open + xywh {7 140 459 65} align FL_ALIGN_TOP|FL_ALIGN_LEFT box ENGRAVED_BOX + } { + Fl_Input containsInput { + label {Containing:} + xywh {75 10 370 23} align FL_ALIGN_LEFT|FL_ALIGN_WRAP + extra_code {o->parent()->resizable(o);} + } + Fl_Group {} {open + xywh {75 35 370 25} + } { + Fl_Check_Button caseSensitiveCheck { + label {Case sensitive} + xywh {0 0 140 25} align FL_ALIGN_LEFT|FL_ALIGN_INSIDE|FL_ALIGN_WRAP + } + Fl_Check_Button useRegexpCheck { + label {Extended regexp} + xywh {140 0 230 25} align FL_ALIGN_LEFT|FL_ALIGN_INSIDE|FL_ALIGN_WRAP + } + } + } + Fl_Box {} { + xywh {7 206 455 2} + extra_code {o->parent()->resizable(o);} + } + } + Fl_Group {} { + label {Filter options} open + xywh {1 23 471 211} hide + } { + Fl_Group {} { + label Considerations open + xywh {7 20 459 32} align FL_ALIGN_TOP|FL_ALIGN_LEFT box ENGRAVED_BOX + } { + Fl_Choice fileTypeBrowser { + label {File type:} + xywh {70 5 145 23} align FL_ALIGN_LEFT|FL_ALIGN_WRAP + extra_code {\#include +o->parent()->resizable(o); + +o->value("Any kind");} + class Fl_Input_Browser + } { + Fl_Item {} { + label {Any kind} + } + Fl_Item {} { + label Regular + } + Fl_Item {} { + label Directory + } + Fl_Item {} { + label Symlink + } + Fl_Item {} { + label Socket + } + Fl_Item {} { + label {Block device} + } + Fl_Item {} { + label {Character device} + } + Fl_Item {} { + label FIFO + } + } + Fl_Check_Button stayOnSingleCheck { + label {Stay on single filesystem} + xywh {225 4 230 23} align FL_ALIGN_LEFT|FL_ALIGN_INSIDE|FL_ALIGN_CLIP|FL_ALIGN_WRAP + } + } + Fl_Group {} {open + xywh {7 50 459 155} box ENGRAVED_BOX + extra_code {o->parent()->resizable(o);} + } { + Fl_Check_Button considerPermValue { + label Permissions + callback {if (considerPermValue->value()) + createPermWindow();} + xywh {5 5 115 25} + } + Fl_Check_Button considerUserValue { + label {User/group:} + callback {if (considerUserValue->value()) { + userGroup->activate(); +} +else { + userGroup->deactivate(); +}} + xywh {5 30 115 25} + } + Fl_Group userGroup {open + xywh {120 30 325 25} deactivate + } { + Fl_Choice userIdChoice { + label {User id:} open + xywh {70 2 72 20} align FL_ALIGN_LEFT|FL_ALIGN_WRAP + extra_code {o->value("Anyone"); +jam("/etc/passwd", userIdChoice);} + class Fl_Input_Browser + } {} + Fl_Choice groupIdChoice { + label {Group id:} + xywh {240 2 72 20} align FL_ALIGN_LEFT|FL_ALIGN_WRAP + extra_code {o->value("Anyone"); +jam("/etc/group", groupIdChoice);} + class Fl_Input_Browser + } {} + } + Fl_Check_Button considerSizeValue { + label {Size:} + callback {if (considerSizeValue->value()) { + sizeGroup->activate(); +} +else { + sizeGroup->deactivate(); +}} + xywh {5 55 80 23} align FL_ALIGN_LEFT|FL_ALIGN_INSIDE|FL_ALIGN_WRAP + } + Fl_Group sizeGroup {open + xywh {85 55 360 25} deactivate box FLAT_BOX + } { + Fl_Value_Input sizeGValue { + label {greater than:} + xywh {90 2 70 20} step 1 + } + Fl_Value_Input sizeMValue { + label {and less than(KB):} + xywh {275 2 70 20} step 1 + } + } + Fl_Check_Button considerTimeValue { + label {Time:} + callback {if (considerTimeValue->value()) { + timeGroup1->activate(); + timeValue->activate(); + timeGroup2->activate(); +} +else { + timeGroup1->deactivate(); + timeValue->deactivate(); + timeGroup2->deactivate(); +}} + xywh {5 80 135 25} + } + Fl_Group timeGroup1 { + xywh {140 85 110 60} deactivate box FLAT_BOX + } { + Fl_Round_Button modifiedRadio { + label Modified + xywh {0 0 105 20} type RADIO + } + Fl_Round_Button changedRadio { + label Changed + xywh {0 20 105 20} type RADIO + } + Fl_Round_Button accessedRadio { + label Accessed + xywh {0 40 105 20} type RADIO + } + } + Fl_Group {} {open + xywh {255 90 80 60} + } { + Fl_Value_Input timeValue { + label {in previous:} + xywh {5 33 65 20} align FL_ALIGN_TOP|FL_ALIGN_LEFT|FL_ALIGN_CLIP|FL_ALIGN_WRAP deactivate maximum 100 step 1 + } + } + Fl_Group timeGroup2 {open + xywh {335 85 110 60} deactivate box FLAT_BOX + } { + Fl_Group {} {open + xywh {0 0 105 60} + } { + Fl_Round_Button minutesRadio { + label Minutes + xywh {0 0 105 15} type RADIO + } + Fl_Round_Button hoursRadio { + label Hours + xywh {0 15 105 15} type RADIO + } + Fl_Round_Button daysRadio { + label Days + xywh {0 30 105 15} type RADIO + } + Fl_Round_Button mounthsRadio { + label Mounths + xywh {0 45 105 15} type RADIO + } + } + } + Fl_Box {} { + xywh {440 5 10 145} + extra_code {o->parent()->resizable(o);} + } + } + } + Fl_Group {} { + label {Content options} + xywh {1 23 471 211} hide + } { + Fl_Group {} { + label {General considerations} open + xywh {7 20 459 185} align FL_ALIGN_TOP|FL_ALIGN_LEFT box ENGRAVED_BOX + extra_code {o->parent()->resizable(o);} + } { + Fl_Check_Button doNotLookIntoBinaryCheck { + label {Do not look into binary files} + xywh {15 10 270 23} value 1 + } + Fl_Check_Button outputCountCheck { + label {Output count of matching lines} + xywh {15 37 270 23} value 1 + } + Fl_Round_Button matchAnywhereRadio { + label {Match anywhere} + xywh {15 72 255 20} type RADIO value 1 + } + Fl_Round_Button matchWordsRadio { + label {Match whole words only} + xywh {15 95 255 20} type RADIO + } + Fl_Round_Button matchLinesRadio { + label {Match whole lines only} + xywh {15 118 255 20} type RADIO + } + Fl_Round_Button invertMatchRadio { + label {Output files where no match is found} + xywh {15 141 255 20} type RADIO + } + Fl_Box {} { + xywh {285 10 160 165} + extra_code {o->parent()->resizable(o);} + } + } + } + Fl_Group {} { + label About open + xywh {1 23 471 211} + } { + Fl_Box {} { + label {(C) Copyright 2000-2005. EDE Authors. + + Efinder is using the code from xfglob which is + (C) Copyright 2000-2001 by Edscott Wilson Garcia.} selected + xywh {21 32 424 135} align FL_ALIGN_INSIDE|FL_ALIGN_WRAP + } + } + } + Fl_Browser searchList {open + xywh {3 245 473 85} align FL_ALIGN_TOP|FL_ALIGN_LEFT resizable + extra_code {\#include +\#include +\#include +searchList->type(searchList->type() | Fl_ListView::MULTI_SELECTION); +searchList->add_column(_("Filename"), 200); +searchList->add_column(_("Size"), 79); +searchList->add_column(_("Last modified"), 125); +searchList->add_column(_("Rights"), 65); +searchList->column_flags(0, FL_ALIGN_LEFT); +searchList->column_flags(1, FL_ALIGN_CENTER); +searchList->column_flags(2, FL_ALIGN_CENTER); +searchList->column_flags(3, FL_ALIGN_RIGHT);} + class Fl_ListView + } {} + Fl_Box statusLine { + xywh {3 362 473 20} align FL_ALIGN_LEFT|FL_ALIGN_INSIDE when CHANGED box THIN_DOWN_BOX + } + Fl_Group {} {open + xywh {3 330 473 30} + } { + Fl_Button searchButton { + label {&Find} + callback {findCB();} + tooltip {Start the searching.} + xywh {222 3 80 25} shortcut 0xff0d + } + Fl_Button {} { + label {&Cancel} + callback {exit(0);} + xywh {392 3 80 25} + } + Fl_Button stopButton { + label {&Stop} + callback {stopSearch();} + tooltip {Stop the searching.} + xywh {307 3 80 25} + } + Fl_Box {} { + xywh {7 5 210 20} + extra_code {o->parent()->resizable(o);} + } + } + } + code {findWindow->end(); +findWindow->show();} {} +} diff --git a/efinder/efinder.h b/efinder/efinder.h new file mode 100644 index 0000000..524131f --- /dev/null +++ b/efinder/efinder.h @@ -0,0 +1,69 @@ +// generated by Extended Fast Light User Interface Designer (eFluid) version 2.0003 + +#ifndef _EFINDER_H_ +#define _EFINDER_H_ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern Fl_Window* permWindow; +extern Fl_Window* findWindow; +extern Fl_Input* pathInput; +extern Fl_Input* filterInput; +extern Fl_Check_Button* recursiveCheck; +extern Fl_Value_Input* fileLimitValue; +extern Fl_Input* containsInput; +extern Fl_Check_Button* caseSensitiveCheck; +extern Fl_Check_Button* useRegexpCheck; +extern Fl_Input_Browser* fileTypeBrowser; +extern Fl_Check_Button* stayOnSingleCheck; +extern Fl_Check_Button* considerPermValue; +extern Fl_Check_Button* considerUserValue; +extern Fl_Group* userGroup; +extern Fl_Input_Browser* userIdChoice; +extern Fl_Input_Browser* groupIdChoice; +extern Fl_Check_Button* considerSizeValue; +extern Fl_Group* sizeGroup; +extern Fl_Value_Input* sizeGValue; +extern Fl_Value_Input* sizeMValue; +extern Fl_Check_Button* considerTimeValue; +extern Fl_Group* timeGroup1; +extern Fl_Round_Button* modifiedRadio; +extern Fl_Round_Button* changedRadio; +extern Fl_Round_Button* accessedRadio; +extern Fl_Value_Input* timeValue; +extern Fl_Group* timeGroup2; +extern Fl_Round_Button* minutesRadio; +extern Fl_Round_Button* hoursRadio; +extern Fl_Round_Button* daysRadio; +extern Fl_Round_Button* mounthsRadio; +extern Fl_Check_Button* doNotLookIntoBinaryCheck; +extern Fl_Check_Button* outputCountCheck; +extern Fl_Round_Button* matchAnywhereRadio; +extern Fl_Round_Button* matchWordsRadio; +extern Fl_Round_Button* matchLinesRadio; +extern Fl_Round_Button* invertMatchRadio; +extern Fl_ListView* searchList; +extern Fl_Box* statusLine; +extern Fl_Button* searchButton; +extern Fl_Button* stopButton; + +void createPermWindow(); +void createFindWindow(); + +#endif diff --git a/efinder/eglob.cpp b/efinder/eglob.cpp new file mode 100644 index 0000000..40f197b --- /dev/null +++ b/efinder/eglob.cpp @@ -0,0 +1,622 @@ +// eglob.cpp +// +// glob for xfce Copyright 2000-2001 Edscott Wilson Garcia +// Copyright (C) 2001-2002 Martin Pekar +// +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// This program 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 General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include + +#include "efinder.h" +#include "eglob.h" + +#include "icons/block_dev.xpm" +#include "icons/char_dev.xpm" +#include "icons/dir_close.xpm" +#include "icons/exe.xpm" +#include "icons/sexe.xpm" +#include "icons/fifo.xpm" +#include "icons/page.xpm" +#include "icons/page_lnk.xpm" +#include "icons/socket.xpm" + +#define GLOB "glob" +#define TRUE 1 +#define FALSE 0 +#define MAX_ARG 50 + +static int considerTime = FALSE, considerSize = FALSE, +considerUser = FALSE, considerPerm = FALSE, cancelled = FALSE; +static int pfd[2]; /* the pipe */ +static pid_t Gpid; /* glob pid, to be able to cancel search */ +static short int findCount; /* how many files found */ +static short int fileLimit = 64; +static int type=0x0; + +static Fl_Image block_dev_pix = *Fl_Image::read_xpm(0, (const char **)block_dev_xpm); +static Fl_Image char_dev_pix = *Fl_Image::read_xpm(0, (const char **)char_dev_xpm); +static Fl_Image dir_close_pix = *Fl_Image::read_xpm(0, (const char **)dir_close_xpm); +static Fl_Image exe_pix = *Fl_Image::read_xpm(0, (const char **)exe_xpm); +static Fl_Image sexe_pix = *Fl_Image::read_xpm(0, (const char **)sexe_xpm); +static Fl_Image fifo_pix = *Fl_Image::read_xpm(0, (const char **)fifo_xpm); +static Fl_Image page_pix = *Fl_Image::read_xpm(0, (const char **)page_xpm); +static Fl_Image page_lnk_pix = *Fl_Image::read_xpm(0, (const char **)page_lnk_xpm); +static Fl_Image socket_pix = *Fl_Image::read_xpm(0, (const char **)socket_xpm); + +static char *ftypes[9] = +{ + "Any kind", + "Regular", + "Directory", + "Symlink", + "Socket", + "Block device", + "Character device", + "FIFO", + NULL +}; + +static char *ft[] = +{ + "any", + "reg", + "dir", + "sym", + "sock", + "blk", + "chr", + "fifo", + NULL +}; + +void +jam(char *file, Fl_Menu_ *optmenu) +{ + FILE *archie; + char line[256]; + char *s,*r,*t = "Anyone"; + + archie=fopen(file,"r"); + if (archie==NULL) return; + + optmenu->add("Anyone"); + + while (!feof(archie) && (fgets(line,255,archie))) + { + if (feof(archie)) break; + line[255]=0; + if ((line[0]=='#')||(strchr(line,':')==NULL)) continue; + r=strtok(line,":"); if (!r) continue; + s=strchr(r+strlen(r)+1,':')+1;if (!s) continue; + s=strtok(s,":");if (!s) continue; + t=(char *)malloc(strlen(s)+1); + strcpy(t,s); + optmenu->add(r); + } + fclose(archie); + return; +} + + +void +toggle_permission(long data) +{ + int flag; + flag = (int ) ((long)data); + type ^= (flag&07777); +} + + +static void +abort_glob() +{ + if (Gpid) + { + kill (Gpid, SIGKILL); //agressive + } +} + + +static void +abort_glob1() +{ + if (Gpid) + { + kill (Gpid, SIGTERM); // nonagressive + } +} + + +void +GlobWait(void *data) +{ + int status; + int childPID; + childPID = (int) ((long)data); + //fprintf(stderr,"waiting\n"); + waitpid (childPID, &status, WNOHANG); + if (WIFEXITED (status)) + { + //fprintf(stderr,"waiting done\n"); + return; + } + Fl::add_timeout(2, GlobWait, (void*)childPID); + return; +} + + +void +findCB() +{ + char *argument[MAX_ARG]; + char sizeG_s[64], sizeM_s[64], hours_s[64], permS[64]; + char *path, *filter, *token, *s; + int i, j, sizeG, sizeM, hours; + int childPID; + + cancelled = FALSE; + + if (Gpid) + { + kill (Gpid, SIGHUP); + Gpid = 0; + } + + searchList->clear(); + + findCount = 0; + fileLimit = (int) fileLimitValue->value(); + path = (char*) pathInput->value(); + + if (strlen(path)==0) + path = "/"; + if (path[strlen(path)-1]=='~') + path = "~/"; //tilde expansion + + if (path[0]=='$') //environment variables + { + path=getenv(path+1); + if (path==NULL) + path="/"; + } + + filter = (char*) filterInput->value(); + token = (char*) containsInput->value(); + considerTime = considerTimeValue->value(); + considerSize = considerSizeValue->value(); + considerUser = considerUserValue->value(); + considerPerm = considerPermValue->value(); + + if (considerSize) + { + sizeG = (int)sizeGValue->value(); + sizeM = (int)sizeMValue->value(); + if ((sizeM <= sizeG)&&(sizeM > 0)) + { + fl_alert("Incoherent size considerations!"); + return; + } + } + else + sizeG = sizeM = 0; + + if (considerTime) + { + hours = (int)timeValue->value(); + } + else + hours = 0; + + //s = (char*) fileTypeBrowser->text(fileTypeBrowser->value()); + s = (char*) fileTypeBrowser->value(); + + for (j = -1, i = 0; ftypes[i] != NULL; i++) + { + if (strcmp (s, ftypes[i]) == 0) + { + j = i; + break; + } + } + + if (j < 0) + s = ftypes[0]; + i = 0; + argument[i++] = GLOB; + + //argument[i++] = "-v"; (verbose output from glob for debugging) + argument[i++] = "-P"; + + if (doNotLookIntoBinaryCheck->value()) + argument[i++] = "-I"; + + if (recursiveCheck->value()) + argument[i++] = "-r"; + + if (considerPerm) + { + argument[i++] = "-o"; + snprintf(permS, sizeof(permS)-1, "0%o",type&07777); + argument[i++] = permS; + } + + if (caseSensitiveCheck->value()) + argument[i++] = "-i"; + + if (outputCountCheck->value()) + argument[i++] = "-c"; + + if (invertMatchRadio->value()) + argument[i++] = "-L"; + + if (matchWordsRadio->value()) + argument[i++] = "-w"; + else + { + if (matchLinesRadio->value()) + argument[i++] = "-x"; + } + if (j > 0) + { + argument[i++] = "-t"; + argument[i++] = ft[j]; + } + + if (considerTime) + { + if (modifiedRadio->value()) argument[i++] = "-M"; + if (accessedRadio->value()) argument[i++] = "-A"; + if (changedRadio->value()) argument[i++] = "-C"; + if (hours > 0) + { + if (minutesRadio->value()) argument[i++] = "-k"; + if (hoursRadio->value()) argument[i++] = "-h"; + if (daysRadio->value()) argument[i++] = "-d"; + if (mounthsRadio->value()) argument[i++] = "-m"; + + snprintf (hours_s, sizeof(hours_s)-1, "%d", hours); + argument[i++] = hours_s; + } + } + + if (considerSize) + { + if (sizeG > 0) + { + argument[i++] = "-s"; + snprintf (sizeG_s, sizeof(sizeG_s)-1, "+%d", sizeG); + argument[i++] = sizeG_s; + } + if (sizeM > 0) + { + argument[i++] = "-s"; + snprintf (sizeM_s, sizeof(sizeM_s)-1, "-%d", sizeM); + argument[i++] = sizeM_s; + } + } + + if (stayOnSingleCheck->value()) + argument[i++] = "-a"; + + if (considerUser) + { + if (userIdChoice->value()) + { + argument[i++] = "-u"; + //argument[i++] = (char*)userIdChoice->text(userIdChoice->value()); + argument[i++] = (char*)userIdChoice->value(); + } + if (groupIdChoice->value()) + { + argument[i++] = "-g"; + //argument[i++] = (char*)groupIdChoice->text(groupIdChoice->value()); + argument[i++] = (char*)groupIdChoice->value(); + } + } + + if (strlen(filter) > 0) //don't apply filter if not specified and path is absolute!! + { + argument[i++] = "-f"; + argument[i++] = filter; + } + else + { + if (path[strlen (path) - 1] == '/') + { + argument[i++] = "-f"; + argument[i++] = "*"; + } + else + { + struct stat st; + if (stat (path, &st) == 0) + { + if (S_ISDIR (st.st_mode)) + { + argument[i++] = "-f"; + argument[i++] = "*"; + } + } + } + } + + if (strlen(token) > 0) //search token in files + { + if (useRegexpCheck->value()) + argument[i++] = "-E"; + else + argument[i++] = "-e"; + argument[i++] = token; + } + + argument[i++] = path; // last argument must be the path + argument[i] = (char *) 0; + //for (j=0;j= fileLimit) + fl_message(_("Interrupted because maximum limit exceded.")); + fl_alert(mess); + } + return; + } + + if ((strncmp (line, "PID=", 4) == 0)) + { + Gpid = atoi (line + 4); + //printf("Glob PID=%d\n",Gpid); + // fflush(NULL); + nothing_found = TRUE; + return; + } + if (cancelled) + return; + + if (line[0] == '/') /* strstr for : and strtok and send to cuenta */ + { + if (findCount >= fileLimit) + abort_glob1(); + else + { + char *path, *linecount = NULL, *textos[6], cuenta[32], + sizeF[64], permF[16]; + struct stat st; + int *data; + + path = line; + char *ptr = path; + while(*ptr) { if(*ptr=='\n') *ptr='\0'; ptr++; } + statusLine->copy_label(fl_trim(path)); + statusLine->redraw(); + + if (strstr(path, ":")) + { + path = strtok(path, ":"); + linecount = strtok (NULL, ":"); + if (strcmp(linecount, "0") == 0) + { + linecount = NULL; + return; + } + } + + findCount++; + data=(int *)malloc(3*sizeof(int)); + data[0]=findCount; + data[1]=data[2]=0; + + if (linecount) + snprintf(cuenta, sizeof(cuenta)-1, "%d (%s %s)", findCount, linecount, "lines"); + else + snprintf (cuenta, sizeof(cuenta)-1, "%d", findCount); + + textos[0] = cuenta; + textos[1] = filename = (char*)fl_file_filename(path); + textos[2] = path; + + Fl_Image *resultImage=0; + + if (lstat (path, &st) == 0) + { + data[1]=st.st_size; + data[2]=st.st_ctime; + + snprintf (sizeF, sizeof(sizeF)-1,"%ld", st.st_size); + snprintf (permF, sizeof(permF)-1,"0%o", st.st_mode & 07777); + textos[3] = sizeF; + textos[4] = ctime (&(st.st_ctime)); + textos[5] = permF; + + if (S_ISREG (st.st_mode)) + { + resultImage = &page_pix; + } + if ((st.st_mode & 0100) || (st.st_mode & 010) + || (st.st_mode & 01)) + { + resultImage = &exe_pix; + } + if (st.st_mode & 04000) + { + resultImage = &sexe_pix; + } + if (S_ISDIR (st.st_mode)) + { + resultImage = &dir_close_pix; + } + if (S_ISCHR (st.st_mode)) + { + resultImage = &char_dev_pix; + } + if (S_ISBLK (st.st_mode)) + { + resultImage = &block_dev_pix; + } + if (S_ISFIFO (st.st_mode)) + { + resultImage = &fifo_pix; + } + if (S_ISLNK (st.st_mode)) + { + resultImage = &page_lnk_pix; + } + if (S_ISSOCK (st.st_mode)) + { + resultImage = &socket_pix; + } + } + else + { + textos[2] = textos[3] = textos[4] = "-"; + } + { + // leave just directory + *(strrchr(path,'/'))=0; + if (!strlen(path)) + textos[2]="/"; + char output[FL_PATH_MAX]; + snprintf(output, sizeof(output)-1, "%s/%s", textos[2], textos[1]); + searchList->begin(); + Fl_ListView_Item *resultItem = new Fl_ListView_Item(); + + // Copy labels, so item destructor knows to de-allocate them + resultItem->copy_label(0, output); + resultItem->copy_label(1, textos[3]); + resultItem->copy_label(2, textos[4]); + resultItem->copy_label(3, textos[5]); + + resultItem->image(resultImage); + searchList->end(); + searchList->relayout(); + searchList->redraw(); + } + } + } + //else {} + nothing_found = FALSE; + buffer = line; + return; ; /* continue here causes main loop blocking */ + } + buffer++; + } + return; +} + +int main (int argc, char **argv) +{ + fl_init_locale_support("efinder", PREFIX"/share/locale"); + + if (pipe (pfd) < 0) + { + perror ("pipe"); + return 1; + } + + createFindWindow(); + + Fl::add_fd(pfd[0], FL_READ, process_find_messages, (void*)pfd[0]); + + Fl::run(); + + close(pfd[0]); + close(pfd[1]); + + return 0; +} diff --git a/efinder/eglob.h b/efinder/eglob.h new file mode 100644 index 0000000..a44714d --- /dev/null +++ b/efinder/eglob.h @@ -0,0 +1,44 @@ +// eglob.h +// +// Copyright 2000-2001 Edscott Wilson Garcia +// Copyright (C) 2001-2002 Martin Pekar +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// This program 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 General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +#ifndef EGLOB_H_ +#define EGLOB_H_ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +int process_find_messages(); +void jam(char *file, Fl_Menu_ *); +void findCB(); +void stopSearch(); +void toggle_permission(long); + +#endif + diff --git a/efinder/glob.c b/efinder/glob.c new file mode 100644 index 0000000..e05f82f --- /dev/null +++ b/efinder/glob.c @@ -0,0 +1,504 @@ + +/* glob.c file filter for grep.*/ +/* + Copyright 2000 Edscott Wilson Garcia + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program 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 General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + 02111-1307, USA. */ + +/*****************************************************************/ + +#include "globber.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef HAVE_CONFIG_H +# include +#endif + +#ifdef HAVE_SNPRINTF +# include "snprintf.h" +#endif + +#ifdef DMALLOC +# include "dmalloc.h" +#endif + +/** tripas */ +#define VERSION_NAME "\nglob 0.5.0\n\nCopyright 2000-2001 Edscott Wilson Garcia\n\ +This is free software; see the source for copying conditions. There is NO\n\ +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\n" + +#define GREP "grep" + +static void *object=NULL; +static int initial; +static int terminated = 0; +static char *token; +static int options=0,type=0; +static long size=0; +static long month_t=0; +static long unsigned day_t=0; +static long unsigned hour_t=0; +static long unsigned min_t=0; + +#define GLOBRUN_PID 0x01 +#define GLOBRUN_COUNT 0x02 +#define GLOBRUN_FILTERED 0x04 +#define GLOBRUN_IGNORE_CASE 0x08 +#define GLOBRUN_REG_EXP 0x10 +#define GLOBRUN_INVERT 0x20 +/*#define GLOBRUN_WHATEVER 0x40*/ +#define GLOBRUN_WORDS_ONLY 0x80 +#define GLOBRUN_LINES_ONLY 0x100 +#define GLOBRUN_ZERO_BYTE 0x200 +#define GLOBRUN_NOBINARIES 0x400 +#define GLOBRUN_RECURSIVE 0x800 +#define GLOBRUN_VERBOSE 0x1000 +#define GLOBRUN_XDEV 0x2000 + +#define MAX_ARG 25 + +static int display (char *input) +{ + if (terminated) return terminated; /* die quietly and quickly */ + printf ("%s\n", input); + if (time (NULL) - initial > 3) { + fflush (NULL); + initial = time (NULL); + } + return terminated; +} + +static int grep (char *file) +{ + static char *arguments[MAX_ARG]; + int status = 0; + if (terminated) return terminated; /* die quietly and quickly */ + + arguments[status++] = "grep"; + arguments[status++] = "-d"; + arguments[status++] = "skip"; + arguments[status++] = "-H"; + if (options & GLOBRUN_NOBINARIES) + arguments[status++] = "-I"; + if (options & GLOBRUN_IGNORE_CASE) + arguments[status++] = "-i"; + if (options & GLOBRUN_WORDS_ONLY) + arguments[status++] = "-w"; + if (options & GLOBRUN_LINES_ONLY) + arguments[status++] = "-x"; + if (options & GLOBRUN_ZERO_BYTE) + arguments[status++] = "-Z"; + + if ((options & GLOBRUN_COUNT) && (options & GLOBRUN_INVERT)) + { + arguments[status++] = "-c"; + arguments[status++] = "-v"; + } + if ((options & GLOBRUN_COUNT) && !(options & GLOBRUN_INVERT)) + { + arguments[status++] = "-c"; + } + if (!(options & GLOBRUN_COUNT) && (options & GLOBRUN_INVERT)) + { + arguments[status++] = "-L"; + } + if (!(options & GLOBRUN_COUNT) && !(options & GLOBRUN_INVERT)) + { + arguments[status++] = "-l"; + } + + if (options & GLOBRUN_REG_EXP) + arguments[status++] = "-E"; + else + arguments[status++] = "-e"; + arguments[status++] = token; + + arguments[status++] = file; + arguments[status++] = (char *) 0; + if (options & GLOBRUN_VERBOSE) + { + int i; + for (i = 0; i < status; i++) + printf ("%s ", arguments[i]); + printf ("\n"); + } + + if (fork () == 0){ + execvp (GREP, arguments); + fprintf(stderr,"%s not found in path!\n",GREP); + exit(1); + } + wait (&status); + + /*fflush(NULL); */ + return terminated; +} + + +static char *message[] = { + " [-vVPrMACaiIyLcwxZ] [-fpotkhsmudgeE (option)] path \n\n", + "options: \n" + " [-r] [-v] [-d ddd] [-m mmm] [-f filter] [-s (+/-)size]\n", + " [-t type] [-p perm] [grep options...] \n", + "-v = verbose\n", + "-V = print version number information\n", + "-a = stay on a single filesystem.\n", + "-P = print process id (capital P)\n", + "-f filter = file filter (enclosed in quotes if regexp *,? or\n", + " [] is used)\n", + "-r = recursive\n", + "-s +kbytes = size greater than kbytes KBYTES\n", + "-s -kbytes = size less than kbytes KBYTES\n", + "-p perm = perm is either suid | exe\n", + "-o octal_mode = octal mode is the file mode in octal notation\n", + "-t type = any | reg | dir | sym | sock | blk | chr | fifo\n", + " (any, regular, directory, symlink, socket, blk_dev,\n", + " chr_dev, fifo: any is the default.)\n", + " * Time options must be used with either -M, -C, or -A.\n" + "-k min = file time in the previous (int) min minutes (either -M -C -A)\n", + "-h hhh = file time in the previous (int) hh hours (either -M -C -A)\n", + "-d ddd = file time in the previous (int) dd days (either -M -C -A)\n", + "-m mmm = file time in the previous (int) mm months (either -M -C -A)\n", + "-M = use mtime for file (modification time: mknod, truncate,\n", + " utime,write \n", + "-A = use atime for file (access time: exec, mknod, pipe,\n", + " utime, read) \n", + "-C = use ctime for file (change time: setting inode information\n", + " i.e., owner, group, link count, mode, etc.) \n", + "-u user-id = only files matching numeric user-id\n", + "-g group-id = only files matching numeric group-id\n", + "-Z = Output a zero byte (the ASCII NUL character)\n", + " instead of the character that normally follows a\n", + " file name (never tested option, if you do, email me)\n", + "\n", + "**specifying these option will be used in content search (grep):\n", + "-e string = containing string (if *,? or [], use quotes)\n", + "-E regexp = containing regexp: (use quotes amigo). \n", + "-i = ignore case (for search string -c)\n", + "-I = do not search into binary files\n", + "-y = same as -i (obsolete)\n", + "-L = print the name of each input file from which *no*\n", + " output would normally have been printed.\n", + "-c = only print a count of matching lines for each input\n", + " file.\n", + "-w = Select only those lines containing matches that\n", + " form whole words. Word-constituent characters are\n", + " letters, digits, and the underscore.\n", + "-x = Select only those matches that exactly match the\n", + " whole line.\n", + "\n", + NULL +}; + +void +finish (int sig) +{ + /*printf("\n****\nglob terminated by signal\n****\n"); */ + terminated = 1; + fflush (NULL); +} + +void +halt (int sig) +{ + fflush (NULL); + globber_destroy(object); + exit (1); +} + + +#define CHECK_ARG if (argc <= i) goto error; +int +main (int argc, char **argv) +{ + int i,timetype=0; + char *filter = NULL, globbered = 0; + int (*operate) (char *) = display; + initial = time (NULL); + + /* initializations */ + signal (SIGHUP, halt); + signal (SIGSEGV, finish); + signal (SIGKILL, finish); + signal (SIGTERM, finish); + + + if (argc < 2) + { + error: + fprintf (stdout, "use: %s ", argv[0]); + i = 0; + while (message[i]) + fprintf (stdout,"%s", message[i++]); + exit (1); + } + object=globber_create(); + for (i = 1; i < argc; i++) + { + if (argv[i][0] == '-') + { + /* options for the globber : *****************/ + if (strstr (argv[i], "M") != NULL) + { + timetype=1; + glob_set_options(object,GLOBBER_MTIME); + continue; + } + if (strstr (argv[i], "A") != NULL) + { + timetype=1; + glob_set_options(object,GLOBBER_ATIME); + continue; + } + if (strstr (argv[i], "C") != NULL) + { + timetype=1; + glob_set_options(object,GLOBBER_CTIME); + continue; + } + if (strstr (argv[i], "a") != NULL) + { + glob_set_options(object,GLOBBER_XDEV); + options |= GLOBRUN_XDEV; + continue; + } + if (strstr (argv[i], "v") != NULL) + { + glob_set_options(object,GLOBBER_VERBOSE); + options |= GLOBRUN_VERBOSE; + continue; + } + if (strstr (argv[i], "r") != NULL) + { + glob_set_options(object,GLOBBER_RECURSIVE); + options |= GLOBRUN_RECURSIVE; + continue; + } + if (strstr (argv[i], "u") != NULL) + { + i++; + CHECK_ARG; + glob_set_user(object,atol(argv[i])); + continue; + } + if (strstr (argv[i], "g") != NULL) + { + i++; + CHECK_ARG; + glob_set_group(object,atol(argv[i])); + continue; + } + + + if (strstr (argv[i], "t") != NULL) + { + i++; + type &= 07777; + CHECK_ARG; + /*if (strcmp (argv[i], "any") == 0) type &= 07777;*/ + if (strcmp (argv[i], "reg") == 0) type |= S_IFREG; + if (strcmp (argv[i], "dir") == 0) type |= S_IFDIR; + if (strcmp (argv[i], "sym") == 0) type |= S_IFLNK; + if (strcmp (argv[i], "sock") == 0)type |= S_IFSOCK; + if (strcmp (argv[i], "blk") == 0) type |= S_IFBLK; + if (strcmp (argv[i], "chr") == 0) type |= S_IFCHR; + if (strcmp (argv[i], "fifo") == 0)type |= S_IFIFO; + if (strcmp (argv[i], "any") != 0) { + glob_set_options(object,GLOBBER_TYPE); + glob_set_type(object,type); + } + continue; + } + if (strstr (argv[i], "p") != NULL) + { + i++; + /*type &= S_IFMT;*/ + CHECK_ARG; + if (strcmp (argv[i], "suid") == 0) + type |= S_ISUID; + if (strcmp (argv[i], "exe") == 0) + type |= S_IXUSR; + glob_set_options(object,GLOBBER_PERM); + glob_set_type(object,type); + continue; + } + if (strstr (argv[i], "o") != NULL) + { + int valor; + i++; + type &= S_IFMT; + CHECK_ARG; + sscanf(argv[i],"%o",&valor); + type |= (07777&valor); + glob_set_options(object,GLOBBER_PERM); + glob_set_type(object,type); + continue; + } + + if (strstr (argv[i], "s") != NULL) + { + i++; + CHECK_ARG; + size = atol (argv[i]); + if (size < 0) glob_set_sizeL(object,-size*1024); + else glob_set_sizeG(object,size*1024); + continue; + } + + if (strstr (argv[i], "k") != NULL) + { + i++; + CHECK_ARG; + min_t = atol (argv[i]); + glob_set_time(object,month_t,day_t,hour_t,min_t); + continue; + } + if (strstr (argv[i], "h") != NULL) + { + i++; + CHECK_ARG; + hour_t = atol (argv[i]); + glob_set_time(object,month_t,day_t,hour_t,min_t); + continue; + } + if (strstr (argv[i], "d") != NULL) + { + i++; + CHECK_ARG; + day_t = atol (argv[i]); + glob_set_time(object,month_t,day_t,hour_t,min_t); + continue; + } + if (strstr (argv[i], "m") != NULL) + { + CHECK_ARG; + month_t = atol (argv[i]); + glob_set_time(object,month_t,day_t,hour_t,min_t); + continue; + } + + + if (strstr (argv[i], "f") != NULL) + { + options |= GLOBRUN_FILTERED; + i++; + CHECK_ARG; + filter = argv[i]; + if (options & GLOBRUN_VERBOSE) + fprintf (stderr, "filtering %s\n", filter); + continue; + } + /* options for grep : *******************/ + if (strstr (argv[i], "I") != NULL) + { + options |= GLOBRUN_NOBINARIES; + continue; + } + if ((strstr (argv[i], "i") != NULL)||(strstr (argv[i], "y") != NULL)) + { + options |= GLOBRUN_IGNORE_CASE; + continue; + } + if (strstr (argv[i], "L") != NULL) + { + options |= GLOBRUN_INVERT; + continue; + } + if (strstr (argv[i], "c") != NULL) + { + options |= GLOBRUN_COUNT; + continue; + } + if (strstr (argv[i], "w") != NULL) + { + options |= GLOBRUN_WORDS_ONLY; + continue; + } + if (strstr (argv[i], "x") != NULL) + { + options |= GLOBRUN_LINES_ONLY; + continue; + } + if (strstr (argv[i], "Z") != NULL) + { + options |= GLOBRUN_ZERO_BYTE; + continue; + } + if (strstr (argv[i], "P") != NULL) + { + options |= GLOBRUN_PID; + printf ("PID=%d\n", (int) getpid ()); + fflush (NULL); + continue; + } + if (strstr (argv[i], "E") != NULL) + { + i++; + CHECK_ARG; + token = argv[i]; + operate = grep; + options |= GLOBRUN_REG_EXP; + continue; + } + if (strstr (argv[i], "e") != NULL) + { + i++; + CHECK_ARG; + token = argv[i]; + operate = grep; + options |= GLOBRUN_REG_EXP; + options ^= GLOBRUN_REG_EXP; /* turn off extended regexp */ + continue; + } + + if (strstr (argv[i], "V") != NULL) + { + printf ("%s", VERSION_NAME); + return 0; + } + fprintf(stdout,"unknown argument: %s\nuse -h for help.\n",argv[i]); + exit(1); + } + if (((min_t)||(hour_t)||(day_t)||(month_t))&& !timetype) + glob_set_options(object,GLOBBER_MTIME); + terminated = globber (object,argv[i], operate, filter); + globbered = 1; + } /* end of argument processing */ + + + if (!globbered) + { + fprintf (stderr, "must specify path\n"); + goto error; + } +/* if (terminated) printf("glob run was terminated.\n");*/ + if (!terminated) + { /* die quietly and quickly */ + if (options & GLOBRUN_PID) + printf ("GLOB DONE=%d\n", (int) getpid ()); + } + fflush (NULL); + globber_destroy(object); + exit (0); +} diff --git a/efinder/globber.c b/efinder/globber.c new file mode 100644 index 0000000..bb9e5ad --- /dev/null +++ b/efinder/globber.c @@ -0,0 +1,304 @@ + +/* globber.c */ +/* + Copyright 2000-2001 Edscott Wilson Garcia + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program 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 General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + 02111-1307, USA. */ + +/*****************************************************************/ + +#include "globber.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef HAVE_CONFIG_H +# include +#endif + +#ifdef HAVE_SNPRINTF +# include "snprintf.h" +#endif + +#ifdef DMALLOC +# include "dmalloc.h" +#endif + +/** tripas **/ +/* private */ +#ifndef GLOB_TILDE +#define GLOB_TILDE 0x0 +#endif +#ifndef GLOB_ONLYDIR +#define GLOB_ONLYDIR 0x0 +#endif + +#define MONTH_T 2628000 +#define DAY_T 86400 +#define HOUR_T 3600 +#define MIN_T 60 + +typedef struct objeto_globber { + int options; + int type; + int user; + int group; + long unsigned sizeG; + long unsigned sizeL; + long unsigned month_t; + long unsigned day_t; + long unsigned hour_t; + long unsigned min_t; +/* private variables, not to be duplicated on recursion: */ + struct stat *stinit; + struct stat st; + int pass; + time_t tiempo; + time_t actual; + int dostat; +} objeto_globber; + + +static int display(char *input){ + printf("%s\n",input); /*fflush(NULL);*/ + return 0; +} + +#define DO_CHECK_PARAM if (!address) return 0; else objeto = (objeto_globber *)address; +/* public */ +int glob_clear_options(void *address){ + objeto_globber *objeto; + DO_CHECK_PARAM; + objeto->stinit=NULL; + objeto->user=-1, + objeto->group=-1, + objeto->options=0x0, + objeto->sizeG=0x0, + objeto->sizeL=0x0, + objeto->type=0x0, + objeto->month_t=0x0, + objeto->day_t=0x0, + objeto->hour_t=0x0; + objeto->min_t=0x0; + objeto->pass=0x0; + objeto->dostat=0x0; + return 1; +} + +void *globber_create(void){ + objeto_globber *objeto; + objeto=(objeto_globber *)malloc(sizeof(objeto_globber)); + glob_clear_options((void *)objeto); + return (void *)objeto; +} + +void *globber_destroy(void *address){ + objeto_globber *objeto; + DO_CHECK_PARAM; + if (address) free(address); + if (objeto->stinit) free(objeto->stinit); + return NULL; +} + +int glob_set_options(void *address,int options){ + objeto_globber *objeto; + DO_CHECK_PARAM; + objeto->options |= options; + return 1; +} + +int glob_set_type(void *address,int type){ + objeto_globber *objeto; + DO_CHECK_PARAM; + objeto->type=type; + return 1; +} + +int glob_set_sizeG(void *address,long unsigned size){ + objeto_globber *objeto; + DO_CHECK_PARAM; + glob_set_options(objeto,GLOBBER_SIZE); + objeto->sizeG=size; + return 1; +} +int glob_set_sizeL(void *address,long unsigned size){ + objeto_globber *objeto; + DO_CHECK_PARAM; + objeto->sizeL=size; + return 1; +} +int glob_set_user(void *address,int user){ + objeto_globber *objeto; + DO_CHECK_PARAM; + glob_set_options(objeto,GLOBBER_USER); + objeto->user=user; + return 1; +} +int glob_set_group(void *address,int group){ + objeto_globber *objeto; + DO_CHECK_PARAM; + glob_set_options(objeto,GLOBBER_GROUP); + objeto->group=group; + return 1; +} + + +int glob_set_time(void *address,long unsigned month_t,long unsigned day_t, + long unsigned hour_t,long unsigned min_t){ + objeto_globber *objeto; + DO_CHECK_PARAM; + objeto->month_t=month_t; + objeto->day_t=day_t; + objeto->hour_t=hour_t; + objeto->min_t=min_t; + return 1; +} + + +/* if the user defined "operate" function returns TRUE, Globber will exit + * and return to calling module with the same return value */ + + +int globber(void *address,char *path,int (*operate)(char *),char *filter) { + /* these variables must be kept on the heap */ + glob_t dirlist; + int i; + char *globstring; + objeto_globber *object; + + if (!address) object= (objeto_globber *)globber_create(); + else object = (objeto_globber *)address; + + + if (object->options&GLOBBER_VERBOSE) fprintf(stderr,"path= %s\n",path); + if (object->options&GLOBBER_TIME) { + if (object->options&GLOBBER_MTIME) + object->options &=((GLOBBER_CTIME|GLOBBER_ATIME)^0xffffffff); + else if (object->options&GLOBBER_CTIME) + object->options &=(GLOBBER_ATIME^0xffffffff); + } + + dirlist.gl_offs=2; + if (!operate) operate=display; + + if (filter){ + globstring = (char *)malloc(strlen(path)+strlen(filter)+2); + strcpy(globstring,path); + if (path[strlen(path)-1]!='/') strcat(globstring,"/"); + strcat(globstring,filter); + } else globstring = path; + + if (glob(globstring,GLOB_ERR|GLOB_TILDE,NULL,&dirlist) != 0) { + if (object->options&GLOBBER_VERBOSE) fprintf(stderr,"%s: no match\n",globstring); + } + else for (i=0;ioptions&GLOBBER_STAT) { + lstat(dirlist.gl_pathv[i],&(object->st)); + if (object->options&GLOBBER_USER){ + if (object->user != object->st.st_uid) + continue; + } + if (object->options&GLOBBER_GROUP){ + if (object->group != object->st.st_gid) + continue; + } + if (object->options&GLOBBER_TIME){ + object->actual=time(NULL); + if (object->options&GLOBBER_MTIME) object->tiempo=object->st.st_mtime; + if (object->options&GLOBBER_ATIME) object->tiempo=object->st.st_atime; + if (object->options&GLOBBER_CTIME) object->tiempo=object->st.st_ctime; + if ((object->min_t > 0) && ((object->actual-object->tiempo)/MIN_T > object->min_t)) + continue; + if ((object->hour_t > 0) && ((object->actual-object->tiempo)/HOUR_T > object->hour_t)) + continue; + if ((object->day_t > 0) && ((object->actual-object->tiempo)/DAY_T > object->day_t)) + continue; + if ((object->month_t > 0) && ((object->actual-object->tiempo)/MONTH_T > object->month_t)) + continue; + } + if (object->options&GLOBBER_SIZE){ + if ((object->sizeL > 0)&&(object->st.st_size > object->sizeL)) + continue; + if (object->st.st_size < object->sizeG) + continue; + } + if (object->options&GLOBBER_PERM){ + if ((object->st.st_mode & 07777) & (object->type & 07777)); + else { + if ((object->st.st_mode & 07777)==(object->type & 07777)); + else continue; + } + } + + if (object->options&GLOBBER_TYPE) { + if ((object->st.st_mode & S_IFMT)!=(object->type & S_IFMT)) + continue; + } + } /* done lstat'ing */ + + if ((object->pass=(*(operate))(dirlist.gl_pathv[i]))!=0) break; + } + if (filter) free(globstring); + globfree(&dirlist); + if (object->pass) { + if (object->stinit) {free(object->stinit); object->stinit=NULL;} + return (object->pass); /* error returned from function */ + } + + if (object->options&GLOBBER_RECURSIVE) { + globstring = (char *)malloc(strlen(path)+3); + strcpy(globstring,path); + strcat(globstring,(globstring[strlen(globstring)-1]=='/')?"*":"/*"); + if (glob(globstring,GLOB_ERR|GLOB_ONLYDIR|GLOB_TILDE,NULL,&dirlist) != 0) { + if (object->options&GLOBBER_VERBOSE) fprintf(stderr,"%s: no match\n",globstring); + } + else for (i=0;ist)); + if ((object->st.st_mode & S_IFMT)!=S_IFDIR) continue; /* dont follow non-dirs. */ + if ((object->st.st_mode & S_IFMT)==S_IFLNK) continue; /* dont follow symlinks */ + + if (object->options&GLOBBER_XDEV){ + if (object->stinit==NULL) { + object->stinit=(struct stat *) malloc(sizeof (struct stat)); + lstat(dirlist.gl_pathv[i],object->stinit); + } + else { + if (object->st.st_dev != object->stinit->st_dev) continue; + /* dont leave filesystem */ + } + } + if (object->options&GLOBBER_VERBOSE) + fprintf(stderr,"directory: %s \n",dirlist.gl_pathv[i]); + object->pass=globber(address,dirlist.gl_pathv[i],operate,filter); + if (object->pass) break; + } + free(globstring); + globfree(&dirlist); + } + + if (object->stinit) {free(object->stinit);object->stinit=NULL;} + return (object->pass); +} + + + diff --git a/efinder/globber.h b/efinder/globber.h new file mode 100644 index 0000000..75e499b --- /dev/null +++ b/efinder/globber.h @@ -0,0 +1,86 @@ + +/* globber.h */ +/* + Copyright 2000 Edscott Wilson Garcia + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program 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 General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + 02111-1307, USA. */ + +/*****************************************************************/ + +/* version 0.5.0 is object oriented and eliminates sharing of +* global variables with other modules. */ + +/* globber in its own .o file and link it in later:*/ + +#define GLOBBER_VERSION 0.5.0 + +int globber(void *address,char *input,int (*operate)(char *),char *filter); +int glob_clear_options(void *address); +void *globber_create(void); +void *globber_destroy(void *); +int glob_set_options(void *address,int options); +int glob_set_type(void *address,int type); +int glob_set_sizeL(void *address,long unsigned size); +int glob_set_sizeG(void *address,long unsigned size); +int glob_set_user(void *address,int user); +int glob_set_group(void *address,int group); +int glob_set_time(void *address,long unsigned month_t,long unsigned day_t, + long unsigned hour_t,long unsigned min_t); + +#ifdef __GLOBBER_INCLUDES__ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#ifdef HAVE_CONFIG_H +# include +#endif +#ifdef HAVE_SNPRINTF +# include "snprintf.h" +#endif +#ifdef DMALLOC +# include "dmalloc.h" +#endif +#endif /* __GLOBBER_C__ */ + + + +#define GLOBBER_RECURSIVE 0x01 +#define GLOBBER_VERBOSE 0x02 +#define GLOBBER_XDEV 0x04 +#define GLOBBER_SIZE 0x08 + +#define GLOBBER_MTIME 0x10 +#define GLOBBER_ATIME 0x20 +#define GLOBBER_CTIME 0x40 +/*GLOBBER_MTIME|GLOBBER_ATIME|GLOBBER_CTIME :*/ +#define GLOBBER_TIME 0x70 +#define GLOBBER_PERM 0x80 +#define GLOBBER_TYPE 0x100 +#define GLOBBER_USER 0x200 +#define GLOBBER_GROUP 0x400 +/* GLOBBER_XDEV | GLOBBER_SIZE | GLOBBER_TIME | GLOBBER_PERM | +* GLOBBER_TYPE | GLOBBER_USER | GLOBBER_GROUP : */ +#define GLOBBER_STAT 0xffc + + + + diff --git a/efinder/icons/block_dev.xpm b/efinder/icons/block_dev.xpm new file mode 100644 index 0000000..cdbf8a7 --- /dev/null +++ b/efinder/icons/block_dev.xpm @@ -0,0 +1,24 @@ +/* XPM */ +static char * block_dev_xpm[] = { +"16 16 5 1", +" s None c None", +". c #5555FF", +"X c #808080", +"o c #BBBBBB", +"O c #000000", +" ", +" ........... ", +" .XoooooXXX. ", +" .XoOOOOXXX.X ", +" .XoOXXoOXX.X ", +" .XoOXXoOXX.X ", +" .XoOoooOXX.X ", +" .XoOOOOXXX.X ", +" .XoOXXXOOX.X ", +" .XoOXXXoOX.X ", +" .XoOoooOOX.X ", +" .XoOOOOOXX.X ", +" .XXXXXXXXX.X ", +" ...........X ", +" XXXXXXXXXX ", +" "}; diff --git a/efinder/icons/char_dev.xpm b/efinder/icons/char_dev.xpm new file mode 100644 index 0000000..bd9060d --- /dev/null +++ b/efinder/icons/char_dev.xpm @@ -0,0 +1,61 @@ +/* XPM */ +static char * char_dev_xpm[] = { +"16 17 41 1", +" c None", +". c #980000", +"X c #8A0000", +"o c #C20000", +"O c #FF0606", +"+ c #FF0E0E", +"@ c #FF5555", +"# c #FE3535", +"$ c #FF6161", +"% c #F40000", +"& c #000000", +"* c #5E0000", +"= c #A50000", +"- c #BC0000", +"; c #C80101", +": c #ED0000", +"> c #DB0000", +", c #E10000", +"< c #3A0000", +"1 c #340000", +"2 c #FF2323", +"3 c #FE5353", +"4 c #FF1010", +"5 c #4E0000", +"6 c #950101", +"7 c #200000", +"8 c #780000", +"9 c #FF2525", +"0 c #620000", +"q c #AC0000", +"w c #FE3838", +"e c #830000", +"r c #D00000", +"t c #680000", +"y c #760000", +"u c #FF1919", +"i c #FE3131", +"p c #FF1E1E", +"a c #B10000", +"s c #440000", +"d c #550000", +" .X ", +" oO++@ ", +" @##$O% &&&&&& ", +"X%@@@@@&&&&&&& ", +"*=-o;&&&& ", +" ***&&&&:>@@@, ", +" <1&&&,@@2#34@ ", +" 56&7 8:@2294@.", +" 0%&& *-:@@@@%.", +" qw&& .e=orr;q*", +" @O&&&=*0ty8t0 ", +" @ui&&&t111111 ", +"6@up9&&& ", +"e%@@@&&&&&&&&& ", +" =;rras&&&&&&& ", +" s*00d ", +" 77 "}; diff --git a/efinder/icons/dir_close.xpm b/efinder/icons/dir_close.xpm new file mode 100644 index 0000000..24d109f --- /dev/null +++ b/efinder/icons/dir_close.xpm @@ -0,0 +1,25 @@ +/* XPM */ +static char *dir_close_xpm[] = { +/* width height num_colors chars_per_pixel */ +"16 16 5 1", +" c None", +". c #FFE79C", +"+ c #C6864A", +"@ c #FFC78C", +"# c #000000", +" ", +" ", +" ...+ ", +" @.@@@+ ", +" @@@@@@@@@@@@ ", +" @@...........# ", +" @.@@@@@@@@@@+# ", +" @.@@@@@@@@@@+# ", +" @.@@@@@@@@@@+# ", +" @.@@@@@@@@@@+# ", +" @.@@@@@@@@@@+# ", +" @.@@@@@@@@@@+# ", +" @.+++++++++++# ", +" ############# ", +" ", +" "}; diff --git a/efinder/icons/dir_open.xpm b/efinder/icons/dir_open.xpm new file mode 100644 index 0000000..9486602 --- /dev/null +++ b/efinder/icons/dir_open.xpm @@ -0,0 +1,29 @@ +/* XPM */ +static char *dir_open_xpm[] = { +/* width height num_colors chars_per_pixel */ +" 16 16 6 1", +/* colors */ +". c none", +"# c #ffe79c", +"a c #c6864a", +"b c #ffc78c", +"c c #000000", +"d c #0000ff", +/* pixels */ +"................", +"................", +"....###a........", +"...#bbbba.......", +"..#bbbbbb#####..", +".#baaaaaaaaaaac.", +".#baa##########.", +".#ba#bbbbbbbbbba", +".#ba#bbbbbbbbbba", +".#b#bbbbbbbbbbac", +".#b#bbbbbbbbbbac", +".##bbbbbbbbbbacc", +".#aaaaaaaaaaaac.", +"..ccccccccccccc.", +"................", +"................" +}; diff --git a/efinder/icons/exe.xpm b/efinder/icons/exe.xpm new file mode 100644 index 0000000..d9fb6d2 --- /dev/null +++ b/efinder/icons/exe.xpm @@ -0,0 +1,24 @@ +/* XPM */ +static char *exe_xpm[] = { +"16 16 5 1", +" c None", +". c #000000", +"X c #5555FF", +"o c #666666", +"O c #FFFFFE", +" ", +" ............. ", +" .XXXXXXXXXXX.o ", +" .XXXXXXXXXXX.o ", +" .............o ", +" .OOOOOOOOOOO.o ", +" .OOOOOOOOOOO.o ", +" .OOOOOOOOOOO.o ", +" .OOOOOOOOOOO.o ", +" .OOOOOOOOOOO.o ", +" .OOOOOOOOOOO.o ", +" .OOOOOOOOOOO.o ", +" .............o ", +" ooooooooooooo ", +" ", +" "}; diff --git a/efinder/icons/fifo.xpm b/efinder/icons/fifo.xpm new file mode 100644 index 0000000..8564d53 --- /dev/null +++ b/efinder/icons/fifo.xpm @@ -0,0 +1,24 @@ +/* XPM */ +static char * fifo_xpm[] = { +"16 16 5 1", +" s None c None", +". c #000000", +"X c #FFFF55", +"o c #5555FF", +"O c #BBBBBB", +" ", +"XX ... XXXXX", +"XX oo.oo XXXXX", +"XX oOo.oOo XXXXX", +"XX oOOoOOo XXXXX", +"XX ooOOOoo XXXXX", +"XX ooooooo XXXXX", +"XX ooooooo XXXXX", +"XX ooooooo XXXXX", +"XX ooooooo XXXXX", +"XX ooooooo XXXXX", +"XX ooooooo XXXXX", +"XX ooooo XXXXX", +"XX ooo XXXXX", +"XX ... XXXXX", +" "}; diff --git a/efinder/icons/go_down.xpm b/efinder/icons/go_down.xpm new file mode 100644 index 0000000..0ec2e76 --- /dev/null +++ b/efinder/icons/go_down.xpm @@ -0,0 +1,25 @@ +/* XPM */ +static char * go_down_xpm[] = { +"16 16 6 1", +" c none", +". c #FFFFFF", +"X c #A2A2A2", +"o c #000000", +"O c #595959", +"+ c #808080", +" +++++ ", +" OOOOO+ ", +" .ooooO+ ", +" .XXXoO+ ", +" .XXXoO+ ", +" .XXXoO+ ", +" .XXXoO+ ", +" .XXXoO+ ", +" +.XXXoO++++ ", +" OO.XXXoOOOO ", +" .oooXXXoooo ", +" .XXXXXXXo ", +" .XXXXXo ", +" .XXXo ", +" .Xo ", +" . "}; diff --git a/efinder/icons/go_to.xpm b/efinder/icons/go_to.xpm new file mode 100644 index 0000000..9176fc3 --- /dev/null +++ b/efinder/icons/go_to.xpm @@ -0,0 +1,25 @@ +/* XPM */ +static char * go_to_xpm[] = { +"16 16 6 1", +" c none", +". c #FFFFFF", +"X c #000000", +"o c #A2A2A2", +"O c #595959", +"+ c #808080", +" ", +" ", +" ", +" . ", +" .X ", +" .oX ", +" .........ooX ", +" .oooooooooooX ", +" .ooooooooooooXO", +" .oooooooooooXO+", +" .XXXXXXXXooXO+ ", +" OOOOOOO.oXO+ ", +" ++++++.XO+ ", +" .O+ ", +" O+ ", +" + "}; diff --git a/efinder/icons/help.xpm b/efinder/icons/help.xpm new file mode 100644 index 0000000..edb484e --- /dev/null +++ b/efinder/icons/help.xpm @@ -0,0 +1,26 @@ +/* XPM */ +static char * help_xpm[] = { +/* width height num_colors chars_per_pixel */ +"16 16 3 1", +/* colors */ +" c None", +". c #000000", +"X c #BBCCBB", +/* pixels */ +" ", +" .....X ", +" .. X..X ", +" ..X ... ", +" ..X ... ", +" X.. X..X ", +" ..X ", +" .. ", +" ..X ", +" ..X ", +" ", +" ..X ", +" ..X ", +" ..X ", +" XX ", +" ", +" "}; diff --git a/efinder/icons/page.xpm b/efinder/icons/page.xpm new file mode 100644 index 0000000..f317d3b --- /dev/null +++ b/efinder/icons/page.xpm @@ -0,0 +1,23 @@ +/* XPM */ +static char * page_xpm[] = { +"16 16 4 1", +" c None", +". c #000000", +"+ c #FFFFFE", +"@ c #808080", +" ", +" ........ ", +" .+++++.@. ", +" .+++++.+@. ", +" .+++++.++@. ", +" .+++++.....@ ", +" .++++++@@@.@ ", +" .+++++++++.@ ", +" .+++++++++.@ ", +" .+++++++++.@ ", +" .+++++++++.@ ", +" .+++++++++.@ ", +" .+++++++++.@ ", +" ...........@ ", +" @@@@@@@@@@@ ", +" "}; diff --git a/efinder/icons/page_lnk.xpm b/efinder/icons/page_lnk.xpm new file mode 100644 index 0000000..c8da8d8 --- /dev/null +++ b/efinder/icons/page_lnk.xpm @@ -0,0 +1,24 @@ +/* XPM */ +static char * page_lnk_xpm[] = { +"16 16 5 1", +" s None c None", +". c #000000", +"X c #FFFFFE", +"o c #808080", +"O c #5555FF", +" ", +" ........ ", +" .XXXXX.o. ", +" .XXXXX.Xo. ", +" .XXXXX.XXo. ", +" .XXXXX.....o ", +" .XXXXOOooo.o ", +" .XXXXOOOXX.o ", +" .XOOOOOOOX.o ", +" .XOOOOOOOX.o ", +" .XXXXOOOXX.o ", +" .XXXXOOXXX.o ", +" .XXXXXXXXX.o ", +" ...........o ", +" ooooooooooo ", +" "}; diff --git a/efinder/icons/sexe.xpm b/efinder/icons/sexe.xpm new file mode 100644 index 0000000..502521b --- /dev/null +++ b/efinder/icons/sexe.xpm @@ -0,0 +1,24 @@ +/* XPM */ +static char * sexe_xpm[] = { +"16 16 5 1", +" c None", +". c #000000", +"X c #5555FF", +"o c #BBBBBB", +"O c #FF5555", +" ", +" ............. ", +" .XXXXXXXXXXX.o ", +" .XXXXXXXXXXX.o ", +" .............o ", +" .OOOOOOOOOOO.o ", +" .OOOOOOOOOOO.o ", +" .OOOOOOOOOOO.o ", +" .OOOOOOOOOOO.o ", +" .OOOOOOOOOOO.o ", +" .OOOOOOOOOOO.o ", +" .OOOOOOOOOOO.o ", +" .............o ", +" ooooooooooooo ", +" ", +" "}; diff --git a/efinder/icons/socket.xpm b/efinder/icons/socket.xpm new file mode 100644 index 0000000..f618e3c --- /dev/null +++ b/efinder/icons/socket.xpm @@ -0,0 +1,23 @@ +/* XPM */ +static char * socket_xpm[] = { +"16 16 4 1", +" s None c None", +". c #5555FF", +"X c #1111EE", +"o c #000000", +" ", +" .X ", +" .X ", +" .X ", +" .X ", +" .X ", +" .X ", +" .XXXXXX ", +" .......X ", +" .X ", +" .X ", +" . .X ", +" ...X ", +" ..X ", +" .ooo ", +" "}; diff --git a/efinder/icons/up.xpm b/efinder/icons/up.xpm new file mode 100644 index 0000000..4bf5f16 --- /dev/null +++ b/efinder/icons/up.xpm @@ -0,0 +1,246 @@ +/* XPM */ +static char * up_xpm[] = { +"24 24 219 2", +" c None", +". c #050505", +"+ c #090909", +"@ c #080808", +"# c #080807", +"$ c #070707", +"% c #030303", +"& c #000000", +"* c #AEAEAA", +"= c #E3E4DC", +"- c #D4D5CC", +"; c #D4D4CB", +"> c #D3D3C9", +", c #CDCDC3", +"' c #D7D7CB", +") c #838379", +"! c #B8B8B3", +"~ c #DADACD", +"{ c #C9C9BC", +"] c #CECFC3", +"^ c #CDCDC1", +"/ c #DBDACE", +"( c #8E8E83", +"_ c #ACADA7", +": c #D3D4C8", +"< c #C5C4B9", +"[ c #C7C8BC", +"} c #C7C7BB", +"| c #AAAA9F", +"1 c #4B4B47", +"2 c #4C4C49", +"3 c #484844", +"4 c #474742", +"5 c #42423D", +"6 c #45463F", +"7 c #10100F", +"8 c #ABACA4", +"9 c #CDCEC2", +"0 c #BFC0B3", +"a c #C3C4B7", +"b c #C1C1B5", +"c c #C0C0B3", +"d c #C6C6B9", +"e c #D0D0C4", +"f c #D0D1C5", +"g c #D1D1C5", +"h c #D1D2C5", +"i c #CECEC2", +"j c #D9D9CC", +"k c #3C3C38", +"l c #A9AAA2", +"m c #CACABF", +"n c #BBBCB0", +"o c #BCBEB1", +"p c #C7C7BD", +"q c #D0D1C7", +"r c #CED0C6", +"s c #CDCEC5", +"t c #CCCCC3", +"u c #CBCCC3", +"v c #CBCDC3", +"w c #CCCDC3", +"x c #CDCDC4", +"y c #CDCEC4", +"z c #CDCEC3", +"A c #CBCCC2", +"B c #D6D7CC", +"C c #5E5F59", +"D c #151515", +"E c #21211F", +"F c #1D1D1C", +"G c #000001", +"H c #A1A19B", +"I c #C3C4B9", +"J c #B4B5AB", +"K c #BCBCB1", +"L c #FAFAF6", +"M c #FFFFFA", +"N c #FEFFF8", +"O c #FFFFF8", +"P c #FEFFF7", +"Q c #FFFFF7", +"R c #FEFFF6", +"S c #FDFEF6", +"T c #FDFEF5", +"U c #FCFDF4", +"V c #FBFCF2", +"W c #FAFAF0", +"X c #4D4E48", +"Y c #010101", +"Z c #9A9A93", +"` c #BDBEB2", +" . c #ADAFA2", +".. c #C6C7BE", +"+. c #FFFFF9", +"@. c #FCFCF1", +"#. c #FCFCF2", +"$. c #FCFDF2", +"%. c #FDFDF3", +"&. c #FDFDF4", +"*. c #FEFEF4", +"=. c #FEFFF5", +"-. c #30302C", +";. c #999992", +">. c #BABBB0", +",. c #A5A699", +"'. c #D9D9D3", +"). c #F7F8ED", +"!. c #F9FAEF", +"~. c #F9FAF0", +"{. c #FAFBF1", +"]. c #FBFCF1", +"^. c #FFFFF6", +"/. c #E4E5DA", +"(. c #95968F", +"_. c #B3B5A9", +":. c #A3A598", +"<. c #EAEAE4", +"[. c #F8F9EE", +"}. c #F3F4E8", +"|. c #F5F5EB", +"1. c #F5F6EB", +"2. c #F6F7EC", +"3. c #F7F7EC", +"4. c #F8F8EE", +"5. c #F6F6EB", +"6. c #88887F", +"7. c #020102", +"8. c #8B8B83", +"9. c #A9AB9E", +"0. c #ADAFA4", +"a. c #F3F3EC", +"b. c #ECEEE2", +"c. c #EDEFE3", +"d. c #EEEFE3", +"e. c #EFF0E6", +"f. c #F0F1E6", +"g. c #F0F1E7", +"h. c #F0F2E7", +"i. c #F1F2E7", +"j. c #F1F3E8", +"k. c #F2F4E8", +"l. c #F3F4E9", +"m. c #F4F5EA", +"n. c #232320", +"o. c #020202", +"p. c #86877F", +"q. c #9D9F94", +"r. c #C5C7BF", +"s. c #ECEDE5", +"t. c #E1E3D6", +"u. c #E4E6D9", +"v. c #E4E7DA", +"w. c #E5E7DB", +"x. c #E6E8DB", +"y. c #E7E8DD", +"z. c #E7E9DD", +"A. c #E8EADE", +"B. c #E9EBDF", +"C. c #EAECE0", +"D. c #EBECE1", +"E. c #EBEDE1", +"F. c #AFB1A5", +"G. c #82837C", +"H. c #D5D6CF", +"I. c #D9DCD0", +"J. c #D4D7CA", +"K. c #D7D9CD", +"L. c #D8DACD", +"M. c #D9DBCE", +"N. c #DADBCF", +"O. c #DBDCD0", +"P. c #DBDDD1", +"Q. c #DCDED2", +"R. c #DEDFD3", +"S. c #DEE0D4", +"T. c #DFE2D6", +"U. c #E0E3D6", +"V. c #E0E2D6", +"W. c #3E3F3A", +"X. c #797A72", +"Y. c #ABAEA3", +"Z. c #CFD2C9", +"`. c #C1C3B7", +" + c #C5C7BB", +".+ c #C7C8BF", +"++ c #C8CBC0", +"@+ c #C9CBC0", +"#+ c #CACDC2", +"$+ c #CBCEC3", +"%+ c #CDD0C3", +"&+ c #CED1C5", +"*+ c #D0D3C7", +"=+ c #D2D3C8", +"-+ c #D2D4C8", +";+ c #DDDED4", +">+ c #B1B3A8", +",+ c #010001", +"'+ c #6E6F68", +")+ c #C2C4BA", +"!+ c #C3C5BA", +"~+ c #BEC1B5", +"{+ c #BFC2B7", +"]+ c #BFC2B8", +"^+ c #C0C3B8", +"/+ c #C0C3B9", +"(+ c #C1C4B9", +"_+ c #C2C5B9", +":+ c #C4C6BA", +"<+ c #C4C6BB", +"[+ c #CACEC3", +"}+ c #353531", +"|+ c #121211", +"1+ c #252523", +"2+ c #232421", +"3+ c #242421", +"4+ c #232321", +"5+ c #1A1B18", +"6+ c #010100", +" ", +" ", +" ", +" ", +" . + + @ # $ $ % ", +" & * = - ; > , ' ) & ", +" & ! ~ { ] ] ^ / ( & ", +" & _ : < [ [ } ] | 1 2 2 3 4 4 4 5 6 7 ", +" & 8 9 0 a b 0 c d e f g e e g h i j k ", +" & l m n o p q r s t u v w x y z A B C D E F % ", +" G H I J K L M N O N P P P Q R S S T U V W M X ", +" Y Z ` ...+.@.@.@.#.$.$.$.$.%.%.&.&.*.=.T M -.", +" Y ;.>.,.'.P ).!.!.~.W W W W {.{.{.].].W ^./.% ", +" Y (._.:.<.[.}.|.1.1.1.2.2.3.).).4.[.[.5.O 6. ", +" 7.8.9.0.a.b.b.c.d.d.e.f.g.h.i.j.k.l.l.m.l.n. ", +" o.p.q.r.s.t.u.v.w.x.y.z.A.A.B.C.D.E.B.1.F.& ", +" o.G.q.H.I.J.K.L.M.N.O.P.Q.R.S.T.U.t.V.E.W. ", +" o.X.Y.Z.`. + +.+++@+#+$+%+&+*+=+: -+;+>+o. ", +" ,+'+)+!+~+{+{+{+{+]+^+^+/+(+_+!+:+<+[+}+ ", +" |+1+2+3+3+3+3+3+3+3+4+4+4+4+4+4+1+5+6+ ", +" ", +" ", +" ", +" "}; diff --git a/efinder/locale/hu.po b/efinder/locale/hu.po new file mode 100644 index 0000000..8f438f5 --- /dev/null +++ b/efinder/locale/hu.po @@ -0,0 +1,317 @@ +msgid "" +msgstr "" +"Project-Id-Version: \n" +"POT-Creation-Date: \n" +"PO-Revision-Date: 2005-02-09 11:22+0100\n" +"Last-Translator: Nemeth Otto \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: efinder.cpp:65 +#: efinder.cpp:322 +msgid "Permissions" +msgstr "Jogok" + +#: efinder.cpp:68 +msgid "Owner" +msgstr "Tulajdonos" + +#: efinder.cpp:71 +#: efinder.cpp:88 +#: efinder.cpp:105 +msgid "Read" +msgstr "Olvasás" + +#: efinder.cpp:74 +#: efinder.cpp:91 +#: efinder.cpp:108 +msgid "Write" +msgstr "Írás" + +#: efinder.cpp:77 +#: efinder.cpp:94 +#: efinder.cpp:111 +msgid "Execute" +msgstr "Futtatás" + +#: efinder.cpp:80 +msgid "Set UID" +msgstr "UID-bit" + +#: efinder.cpp:85 +msgid "Group" +msgstr "Csoport" + +#: efinder.cpp:97 +msgid "Set GID" +msgstr "GID-bit" + +#: efinder.cpp:102 +msgid "Other" +msgstr "Egyéb" + +#: efinder.cpp:114 +msgid "Sticky" +msgstr "Sticky" + +#: efinder.cpp:119 +msgid "&Close" +msgstr "B&ezárás" + +#: efinder.cpp:132 +msgid "Select directory" +msgstr "Könyvtár kiválasztása..." + +#: efinder.cpp:226 +#: efinder.cpp:231 +#: efinder.cpp:232 +msgid "Find" +msgstr "Keresés" + +#: efinder.cpp:236 +msgid "Path:" +msgstr "Útvonal:" + +#: efinder.cpp:243 +msgid "&Browse..." +msgstr "&Tallóz..." + +#: efinder.cpp:245 +msgid "Find path." +msgstr "" + +#: efinder.cpp:249 +msgid "File filter:" +msgstr "Fájl szűrés:" + +#: efinder.cpp:255 +msgid "Search subdirectories" +msgstr "Alkönyvtárakban is" + +#: efinder.cpp:260 +msgid "Limit results to first n files:" +msgstr "Lista korlátozása n darabra:" + +#: efinder.cpp:271 +msgid "Content" +msgstr "Tartalom" + +#: efinder.cpp:274 +msgid "Containing:" +msgstr "Tartalmaz:" + +#: efinder.cpp:279 +msgid "Case sensitive" +msgstr "Kis-/nagybetű számít" + +#: efinder.cpp:282 +msgid "Extended regexp" +msgstr "Reguláris kifejezés" + +#: efinder.cpp:295 +msgid "Filter options" +msgstr "Szűrési opciók" + +#: efinder.cpp:297 +msgid "Considerations" +msgstr "Fájl tulajdonságok" + +#: efinder.cpp:300 +msgid "File type:" +msgstr "Fájl típus:" + +#: efinder.cpp:302 +msgid "Any kind" +msgstr "Bármilyen" + +#: efinder.cpp:303 +msgid "Regular" +msgstr "Általános fájl" + +#: efinder.cpp:304 +msgid "Directory" +msgstr "Könyvtár" + +#: efinder.cpp:305 +msgid "Symlink" +msgstr "Szimbolikus link" + +#: efinder.cpp:306 +msgid "Socket" +msgstr "" + +#: efinder.cpp:307 +msgid "Block device" +msgstr "Blokk eszköz" + +#: efinder.cpp:308 +msgid "Character device" +msgstr "Karakteres eszköz" + +#: efinder.cpp:309 +msgid "FIFO" +msgstr "FIFO" + +#: efinder.cpp:315 +msgid "Stay on single filesystem" +msgstr "Más fájlrendszeren nem keres" + +#: efinder.cpp:325 +msgid "User/group:" +msgstr "Felh./csoport:" + +#: efinder.cpp:330 +msgid "User id:" +msgstr "Felh.:" + +#: efinder.cpp:336 +msgid "Group id:" +msgstr "Csoport:" + +#: efinder.cpp:344 +msgid "Size:" +msgstr "Méret:" + +#: efinder.cpp:351 +msgid "greater than:" +msgstr "nagyobb mint:" + +#: efinder.cpp:354 +msgid "and less than(KB):" +msgstr "kisebb mint (KB):" + +#: efinder.cpp:359 +msgid "Time:" +msgstr "Idő:" + +#: efinder.cpp:365 +msgid "Modified" +msgstr "Módosítva" + +#: efinder.cpp:368 +msgid "Changed" +msgstr "Változtatva:" + +#: efinder.cpp:371 +msgid "Accessed" +msgstr "Használva:" + +#: efinder.cpp:377 +msgid "in previous:" +msgstr "az előző:" + +#: efinder.cpp:389 +msgid "Minutes" +msgstr "Percben" + +#: efinder.cpp:392 +msgid "Hours" +msgstr "Órában" + +#: efinder.cpp:395 +msgid "Days" +msgstr "Napban" + +#: efinder.cpp:398 +msgid "Mounths" +msgstr "Hónapban" + +#: efinder.cpp:413 +msgid "Content options" +msgstr "Tartalom opciók" + +#: efinder.cpp:415 +msgid "General considerations" +msgstr "Tartalmi opciók" + +#: efinder.cpp:418 +msgid "Do not look into binary files" +msgstr "Ne keressen bináris fájlban" + +#: efinder.cpp:421 +msgid "Output count of matching lines" +msgstr "Talált sorok számolása" + +#: efinder.cpp:424 +msgid "Match anywhere" +msgstr "Bármilyen találat" + +#: efinder.cpp:428 +msgid "Match whole words only" +msgstr "Teljes szó találat" + +#: efinder.cpp:431 +msgid "Match whole lines only" +msgstr "Teljes sor találat" + +#: efinder.cpp:434 +msgid "Output files where no match is found" +msgstr "Fájlok megjelenítése melyben nincs találat" + +#: efinder.cpp:445 +msgid "About" +msgstr "Magamról" + +#: efinder.cpp:447 +msgid "" +"(C) Copyright 2000-2005. EDE Authors.\n" +"\n" +" Efinder is using the code from xfglob which is\n" +" (C) Copyright 2000-2001 by Edscott Wilson Garcia." +msgstr "" + +#: efinder.cpp:458 +msgid "Filename" +msgstr "Fájlnév" + +#: efinder.cpp:459 +msgid "Size" +msgstr "Méret" + +#: efinder.cpp:460 +msgid "Last modified" +msgstr "Utolsó módosítás" + +#: efinder.cpp:461 +msgid "Rights" +msgstr "Jogok" + +#: efinder.cpp:475 +msgid "&Find" +msgstr "Ke&resés" + +#: efinder.cpp:478 +msgid "Start the searching." +msgstr "Keresés megkezdése" + +#: efinder.cpp:480 +msgid "&Cancel" +msgstr "Mégs&em" + +#: efinder.cpp:483 +msgid "&Stop" +msgstr "Megállítá&s" + +#: efinder.cpp:485 +msgid "Stop the searching." +msgstr "Megállítja a keresést." + +#: eglob.cpp:446 +msgid "Search finished." +msgstr "Keresés befejezve." + +#: eglob.cpp:449 +msgid "Nothing found." +msgstr "Nincs találat." + +#: eglob.cpp:453 +#, c-format +msgid "Found %d files." +msgstr "%d találat." + +#: eglob.cpp:455 +msgid "Interrupted because maximum limit exceded." +msgstr "Megszakítva - elértem a fájllimitet." + diff --git a/efinder/locale/id.po b/efinder/locale/id.po new file mode 100644 index 0000000..2cccaeb --- /dev/null +++ b/efinder/locale/id.po @@ -0,0 +1,342 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR Free Software Foundation, Inc. +# FIRST AUTHOR , YEAR. +# +msgid "" +msgstr "" +"Project-Id-Version: efinder\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2005-02-04 12:29+0100\n" +"PO-Revision-Date: 2002-12-17 16:07+0700\n" +"Last-Translator: Bambang Purnomosidi D. P. \n" +"Language-Team: id \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=iso-8859-2\n" +"Content-Transfer-Encoding: 8bit\n" + +#: efinder.cpp:65 efinder.cpp:322 +msgid "Permissions" +msgstr "Permisi" + +#: efinder.cpp:68 +msgid "Owner" +msgstr "Pemilik" + +#: efinder.cpp:71 efinder.cpp:88 efinder.cpp:105 +msgid "Read" +msgstr "Baca" + +#: efinder.cpp:74 efinder.cpp:91 efinder.cpp:108 +msgid "Write" +msgstr "Tulis" + +#: efinder.cpp:77 efinder.cpp:94 efinder.cpp:111 +msgid "Execute" +msgstr "Eksekusi" + +#: efinder.cpp:80 +msgid "Set UID" +msgstr "Set UID" + +#: efinder.cpp:85 +msgid "Group" +msgstr "Grup" + +#: efinder.cpp:97 +msgid "Set GID" +msgstr "Set GID" + +#: efinder.cpp:102 +msgid "Other" +msgstr "Lainnya" + +#: efinder.cpp:114 +msgid "Sticky" +msgstr "Sticky" + +#: efinder.cpp:119 +msgid "&Close" +msgstr "&Tutup" + +#: efinder.cpp:132 +msgid "Select directory" +msgstr "Pilih direktori" + +#: efinder.cpp:226 efinder.cpp:231 efinder.cpp:232 +msgid "Find" +msgstr "Temukan" + +#: efinder.cpp:236 +msgid "Path:" +msgstr "Path:" + +#: efinder.cpp:243 +msgid "&Browse..." +msgstr "&Browse" + +#: efinder.cpp:245 +msgid "Find path." +msgstr "Temukan path." + +#: efinder.cpp:249 +msgid "File filter:" +msgstr "Filter file:" + +#: efinder.cpp:255 +msgid "Search subdirectories" +msgstr "Cari di subdirektori" + +#: efinder.cpp:260 +msgid "Limit results to first n files:" +msgstr "Batasi hasil untuk n file pertama:" + +#: efinder.cpp:271 +msgid "Content" +msgstr "Isi" + +#: efinder.cpp:274 +msgid "Containing:" +msgstr "Berisi:" + +#: efinder.cpp:279 +msgid "Case sensitive" +msgstr "Membedakan huruf besar dan kecil" + +#: efinder.cpp:282 +msgid "Extended regexp" +msgstr "Perluasan regexp" + +#: efinder.cpp:295 +msgid "Filter options" +msgstr "Pilihan filter" + +#: efinder.cpp:297 +msgid "Considerations" +msgstr "Pertimbangan" + +#: efinder.cpp:300 +msgid "File type:" +msgstr "Tipe file:" + +#: efinder.cpp:302 +msgid "Any kind" +msgstr "" + +#: efinder.cpp:303 +msgid "Regular" +msgstr "" + +#: efinder.cpp:304 +#, fuzzy +msgid "Directory" +msgstr "Pilih direktori" + +#: efinder.cpp:305 +msgid "Symlink" +msgstr "" + +#: efinder.cpp:306 +msgid "Socket" +msgstr "" + +#: efinder.cpp:307 +msgid "Block device" +msgstr "" + +#: efinder.cpp:308 +msgid "Character device" +msgstr "" + +#: efinder.cpp:309 +msgid "FIFO" +msgstr "" + +#: efinder.cpp:315 +msgid "Stay on single filesystem" +msgstr "Tinggal pada satu filesistem" + +#: efinder.cpp:325 +msgid "User/group:" +msgstr "Pemakai/grup" + +#: efinder.cpp:330 +msgid "User id:" +msgstr "id pemakai:" + +#: efinder.cpp:336 +msgid "Group id:" +msgstr "id grup:" + +#: efinder.cpp:344 +msgid "Size:" +msgstr "Ukuran" + +#: efinder.cpp:351 +msgid "greater than:" +msgstr "Lebih besar dari:" + +#: efinder.cpp:354 +msgid "and less than(KB):" +msgstr "dan lebih kecil dari(KB):" + +#: efinder.cpp:359 +msgid "Time:" +msgstr "Waktu:" + +#: efinder.cpp:365 +msgid "Modified" +msgstr "Dimodifikasi" + +#: efinder.cpp:368 +msgid "Changed" +msgstr "Diubah" + +#: efinder.cpp:371 +msgid "Accessed" +msgstr "Diakses" + +#: efinder.cpp:377 +msgid "in previous:" +msgstr "dalam sebelumnya:" + +#: efinder.cpp:389 +msgid "Minutes" +msgstr "Menit" + +#: efinder.cpp:392 +msgid "Hours" +msgstr "Jam" + +#: efinder.cpp:395 +msgid "Days" +msgstr "Hari" + +#: efinder.cpp:398 +msgid "Mounths" +msgstr "Bulan" + +#: efinder.cpp:413 +msgid "Content options" +msgstr "Pilihan isi" + +#: efinder.cpp:415 +msgid "General considerations" +msgstr "Pertimbangan umum" + +#: efinder.cpp:418 +msgid "Do not look into binary files" +msgstr "Jangan melihat isi file biner" + +#: efinder.cpp:421 +msgid "Output count of matching lines" +msgstr "Mengeluarkan jumlah baris yang sesuai" + +#: efinder.cpp:424 +msgid "Match anywhere" +msgstr "Cocok dimanapun" + +#: efinder.cpp:428 +msgid "Match whole words only" +msgstr "Cocok hanya seluruh kata" + +#: efinder.cpp:431 +msgid "Match whole lines only" +msgstr "Cocok hanya keseluruhan baris" + +#: efinder.cpp:434 +msgid "Output files where no match is found" +msgstr "Mengeluarkan file-file yang tidak ada kesesuaian ditemukan" + +#: efinder.cpp:445 +msgid "About" +msgstr "Tentang" + +#: efinder.cpp:447 +#, fuzzy +msgid "" +"(C) Copyright 2000-2005. EDE Authors.\n" +"\n" +" Efinder is using the code from xfglob which is\n" +" (C) Copyright 2000-2001 by Edscott Wilson Garcia." +msgstr "" +"(C) Hak cipta 2000-2002 oleh Martin Pekar. Program ini menggunakan kode dari " +"xfglob yang merupakan (C) Hak cipta 2000-2001 oleh Edscott Wilson Gracia." + +#: efinder.cpp:458 +msgid "Filename" +msgstr "Namafile" + +#: efinder.cpp:459 +msgid "Size" +msgstr "Ukuran" + +#: efinder.cpp:460 +msgid "Last modified" +msgstr "Dimodifikasi terakhir" + +#: efinder.cpp:461 +msgid "Rights" +msgstr "Hak" + +#: efinder.cpp:475 +msgid "&Find" +msgstr "&Temukan" + +#: efinder.cpp:478 +msgid "Start the searching." +msgstr "Memulai pencarian." + +#: efinder.cpp:480 +msgid "&Cancel" +msgstr "&Batal" + +#: efinder.cpp:483 +msgid "&Stop" +msgstr "&Stop" + +#: efinder.cpp:485 +msgid "Stop the searching." +msgstr "Stop pencarian." + +#: eglob.cpp:446 +msgid "Search finished." +msgstr "Pencarian selesai." + +#: eglob.cpp:449 +msgid "Nothing found." +msgstr "Tidak ada yang ditemukan." + +#: eglob.cpp:453 +#, c-format +msgid "Found %d files." +msgstr "Ditemukan %d file" + +#: eglob.cpp:455 +msgid "Interrupted because maximum limit exceded." +msgstr "Diinterupsi karena batas maksimum terlampaui." + +#~ msgid "Finder for Equinox Desktop Environment v. 1.0" +#~ msgstr "Finder untuk Equinox Desktop Environment v. 1.0" + +#~ msgid "" +#~ "This program is based in part on the work of FLTK project (www.fltk.org). " +#~ "This program is free software, you can redistribute it and/or modify it " +#~ "under the terms of GNU General Public License as published by the Free " +#~ "Software Foundation, either version 2 of the License, or (at your option) " +#~ "any later version. This program 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 General " +#~ "Public License for more details. You should have received a copy of the " +#~ "GNU General Public Licence along with this program; if not, write to the " +#~ "Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA." +#~ msgstr "" +#~ "Program ini berbasis pada hasil pekerjaan proyek FLTK (www.fltk.org). " +#~ "Program ini adalah free software, anda bisa mendistribusikan kembali dan/" +#~ "atau memodifikasinya dengan syarat-syarat yang diatur pada GNU General " +#~ "Public License, versi 2 atau versi yang lebih baru. Program ini " +#~ "didistribusikan dengan harapan akan berguna, tetapi TANPA JAMINAN; bahkan " +#~ "tanpa jaminan daya jual dan tujuan-tujuan tertentu. Lihat GNU General " +#~ "Public License untuk lebih jelasnya. Anda seharusnya telah menerima " +#~ "salinan GNU General Public License bersama dengan program ini; jikat " +#~ "tidak, silahkan minta ke Free Software Foundation, Inc., 675 Mass Ave, " +#~ "Cambridge, MA 02139, USA." diff --git a/efinder/locale/messages.pot b/efinder/locale/messages.pot new file mode 100644 index 0000000..5c6ba29 --- /dev/null +++ b/efinder/locale/messages.pot @@ -0,0 +1,314 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2005-07-22 10:29+0200\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=CHARSET\n" +"Content-Transfer-Encoding: 8bit\n" + +#: efinder/efinder.cpp:65 efinder/efinder.cpp:322 +msgid "Permissions" +msgstr "" + +#: efinder/efinder.cpp:68 +msgid "Owner" +msgstr "" + +#: efinder/efinder.cpp:71 efinder/efinder.cpp:88 efinder/efinder.cpp:105 +msgid "Read" +msgstr "" + +#: efinder/efinder.cpp:74 efinder/efinder.cpp:91 efinder/efinder.cpp:108 +msgid "Write" +msgstr "" + +#: efinder/efinder.cpp:77 efinder/efinder.cpp:94 efinder/efinder.cpp:111 +msgid "Execute" +msgstr "" + +#: efinder/efinder.cpp:80 +msgid "Set UID" +msgstr "" + +#: efinder/efinder.cpp:85 +msgid "Group" +msgstr "" + +#: efinder/efinder.cpp:97 +msgid "Set GID" +msgstr "" + +#: efinder/efinder.cpp:102 +msgid "Other" +msgstr "" + +#: efinder/efinder.cpp:114 +msgid "Sticky" +msgstr "" + +#: efinder/efinder.cpp:119 +msgid "&Close" +msgstr "" + +#: efinder/efinder.cpp:132 +msgid "Select directory" +msgstr "" + +#: efinder/efinder.cpp:226 efinder/efinder.cpp:231 efinder/efinder.cpp:232 +msgid "Find" +msgstr "" + +#: efinder/efinder.cpp:236 +msgid "Path:" +msgstr "" + +#: efinder/efinder.cpp:243 +msgid "&Browse..." +msgstr "" + +#: efinder/efinder.cpp:245 +msgid "Find path." +msgstr "" + +#: efinder/efinder.cpp:249 +msgid "File filter:" +msgstr "" + +#: efinder/efinder.cpp:255 +msgid "Search subdirectories" +msgstr "" + +#: efinder/efinder.cpp:260 +msgid "Limit results to first n files:" +msgstr "" + +#: efinder/efinder.cpp:271 +msgid "Content" +msgstr "" + +#: efinder/efinder.cpp:274 +msgid "Containing:" +msgstr "" + +#: efinder/efinder.cpp:279 +msgid "Case sensitive" +msgstr "" + +#: efinder/efinder.cpp:282 +msgid "Extended regexp" +msgstr "" + +#: efinder/efinder.cpp:295 +msgid "Filter options" +msgstr "" + +#: efinder/efinder.cpp:297 +msgid "Considerations" +msgstr "" + +#: efinder/efinder.cpp:300 +msgid "File type:" +msgstr "" + +#: efinder/efinder.cpp:302 +msgid "Any kind" +msgstr "" + +#: efinder/efinder.cpp:303 +msgid "Regular" +msgstr "" + +#: efinder/efinder.cpp:304 +msgid "Directory" +msgstr "" + +#: efinder/efinder.cpp:305 +msgid "Symlink" +msgstr "" + +#: efinder/efinder.cpp:306 +msgid "Socket" +msgstr "" + +#: efinder/efinder.cpp:307 +msgid "Block device" +msgstr "" + +#: efinder/efinder.cpp:308 +msgid "Character device" +msgstr "" + +#: efinder/efinder.cpp:309 +msgid "FIFO" +msgstr "" + +#: efinder/efinder.cpp:315 +msgid "Stay on single filesystem" +msgstr "" + +#: efinder/efinder.cpp:325 +msgid "User/group:" +msgstr "" + +#: efinder/efinder.cpp:330 +msgid "User id:" +msgstr "" + +#: efinder/efinder.cpp:336 +msgid "Group id:" +msgstr "" + +#: efinder/efinder.cpp:344 +msgid "Size:" +msgstr "" + +#: efinder/efinder.cpp:351 +msgid "greater than:" +msgstr "" + +#: efinder/efinder.cpp:354 +msgid "and less than(KB):" +msgstr "" + +#: efinder/efinder.cpp:359 +msgid "Time:" +msgstr "" + +#: efinder/efinder.cpp:365 +msgid "Modified" +msgstr "" + +#: efinder/efinder.cpp:368 +msgid "Changed" +msgstr "" + +#: efinder/efinder.cpp:371 +msgid "Accessed" +msgstr "" + +#: efinder/efinder.cpp:377 +msgid "in previous:" +msgstr "" + +#: efinder/efinder.cpp:389 +msgid "Minutes" +msgstr "" + +#: efinder/efinder.cpp:392 +msgid "Hours" +msgstr "" + +#: efinder/efinder.cpp:395 +msgid "Days" +msgstr "" + +#: efinder/efinder.cpp:398 +msgid "Mounths" +msgstr "" + +#: efinder/efinder.cpp:413 +msgid "Content options" +msgstr "" + +#: efinder/efinder.cpp:415 +msgid "General considerations" +msgstr "" + +#: efinder/efinder.cpp:418 +msgid "Do not look into binary files" +msgstr "" + +#: efinder/efinder.cpp:421 +msgid "Output count of matching lines" +msgstr "" + +#: efinder/efinder.cpp:424 +msgid "Match anywhere" +msgstr "" + +#: efinder/efinder.cpp:428 +msgid "Match whole words only" +msgstr "" + +#: efinder/efinder.cpp:431 +msgid "Match whole lines only" +msgstr "" + +#: efinder/efinder.cpp:434 +msgid "Output files where no match is found" +msgstr "" + +#: efinder/efinder.cpp:445 +msgid "About" +msgstr "" + +#: efinder/efinder.cpp:447 +msgid "" +"(C) Copyright 2000-2005. EDE Authors.\n" +"\n" +" Efinder is using the code from xfglob which is\n" +" (C) Copyright 2000-2001 by Edscott Wilson Garcia." +msgstr "" + +#: efinder/efinder.cpp:458 +msgid "Filename" +msgstr "" + +#: efinder/efinder.cpp:459 +msgid "Size" +msgstr "" + +#: efinder/efinder.cpp:460 +msgid "Last modified" +msgstr "" + +#: efinder/efinder.cpp:461 +msgid "Rights" +msgstr "" + +#: efinder/efinder.cpp:475 +msgid "&Find" +msgstr "" + +#: efinder/efinder.cpp:478 +msgid "Start the searching." +msgstr "" + +#: efinder/efinder.cpp:480 +msgid "&Cancel" +msgstr "" + +#: efinder/efinder.cpp:483 +msgid "&Stop" +msgstr "" + +#: efinder/efinder.cpp:485 +msgid "Stop the searching." +msgstr "" + +#: efinder/eglob.cpp:446 +msgid "Search finished." +msgstr "" + +#: efinder/eglob.cpp:449 +msgid "Nothing found." +msgstr "" + +#: efinder/eglob.cpp:453 +#, c-format +msgid "Found %d files." +msgstr "" + +#: efinder/eglob.cpp:455 +msgid "Interrupted because maximum limit exceded." +msgstr "" diff --git a/efinder/locale/ru.po b/efinder/locale/ru.po new file mode 100644 index 0000000..65b1aad --- /dev/null +++ b/efinder/locale/ru.po @@ -0,0 +1,320 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR Free Software Foundation, Inc. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2005-02-04 12:29+0100\n" +"PO-Revision-Date: 2002-11-28 HO:MI+ZONE\n" +"Last-Translator: aabbvv \n" +"Language-Team: RUSSIAN \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=koi8-r\n" +"Content-Transfer-Encoding: 8bit\n" + +#: efinder.cpp:65 efinder.cpp:322 +msgid "Permissions" +msgstr "" + +#: efinder.cpp:68 +msgid "Owner" +msgstr "" + +#: efinder.cpp:71 efinder.cpp:88 efinder.cpp:105 +msgid "Read" +msgstr "" + +#: efinder.cpp:74 efinder.cpp:91 efinder.cpp:108 +msgid "Write" +msgstr "" + +#: efinder.cpp:77 efinder.cpp:94 efinder.cpp:111 +msgid "Execute" +msgstr "" + +#: efinder.cpp:80 +msgid "Set UID" +msgstr "GID" + +#: efinder.cpp:85 +msgid "Group" +msgstr "" + +#: efinder.cpp:97 +msgid "Set GID" +msgstr "UID" + +#: efinder.cpp:102 +msgid "Other" +msgstr "" + +#: efinder.cpp:114 +msgid "Sticky" +msgstr "" + +#: efinder.cpp:119 +msgid "&Close" +msgstr "" + +#: efinder.cpp:132 +msgid "Select directory" +msgstr " " + +#: efinder.cpp:226 efinder.cpp:231 efinder.cpp:232 +msgid "Find" +msgstr "" + +#: efinder.cpp:236 +msgid "Path:" +msgstr ":" + +#: efinder.cpp:243 +msgid "&Browse..." +msgstr "..." + +#: efinder.cpp:245 +msgid "Find path." +msgstr " " + +#: efinder.cpp:249 +msgid "File filter:" +msgstr ":" + +#: efinder.cpp:255 +msgid "Search subdirectories" +msgstr " " + +#: efinder.cpp:260 +msgid "Limit results to first n files:" +msgstr " n :" + +#: efinder.cpp:271 +msgid "Content" +msgstr "" + +#: efinder.cpp:274 +msgid "Containing:" +msgstr ":" + +#: efinder.cpp:279 +msgid "Case sensitive" +msgstr " " + +#: efinder.cpp:282 +msgid "Extended regexp" +msgstr " " + +#: efinder.cpp:295 +msgid "Filter options" +msgstr " " + +#: efinder.cpp:297 +msgid "Considerations" +msgstr "" + +#: efinder.cpp:300 +msgid "File type:" +msgstr " :" + +#: efinder.cpp:302 +msgid "Any kind" +msgstr "" + +#: efinder.cpp:303 +msgid "Regular" +msgstr "" + +#: efinder.cpp:304 +#, fuzzy +msgid "Directory" +msgstr " " + +#: efinder.cpp:305 +msgid "Symlink" +msgstr "" + +#: efinder.cpp:306 +msgid "Socket" +msgstr "" + +#: efinder.cpp:307 +msgid "Block device" +msgstr "" + +#: efinder.cpp:308 +msgid "Character device" +msgstr "" + +#: efinder.cpp:309 +msgid "FIFO" +msgstr "" + +#: efinder.cpp:315 +msgid "Stay on single filesystem" +msgstr " " + +#: efinder.cpp:325 +msgid "User/group:" +msgstr ":" + +#: efinder.cpp:330 +msgid "User id:" +msgstr ":" + +#: efinder.cpp:336 +msgid "Group id:" +msgstr ":" + +#: efinder.cpp:344 +msgid "Size:" +msgstr ":" + +#: efinder.cpp:351 +msgid "greater than:" +msgstr " , :" + +#: efinder.cpp:354 +msgid "and less than(KB):" +msgstr " , :" + +#: efinder.cpp:359 +msgid "Time:" +msgstr ":" + +#: efinder.cpp:365 +msgid "Modified" +msgstr "Σ" + +#: efinder.cpp:368 +msgid "Changed" +msgstr "" + +#: efinder.cpp:371 +msgid "Accessed" +msgstr "" + +#: efinder.cpp:377 +msgid "in previous:" +msgstr " :" + +#: efinder.cpp:389 +msgid "Minutes" +msgstr "" + +#: efinder.cpp:392 +msgid "Hours" +msgstr "" + +#: efinder.cpp:395 +msgid "Days" +msgstr "" + +#: efinder.cpp:398 +msgid "Mounths" +msgstr ":" + +#: efinder.cpp:413 +msgid "Content options" +msgstr " " + +#: efinder.cpp:415 +msgid "General considerations" +msgstr " " + +#: efinder.cpp:418 +msgid "Do not look into binary files" +msgstr " " + +#: efinder.cpp:421 +msgid "Output count of matching lines" +msgstr " " + +#: efinder.cpp:424 +msgid "Match anywhere" +msgstr " " + +#: efinder.cpp:428 +msgid "Match whole words only" +msgstr " " + +#: efinder.cpp:431 +msgid "Match whole lines only" +msgstr " " + +#: efinder.cpp:434 +msgid "Output files where no match is found" +msgstr " " + +#: efinder.cpp:445 +msgid "About" +msgstr " " + +#: efinder.cpp:447 +#, fuzzy +msgid "" +"(C) Copyright 2000-2005. EDE Authors.\n" +"\n" +" Efinder is using the code from xfglob which is\n" +" (C) Copyright 2000-2001 by Edscott Wilson Garcia." +msgstr "" +"(C) Copyright 2000-2002 by Martin Pekar. xfglob " +" (C) Copyright 2000-2001 Edscott Wilson Garcia." + +#: efinder.cpp:458 +msgid "Filename" +msgstr " " + +#: efinder.cpp:459 +msgid "Size" +msgstr "" + +#: efinder.cpp:460 +msgid "Last modified" +msgstr "Σ" + +#: efinder.cpp:461 +msgid "Rights" +msgstr "" + +#: efinder.cpp:475 +msgid "&Find" +msgstr "" + +#: efinder.cpp:478 +msgid "Start the searching." +msgstr " " + +#: efinder.cpp:480 +msgid "&Cancel" +msgstr "" + +#: efinder.cpp:483 +msgid "&Stop" +msgstr "" + +#: efinder.cpp:485 +msgid "Stop the searching." +msgstr " " + +#: eglob.cpp:446 +msgid "Search finished." +msgstr " ۣ." + +#: eglob.cpp:449 +msgid "Nothing found." +msgstr " " + +#: eglob.cpp:453 +#, c-format +msgid "Found %d files." +msgstr " : %d" + +#: eglob.cpp:455 +msgid "Interrupted because maximum limit exceded." +msgstr " - ." + +#~ msgid "Finder for Equinox Desktop Environment v. 1.0" +#~ msgstr " Equinox Desktop Environment v. 1.0" diff --git a/efinder/locale/sk.po b/efinder/locale/sk.po new file mode 100644 index 0000000..e5da8c1 --- /dev/null +++ b/efinder/locale/sk.po @@ -0,0 +1,337 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR Free Software Foundation, Inc. +# FIRST AUTHOR , YEAR. +# +msgid "" +msgstr "" +"Project-Id-Version: efinder\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2005-02-04 12:29+0100\n" +"PO-Revision-Date: 2002-10-13 12:50+0200\n" +"Last-Translator: Martin Pekar \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: efinder.cpp:65 efinder.cpp:322 +msgid "Permissions" +msgstr "Prístupové práva" + +#: efinder.cpp:68 +msgid "Owner" +msgstr "Vlastník" + +#: efinder.cpp:71 efinder.cpp:88 efinder.cpp:105 +msgid "Read" +msgstr "Čítanie" + +#: efinder.cpp:74 efinder.cpp:91 efinder.cpp:108 +msgid "Write" +msgstr "Zápis" + +#: efinder.cpp:77 efinder.cpp:94 efinder.cpp:111 +msgid "Execute" +msgstr "Spustenie" + +#: efinder.cpp:80 +msgid "Set UID" +msgstr "Nastaviť UID" + +#: efinder.cpp:85 +msgid "Group" +msgstr "Skupina" + +#: efinder.cpp:97 +msgid "Set GID" +msgstr "Nastaviť GID" + +#: efinder.cpp:102 +msgid "Other" +msgstr "Ostatní" + +#: efinder.cpp:114 +msgid "Sticky" +msgstr "Sticky" + +#: efinder.cpp:119 +msgid "&Close" +msgstr "&Zavrieť" + +#: efinder.cpp:132 +msgid "Select directory" +msgstr "Zvoliť adresár" + +#: efinder.cpp:226 efinder.cpp:231 efinder.cpp:232 +msgid "Find" +msgstr "Hľadať" + +#: efinder.cpp:236 +msgid "Path:" +msgstr "Cesta:" + +#: efinder.cpp:243 +msgid "&Browse..." +msgstr "&Hľadať..." + +#: efinder.cpp:245 +msgid "Find path." +msgstr "Hľadať cestu." + +#: efinder.cpp:249 +msgid "File filter:" +msgstr "Súborový filter:" + +#: efinder.cpp:255 +msgid "Search subdirectories" +msgstr "Prehľadávať podadresáre" + +#: efinder.cpp:260 +msgid "Limit results to first n files:" +msgstr "Limitovať výsledok na prvých n súborov:" + +#: efinder.cpp:271 +msgid "Content" +msgstr "Obsah" + +#: efinder.cpp:274 +msgid "Containing:" +msgstr "Obsahujúci:" + +#: efinder.cpp:279 +msgid "Case sensitive" +msgstr "Citlivý na veľkosť" + +#: efinder.cpp:282 +msgid "Extended regexp" +msgstr "Rozšírený regexp" + +#: efinder.cpp:295 +msgid "Filter options" +msgstr "Možnosti filtra" + +#: efinder.cpp:297 +msgid "Considerations" +msgstr "Kritériá" + +#: efinder.cpp:300 +msgid "File type:" +msgstr "Typ súboru:" + +#: efinder.cpp:302 +msgid "Any kind" +msgstr "" + +#: efinder.cpp:303 +msgid "Regular" +msgstr "" + +#: efinder.cpp:304 +#, fuzzy +msgid "Directory" +msgstr "Zvoliť adresár" + +#: efinder.cpp:305 +msgid "Symlink" +msgstr "" + +#: efinder.cpp:306 +msgid "Socket" +msgstr "" + +#: efinder.cpp:307 +msgid "Block device" +msgstr "" + +#: efinder.cpp:308 +msgid "Character device" +msgstr "" + +#: efinder.cpp:309 +msgid "FIFO" +msgstr "" + +#: efinder.cpp:315 +msgid "Stay on single filesystem" +msgstr "Zostať na samotnom súborovom systéme" + +#: efinder.cpp:325 +msgid "User/group:" +msgstr "Užívateľ/skupina:" + +#: efinder.cpp:330 +msgid "User id:" +msgstr "Užívateľské id:" + +#: efinder.cpp:336 +msgid "Group id:" +msgstr "Skupinové id:" + +#: efinder.cpp:344 +msgid "Size:" +msgstr "Veľkosť:" + +#: efinder.cpp:351 +msgid "greater than:" +msgstr "väčší ako:" + +#: efinder.cpp:354 +msgid "and less than(KB):" +msgstr "a menší ako(KB)" + +#: efinder.cpp:359 +msgid "Time:" +msgstr "Čas:" + +#: efinder.cpp:365 +msgid "Modified" +msgstr "Modifikovaný" + +#: efinder.cpp:368 +msgid "Changed" +msgstr "Zmenený" + +#: efinder.cpp:371 +msgid "Accessed" +msgstr "Pristúpený" + +#: efinder.cpp:377 +msgid "in previous:" +msgstr "v predchádzajúcich:" + +#: efinder.cpp:389 +msgid "Minutes" +msgstr "Minútach" + +#: efinder.cpp:392 +msgid "Hours" +msgstr "Hodinách" + +#: efinder.cpp:395 +msgid "Days" +msgstr "Dňoch" + +#: efinder.cpp:398 +msgid "Mounths" +msgstr "Mesiacoch" + +#: efinder.cpp:413 +msgid "Content options" +msgstr "Možnosti obsahu" + +#: efinder.cpp:415 +msgid "General considerations" +msgstr "Hlavné kritériá" + +#: efinder.cpp:418 +msgid "Do not look into binary files" +msgstr "Nepozerať sa do binárnych súborov" + +#: efinder.cpp:421 +msgid "Output count of matching lines" +msgstr "Zobraziť počet nájdených riadkov" + +#: efinder.cpp:424 +msgid "Match anywhere" +msgstr "Nájsť všetko" + +#: efinder.cpp:428 +msgid "Match whole words only" +msgstr "Nájsť iba celé slová" + +#: efinder.cpp:431 +msgid "Match whole lines only" +msgstr "Nájsť iba celé riadky" + +#: efinder.cpp:434 +msgid "Output files where no match is found" +msgstr "Zobraziť súbory v ktoré sa nezhodujú" + +#: efinder.cpp:445 +msgid "About" +msgstr "O programe" + +#: efinder.cpp:447 +msgid "" +"(C) Copyright 2000-2005. EDE Authors.\n" +"\n" +" Efinder is using the code from xfglob which is\n" +" (C) Copyright 2000-2001 by Edscott Wilson Garcia." +msgstr "" + +#: efinder.cpp:458 +msgid "Filename" +msgstr "Meno súboru" + +#: efinder.cpp:459 +msgid "Size" +msgstr "Veľkosť" + +#: efinder.cpp:460 +msgid "Last modified" +msgstr "Naposledy modifikované" + +#: efinder.cpp:461 +msgid "Rights" +msgstr "Práva" + +#: efinder.cpp:475 +msgid "&Find" +msgstr "&Hľadať" + +#: efinder.cpp:478 +msgid "Start the searching." +msgstr "Začať vyhľadávanie." + +#: efinder.cpp:480 +msgid "&Cancel" +msgstr "&Zrušiť" + +#: efinder.cpp:483 +msgid "&Stop" +msgstr "&Zastaviť" + +#: efinder.cpp:485 +msgid "Stop the searching." +msgstr "Zastaviť vyhľadávanie." + +#: eglob.cpp:446 +msgid "Search finished." +msgstr "Vyhľadávanie skončilo." + +#: eglob.cpp:449 +msgid "Nothing found." +msgstr "Nebolo nič nájdené." + +#: eglob.cpp:453 +#, c-format +msgid "Found %d files." +msgstr "Bolo nájdených %d súborov." + +#: eglob.cpp:455 +msgid "Interrupted because maximum limit exceded." +msgstr "Prerušené, pretože bol prekročený maximálny limit." + +#~ msgid "" +#~ "This program is based in part on the work of FLTK project (www.fltk.org). " +#~ "This program is free software, you can redistribute it and/or modify it " +#~ "under the terms of GNU General Public License as published by the Free " +#~ "Software Foundation, either version 2 of the License, or (at your option) " +#~ "any later version. This program 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 General " +#~ "Public License for more details. You should have received a copy of the " +#~ "GNU General Public Licence along with this program; if not, write to the " +#~ "Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA." +#~ msgstr "" +#~ "Tento program je z časti založený na práci projektu FLTK (www.fltk.org)." +#~ "Tento program je voľný softvér, môžete ho redistribuovať a/alebo " +#~ "modifikovať podľa podmienok licencie GNU General Public License " +#~ "publikovanej nadáciou the Free Software Foundation, buď verzie 2 tejto " +#~ "licencie, alebo (podľa vášho uváženia) ľubovoľnej novšej verzie. Tento " +#~ "program je distribuovaný v nádeji, že bude užitočný, ale BEZ AKEJKOĽVEK " +#~ "ZÁRUKY; dokonca bez obsiahnutej záruky OBCHODOVATEĽNOSTI alebo VÝHOD PRE " +#~ "URČITÝ ÚČEL. Ďalšie podrobnosti hľadajte v licencii GNU General Public " +#~ "License. S týmto programom by ste mali dostať kópiu licencie GNU General " +#~ "Public Licence; ak nie, napíšte do nadácie the Free Software Foundation, " +#~ "Inc., 675 Mass Ave, Cambridge, MA 02139, USA." diff --git a/eiconman/DesktopIcon.cpp b/eiconman/DesktopIcon.cpp new file mode 100644 index 0000000..e4b7e66 --- /dev/null +++ b/eiconman/DesktopIcon.cpp @@ -0,0 +1,436 @@ +/* + * $Id$ + * + * Eiconman, desktop and icon manager + * Part of Equinox Desktop Environment (EDE). + * Copyright (c) 2000-2007 EDE Authors. + * + * This program is licensed under terms of the + * GNU General Public License version 2 or newer. + * See COPYING for details. + */ + +#include "DesktopIcon.h" +#include "eiconman.h" +#include "Utils.h" + +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#define USE_SHAPE 1 + +#ifdef USE_SHAPE + #include +#endif + +// minimal icon size +#define ICONSIZE 48 + +// spaces around box in case of large/small icons +#define OFFSET_W 16 +#define OFFSET_H 16 + +// label offset from icon y()+h(), so selection box can be drawn nicely +#define LABEL_OFFSET 2 + + +void rename_cb(Fl_Widget*, void* d); + +Fl_Menu_Item icon_menu[] = { + {_(" &Open "), 0, 0}, + {_(" &Rename "), 0, rename_cb, 0}, + {_(" &Delete "), 0, 0, 0, FL_MENU_DIVIDER}, + {_(" &Properties "), 0, 0}, + {0} +}; + +Fl_Menu_Item icon_trash_menu[] = { + {_(" &Open "), 0, 0}, + {_(" &Properties "), 0, 0, 0, FL_MENU_DIVIDER}, + {_(" &Empty "), 0, 0}, + {0} +}; + +void rename_cb(Fl_Widget*, void* d) { + DesktopIcon* di = (DesktopIcon*)d; + EASSERT(di != NULL); + + const char* new_name = fl_input(_("New name"), di->label()); + if(!new_name) + return; + if(new_name[0] == '\0') + return; + di->rename(new_name); +} + +DesktopIcon::DesktopIcon(GlobalIconSettings* gs, IconSettings* is, int bg) : + Fl_Widget(is->x, is->y, ICONSIZE, ICONSIZE) { + + EASSERT(gs != NULL); + + lwidth = lheight = 0; + focus = false; + micon = NULL; + + /* + * GlobalIconSettings is shared from desktop so we only + * reference it. On other hand IconSettings is not shared + * and we must construct a copy from given parameter + */ + globals = gs; + + settings = new IconSettings; + settings->name = is->name; + settings->cmd = is->cmd; + settings->icon = is->icon; + settings->type = is->type; + settings->key_name= is->key_name; + settings->full_path = is->full_path; + + // x,y are not needed since x(), y() are filled with it + + // setting fonts is TODO :P +#if 0 + Fl::set_font((Fl_Font)20, "-windows-*-medium-r-*-*-14-*-*-*-*-*-*-*"); + labelfont((Fl_Font)20); +#endif + + label(settings->name.c_str()); + + imenu = new Fl_Menu_Button(0, 0, 0, 0); + if(settings->type == ICON_TRASH) + imenu->menu(icon_trash_menu); + else + imenu->menu(icon_menu); + + if(!settings->icon.empty()) { + const char* nn = settings->icon.c_str(); + + //edelib::String ipath = edelib::IconTheme::get(nn, edelib::ICON_SIZE_MEDIUM); + edelib::String ipath = edelib::IconTheme::get(nn, edelib::ICON_SIZE_HUGE); + if(!ipath.empty()) { + Fl_Image* img = Fl_Shared_Image::get(ipath.c_str()); + if(img) { + int img_w = img->w(); + int img_h = img->h(); + + // resize box if icon is larger + if(img_w > ICONSIZE || img_h > ICONSIZE) + size(img_w + OFFSET_W, img_h + OFFSET_H); + + image(img); + } else + EDEBUG(ESTRLOC ": Unable to load %s\n", ipath.c_str()); + } else + EDEBUG(ESTRLOC ": Got empty icon name ?!?\n"); + } + + fix_position(x(), y()); + + //Use desktop color as color for icon background + color(bg); + + align(FL_ALIGN_WRAP); + update_label_size(); +} + +DesktopIcon::~DesktopIcon() { + EDEBUG("DesktopIcon::~DesktopIcon()\n"); + + if(settings) + delete settings; + if(micon) + delete micon; + + delete imenu; +} + +void DesktopIcon::update_label_size(void) { + lwidth = globals->label_maxwidth; + lheight= 0; + + /* + * make sure current font size/type is set (internaly to fltk) + * so fl_measure() can correctly calculate label width and height + */ + int old = fl_font(); + int old_sz = fl_size(); + fl_font(labelfont(), labelsize()); + + fl_measure(label(), lwidth, lheight, align()); + + fl_font(old, old_sz); + + lwidth += 12; + lheight += 5; +} + +void DesktopIcon::fix_position(int X, int Y) { + int dx, dy, dw, dh; + Desktop::instance()->area(dx, dy, dw, dh); + + if(X < dx) + X = dx; + if(Y < dy) + Y = dy; + if(X + w() > dw) + X = (dx + dw) - w(); + if(Y + h() > dh) + Y = (dy + dh) - h(); + + position(X, Y); +} + +void DesktopIcon::drag(int x, int y, bool apply) { + if(!micon) { + micon = new MovableIcon(this); +#if USE_SHAPE + /* + * This is used to calculate correct window startup/ending + * position since icon is placed in the middle of the box. + * + * Opposite, window (shaped) will have small but noticeable 'jump off' and + * dropped icon position will not be at the exact place where was dropped. + */ + int ix, iy; + ix = iy = 0; + if(image()) { + ix = (w()/2) - (image()->w()/2); + iy = (h()/2) - (image()->h()/2); + } + + micon->position(micon->x() + ix, micon->y() + iy); +#endif + micon->show(); + } else { + EASSERT(micon != NULL); + + micon->position(x, y); + } + + if(apply) { +#if USE_SHAPE + int ix, iy; + ix = iy = 0; + if(image()) { + ix = (w()/2) - (image()->w()/2); + iy = (h()/2) - (image()->h()/2); + } + fix_position(micon->x() - ix, micon->y() - iy); +#else + fix_position(micon->x(), micon->y()); +#endif + delete micon; + micon = NULL; + } +} + +// Used only in Desktop::move_selection +int DesktopIcon::drag_icon_x(void) { + if(!micon) + return x(); + else + return micon->x(); +} + +// Used only in Desktop::move_selection +int DesktopIcon::drag_icon_y(void) { + if(!micon) + return y(); + else + return micon->y(); +} + +void DesktopIcon::rename(const char* str) { + if(!str) + return; + if(settings->name == str) + return; + + settings->name = str; + label(settings->name.c_str()); + update_label_size(); + redraw(); +} + +void DesktopIcon::fast_redraw(void) { + EASSERT(parent() != NULL && "Impossible !"); + + int wsz = w(); + int xpos = x(); + + if(lwidth > w()) { + wsz = lwidth + 4; + xpos = x() - 4; + } + + // LABEL_OFFSET + 2 include selection box line height too; same for xpos + parent()->damage(FL_DAMAGE_ALL, xpos, y(), wsz, h() + lheight + LABEL_OFFSET + 2); +} + +void DesktopIcon::draw(void) { + //draw_box(FL_UP_BOX, FL_BLACK); + + if(image() && (damage() & FL_DAMAGE_ALL)) { + Fl_Image* im = image(); + + // center image in the box + int ix = (w()/2) - (im->w()/2); + int iy = (h()/2) - (im->h()/2); + ix += x(); + iy += y(); + + im->draw(ix, iy); + + EDEBUG(ESTRLOC ": DesktopIcon icon redraw\n"); + } + + if(globals->label_draw && (damage() & (FL_DAMAGE_ALL | EDAMAGE_CHILD_LABEL))) { + int X = x() + w()-(w()/2)-(lwidth/2); + int Y = y() + h() + LABEL_OFFSET; + + Fl_Color old = fl_color(); + + if(!globals->label_transparent) { + fl_color(globals->label_background); + fl_rectf(X, Y, lwidth, lheight); + } + + int old_font = fl_font(); + int old_font_sz = fl_size(); + + // draw with icon's font + fl_font(labelfont(), labelsize()); + + // pseudo-shadow + fl_color(FL_BLACK); + fl_draw(label(), X+1, Y+1, lwidth, lheight, align(), 0, 0); + + fl_color(globals->label_foreground); + fl_draw(label(), X, Y, lwidth, lheight, align(), 0, 0); + + // restore old font + fl_font(old_font, old_font_sz); + + if(is_focused()) { + /* + * draw focused box on our way so later + * this can be used to draw customised boxes + */ + fl_color(globals->label_foreground); + fl_line_style(FL_DOT); + + fl_push_matrix(); + fl_begin_loop(); + fl_vertex(X,Y); + fl_vertex(X+lwidth,Y); + fl_vertex(X+lwidth,Y+lheight); + fl_vertex(X,Y+lheight); + fl_vertex(X,Y); + fl_end_loop(); + fl_pop_matrix(); + + // revert to default line style + fl_line_style(0); + } + + // revert to old color whatever that be + fl_color(old); + + EDEBUG(ESTRLOC ": DesktopIcon label redraw\n"); + } +} + +int DesktopIcon::handle(int event) { + switch(event) { + case FL_FOCUS: + case FL_UNFOCUS: + case FL_ENTER: + case FL_LEAVE: + return 1; + /* + * We have to handle FL_MOVE too, if want to get only once + * FL_ENTER when entered or FL_LEAVE when leaved. + */ + case FL_MOVE: + return 1; + case FL_PUSH: + if(Fl::event_button() == 3) { + // Fl_Menu_Item::popup() by default does not call callbacks + const Fl_Menu_Item* m = imenu->menu()->popup(Fl::event_x(), Fl::event_y()); + if(m && m->callback()) + m->do_callback(0, this); + } + return 1; + case FL_RELEASE: + if(Fl::event_clicks() > 0) + EDEBUG(ESTRLOC ": EXECUTE: %s\n", settings->cmd.c_str()); + return 1; + + case FL_DND_ENTER: + case FL_DND_DRAG: + case FL_DND_LEAVE: + return 1; + + case FL_DND_RELEASE: + EDEBUG(ESTRLOC ": FL_DND_RELEASE on icon\n"); + return 1; + case FL_PASTE: + EDEBUG(ESTRLOC ": FL_PASTE on icon with %s\n", Fl::event_text()); + return 1; + default: + break; + } + + return 0; +} + +MovableIcon::MovableIcon(DesktopIcon* ic) : Fl_Window(ic->x(), ic->y(), ic->w(), ic->h()), icon(ic), mask(0) { + EASSERT(icon != NULL); + + set_override(); + color(ic->color()); + + begin(); + /* + * Force box be same width/height as icon so it + * can fit inside masked window. + */ +#ifdef USE_SHAPE + Fl_Image* img = ic->icon_image(); + if(img) + icon_box = new Fl_Box(0, 0, img->w(), img->h()); + else + icon_box = new Fl_Box(0, 0, w(), h()); +#else + icon_box = new Fl_Box(0, 0, w(), h()); +#endif + icon_box->image(ic->icon_image()); + end(); +} + +MovableIcon::~MovableIcon() { + if(mask) + XFreePixmap(fl_display, mask); +} + +void MovableIcon::show(void) { + if(!shown()) + Fl_X::make_xid(this); + +#ifdef USE_SHAPE + if(icon->icon_image()) { + mask = create_mask(icon->icon_image()); + if(mask) + XShapeCombineMask(fl_display, fl_xid(this), ShapeBounding, 0, 0, mask, ShapeSet); + } +#endif +} diff --git a/eiconman/DesktopIcon.h b/eiconman/DesktopIcon.h new file mode 100644 index 0000000..7fcd08c --- /dev/null +++ b/eiconman/DesktopIcon.h @@ -0,0 +1,94 @@ +/* + * $Id$ + * + * Eiconman, desktop and icon manager + * Part of Equinox Desktop Environment (EDE). + * Copyright (c) 2000-2007 EDE Authors. + * + * This program is licensed under terms of the + * GNU General Public License version 2 or newer. + * See COPYING for details. + */ + +#ifndef __DESKTOPICON_H__ +#define __DESKTOPICON_H__ + +#include +#include +#include +#include +#include + +#include // Pixmap + +class GlobalIconSettings; +class IconSettings; +class MovableIcon; + +class Fl_Menu_Button; + +class DesktopIcon : public Fl_Widget { + private: + IconSettings* settings; + const GlobalIconSettings* globals; + + int lwidth; + int lheight; + bool focus; + + MovableIcon* micon; + + Fl_Menu_Button* imenu; + + void update_label_size(void); + void fix_position(int X, int Y); + + public: + DesktopIcon(GlobalIconSettings* gisett, IconSettings* isett, int bg); + ~DesktopIcon(); + + virtual void draw(void); + virtual int handle(int event); + + void drag(int x, int y, bool apply); + int drag_icon_x(void); + int drag_icon_y(void); + + /* + * This is 'enhanced' (in some sense) redraw(). Redrawing + * icon will not fully redraw label nor focus box, which laid outside + * icon box. It will use damage() on given region, but called from + * parent, so parent can redraw that region on itself (since label does + * not laid on any box) + * + * Alternative way would be to redraw whole parent, but it is pretty unneeded + * and slow. + */ + void fast_redraw(void); + + /* + * Here is implemented localy focus schema avoiding + * messy fltk one. Focus/unfocus is handled from Desktop. + */ + void do_focus(void) { focus = true; } + void do_unfocus(void) { focus = false; } + bool is_focused(void) { return focus; } + + Fl_Image* icon_image(void) { return image(); } + + void rename(const char* str); +}; + +class MovableIcon : public Fl_Window { + private: + DesktopIcon* icon; + Fl_Box* icon_box; + Pixmap mask; + + public: + MovableIcon(DesktopIcon* i); + ~MovableIcon(); + virtual void show(void); +}; + +#endif diff --git a/eiconman/Jamfile b/eiconman/Jamfile new file mode 100644 index 0000000..79b4679 --- /dev/null +++ b/eiconman/Jamfile @@ -0,0 +1,8 @@ +#LINKLIBS += -L/opt/ede/lib -ledelib -lao -lvorbis -lvorbisfile -lmad -L/usr/local/lib -lfltk2_images -lpng -lfltk2_images -ljpeg -lz -lfltk2 -L/usr/X11R6/lib -lX11 -lXi -lXinerama -lpthread -lm -lXext -lstdc++ ; + +LINKLIBS += -L/opt/ede/lib -ledelib -lao -lvorbis -lvorbisfile -lmad -L/usr/local/lib -L/usr/X11R6/lib -lfltk_images -lpng -lz -ljpeg -lfltk -ldl -lm -lXext -lX11 -lstdc++ ; + +C++FLAGS += -Wall -g3 -I/opt/ede/include ; + +Main eiconman : eiconman.cpp Utils.cpp Wallpaper.cpp DesktopIcon.cpp NotifyBox.cpp ; +Main test/notify : test/notify.cpp ; diff --git a/eiconman/NotifyBox.cpp b/eiconman/NotifyBox.cpp new file mode 100644 index 0000000..1a59670 --- /dev/null +++ b/eiconman/NotifyBox.cpp @@ -0,0 +1,114 @@ +/* + * $Id$ + * + * Eiconman, desktop and icon manager + * Part of Equinox Desktop Environment (EDE). + * Copyright (c) 2000-2007 EDE Authors. + * + * This program is licensed under terms of the + * GNU General Public License version 2 or newer. + * See COPYING for details. + */ + +#include "NotifyBox.h" +#include "eiconman.h" +#include + +#include +#include +#include + +#define MAX_LABEL_WIDTH 200 + +#define TIMEOUT (1.0f/60.0f) +#define TIME_SHOWN 3.0f + +NotifyBox::NotifyBox(int aw, int ah) : Fl_Window(0, 0, 10, 10) { + area_w = aw; + area_h = ah; + lwidth = lheight = 0; + is_shown = false; + + clear_border(); + set_non_modal(); + + begin(); + txt_box = new Fl_Box(0, 0, w(), h()); + txt_box->box(FL_BORDER_BOX); + txt_box->color(FL_WHITE); + txt_box->align(FL_ALIGN_WRAP); + end(); +} + +NotifyBox::~NotifyBox() { + EDEBUG("NotifyBox::~NotifyBox()\n"); +} + +void NotifyBox::update_label_size(void) { + lwidth = MAX_LABEL_WIDTH; + lheight= 0; + + fl_font(txt_box->labelfont(), txt_box->labelsize()); + fl_measure(txt_box->label(), lwidth, lheight, txt_box->align()); + + lwidth += 10; + lheight += 10; +} + +void NotifyBox::resize_all(void) { + update_label_size(); + + // center box + int x_pos = (area_w/2) - (lwidth/2); + resize(x_pos, 0, lwidth, lheight); + txt_box->resize(0, 0, w(), h()); +} + +void NotifyBox::show(void) { + if(shown()) + return; + + EDEBUG(ESTRLOC ": %i %i\n", x(), y()); + resize_all(); + + Fl_Window::show(); + is_shown = true; + Fl::add_timeout(TIME_SHOWN, visible_timeout_cb, this); +} + +void NotifyBox::hide(void) { + if(!shown()) + return; + + Fl_Window::hide(); + is_shown = false; + Fl::remove_timeout(visible_timeout_cb); + Fl::remove_timeout(animate_cb); +} + +void NotifyBox::label(const char* l) { + txt_box->label(l); + resize_all(); +} + +void NotifyBox::copy_label(const char* l) { + txt_box->copy_label(l); + resize_all(); +} + +const char* NotifyBox::label(void) { + return txt_box->label(); +} + +void NotifyBox::animate(void) { + if(y() > -lheight) { + position(x(), y() - 1); + Fl::repeat_timeout(TIMEOUT, animate_cb, this); + } else + hide(); +} + +void NotifyBox::visible_timeout(void) { + Fl::remove_timeout(visible_timeout_cb); + Fl::add_timeout(TIMEOUT, animate_cb, this); +} diff --git a/eiconman/NotifyBox.h b/eiconman/NotifyBox.h new file mode 100644 index 0000000..2ad3639 --- /dev/null +++ b/eiconman/NotifyBox.h @@ -0,0 +1,47 @@ +/* + * $Id$ + * + * Eiconman, desktop and icon manager + * Part of Equinox Desktop Environment (EDE). + * Copyright (c) 2000-2007 EDE Authors. + * + * This program is licensed under terms of the + * GNU General Public License version 2 or newer. + * See COPYING for details. + */ + +#ifndef __NOTIFYBOX_H__ +#define __NOTIFYBOX_H__ + +#include +#include + +class NotifyBox : public Fl_Window { + private: + bool is_shown; + int lwidth, lheight; + int area_w, area_h; + Fl_Box* txt_box; + void update_label_size(void); + void resize_all(void); + + public: + NotifyBox(int aw, int ah); + ~NotifyBox(); + + virtual void show(void); + virtual void hide(void); + bool shown(void) { return is_shown; } + + const char* label(void); + void label(const char* l); + void copy_label(const char* l); + + static void animate_cb(void* b) { ((NotifyBox*)b)->animate(); } + void animate(void); + + static void visible_timeout_cb(void* b) { ((NotifyBox*)b)->visible_timeout(); } + void visible_timeout(void); +}; + +#endif diff --git a/eiconman/Utils.cpp b/eiconman/Utils.cpp new file mode 100644 index 0000000..e74b73d --- /dev/null +++ b/eiconman/Utils.cpp @@ -0,0 +1,358 @@ +/* + * $Id$ + * + * Eiconman, desktop and icon manager + * Part of Equinox Desktop Environment (EDE). + * Copyright (c) 2000-2007 EDE Authors. + * + * This program is licensed under terms of the + * GNU General Public License version 2 or newer. + * See COPYING for details. + */ + +#include "Utils.h" +#include // CARD32 +#include +#include + +#include // strrchr, strncpy, strlen + +Atom _XA_NET_WORKAREA = 0; +Atom _XA_NET_WM_WINDOW_TYPE = 0; +Atom _XA_NET_WM_WINDOW_TYPE_DESKTOP = 0; +Atom _XA_NET_NUMBER_OF_DESKTOPS = 0; +Atom _XA_NET_CURRENT_DESKTOP = 0; +Atom _XA_NET_DESKTOP_NAMES = 0; +Atom _XA_XROOTPMAP_ID = 0; + +Atom _XA_EDE_DESKTOP_NOTIFY = 0; +Atom _XA_EDE_DESKTOP_NOTIFY_COLOR = 0; + +int overlay_x = 0; +int overlay_y = 0; +int overlay_w = 0; +int overlay_h = 0; + +Fl_Window* overlay_drawable = NULL; + +char dash_list[] = {1}; + +void init_atoms(void) { + _XA_NET_WORKAREA = XInternAtom(fl_display, "_NET_WORKAREA", False); + _XA_NET_WM_WINDOW_TYPE = XInternAtom(fl_display, "_NET_WM_WINDOW_TYPE", False); + _XA_NET_WM_WINDOW_TYPE_DESKTOP = XInternAtom(fl_display, "_NET_WM_WINDOW_TYPE_DESKTOP", False); + _XA_NET_NUMBER_OF_DESKTOPS = XInternAtom(fl_display, "_NET_NUMBER_OF_DESKTOPS", False); + _XA_NET_CURRENT_DESKTOP = XInternAtom(fl_display, "_NET_CURRENT_DESKTOP", False); + _XA_NET_DESKTOP_NAMES = XInternAtom(fl_display, "_NET_DESKTOP_NAMES", False); + _XA_XROOTPMAP_ID = XInternAtom(fl_display, "_XROOTPMAP_ID", False); + + _XA_EDE_DESKTOP_NOTIFY = XInternAtom(fl_display, "_EDE_DESKTOP_NOTIFY", False); + _XA_EDE_DESKTOP_NOTIFY_COLOR = XInternAtom(fl_display, "_EDE_DESKTOP_NOTIFY_COLOR", False); +} + +bool net_get_workarea(int& x, int& y, int& w, int &h) { + Atom real; + + int format; + unsigned long n, extra; + unsigned char* prop; + x = y = w = h = 0; + + int status = XGetWindowProperty(fl_display, RootWindow(fl_display, fl_screen), + _XA_NET_WORKAREA, 0L, 0x7fffffff, False, XA_CARDINAL, &real, &format, &n, &extra, (unsigned char**)&prop); + + if(status != Success) + return false; + + CARD32* val = (CARD32*)prop; + if(val) { + x = val[0]; + y = val[1]; + w = val[2]; + h = val[3]; + + XFree((char*)val); + return true; + } + + return false; +} + +void net_make_me_desktop(Fl_Window* w) { + /* + * xid() will return zero if window is not shown; + * make sure it is shown + */ + EASSERT(fl_xid(w)); + + /* + * Reminder for me (others possible): + * note '&_XA_NET_WM_WINDOW_TYPE_DESKTOP' conversion, since gcc will not report warning/error + * if placed '_XA_NET_WM_WINDOW_TYPE_DESKTOP' only. + * + * I lost two hours messing with this ! (gdb is unusefull in X world) + */ + XChangeProperty(fl_display, fl_xid(w), _XA_NET_WM_WINDOW_TYPE, XA_ATOM, 32, PropModeReplace, + (unsigned char*)&_XA_NET_WM_WINDOW_TYPE_DESKTOP, sizeof(Atom)); +} + +int net_get_workspace_count(void) { + Atom real; + int format; + unsigned long n, extra; + unsigned char* prop; + + int status = XGetWindowProperty(fl_display, RootWindow(fl_display, fl_screen), + _XA_NET_NUMBER_OF_DESKTOPS, 0L, 0x7fffffff, False, XA_CARDINAL, &real, &format, &n, &extra, + (unsigned char**)&prop); + + if(status != Success && !prop) + return -1; + + int ns = int(*(long*)prop); + XFree(prop); + return ns; +} + +// desktops are starting from 0 +int net_get_current_desktop(void) { + Atom real; + int format; + unsigned long n, extra; + unsigned char* prop; + + int status = XGetWindowProperty(fl_display, RootWindow(fl_display, fl_screen), + _XA_NET_CURRENT_DESKTOP, 0L, 0x7fffffff, False, XA_CARDINAL, &real, &format, &n, &extra, + (unsigned char**)&prop); + + if(status != Success && !prop) + return -1; + + int ns = int(*(long*)prop); + XFree(prop); + return ns; +} + +// call on this XFreeStringList(names) +int net_get_workspace_names(char**& names) { + // FIXME: add _NET_SUPPORTING_WM_CHECK and _NET_SUPPORTED ??? + XTextProperty wnames; + XGetTextProperty(fl_display, RootWindow(fl_display, fl_screen), &wnames, _XA_NET_DESKTOP_NAMES); + + // if wm does not understainds _NET_DESKTOP_NAMES this is not set + if(!wnames.nitems || !wnames.value) + return 0; + + int nsz; + + /* + * FIXME: Here should as alternative Xutf8TextPropertyToTextList since + * many wm's set UTF8_STRING property. Below is XA_STRING and for UTF8_STRING + * will fail. + */ + if(!XTextPropertyToStringList(&wnames, &names, &nsz)) { + XFree(wnames.value); + return 0; + } + + XFree(wnames.value); + return nsz; +} + +bool ede_get_desktop_notify(char* txt, int txt_len) { + XTextProperty names; + XGetTextProperty(fl_display, RootWindow(fl_display, fl_screen), &names, _XA_EDE_DESKTOP_NOTIFY); + if(!names.nitems || !names.value) + return false; + + char** vnames; + int nsz = 0; + if(!XTextPropertyToStringList(&names, &vnames, &nsz)) { + XFree(names.value); + return false; + } + + strncpy(txt, vnames[0], txt_len); + XFreeStringList(vnames); + return true; +} + +Fl_Color ede_get_desktop_notify_color(void) { + Atom real; + int format; + unsigned long n, extra; + unsigned char* prop; + + int status = XGetWindowProperty(fl_display, RootWindow(fl_display, fl_screen), + _XA_EDE_DESKTOP_NOTIFY_COLOR, 0L, 0x7fffffff, False, XA_CARDINAL, &real, &format, &n, &extra, + (unsigned char**)&prop); + + int color = FL_WHITE; + + if(status != Success && !prop) + return (Fl_Color)color; + + color = int(*(long*)prop); + XFree(prop); + + return (Fl_Color)color; +} + +#if 0 +int net_get_workspace_names(char** names) { + Atom nd = XInternAtom(fl_display, "_NET_DESKTOP_NAMES", False); + Atom utf8_str = XInternAtom(fl_display, "UTF8_STRING", False); + Atom real; + int format; + unsigned long n, extra; + unsigned char* prop; + + int status = XGetWindowProperty(fl_display, RootWindow(fl_display, fl_screen), + nd, 0L, 0x7fffffff, False, utf8_str, &real, &format, &n, &extra, (unsigned char**)&prop); + + if(status != Success && !prop) + return 0; + + int alloc = 0; + if(real == utf8_str && format == 8) { + const char* p = (const char*)prop; + for(int i = 0, s = 0; i < n && alloc < MAX_DESKTOPS; i++, alloc++) { + if(p[i] == '\0') { + EDEBUG("%c ", p[i]); + names[alloc] = strndup((p + s), i - s + 1); + s = i + 1; + } + } + } + + return alloc; +} +#endif + +void draw_overlay_rect(void) { + if(overlay_w <= 0 || overlay_h <= 0) + return; + + XSetDashes(fl_display, fl_gc, 0, dash_list, 1); + XSetLineAttributes(fl_display, fl_gc, 2, LineOnOffDash, CapButt, JoinMiter); + + XSetFunction(fl_display, fl_gc, GXxor); + XSetForeground(fl_display, fl_gc, 0xffffffff); + + Window ow; + if(overlay_drawable) + ow = fl_xid(overlay_drawable); + else + ow = fl_window; + XDrawRectangle(fl_display, ow, fl_gc, overlay_x, overlay_y, overlay_w-1, overlay_h-1); + + XSetFunction(fl_display, fl_gc, GXcopy); + + // set line to 0 again + XSetLineAttributes(fl_display, fl_gc, 0, LineOnOffDash, CapButt, JoinMiter); +} + +void draw_xoverlay(int x, int y, int w, int h) { + if(w < 0) { + x += w; + w = -w; + } else if(!w) + w = 1; + + if(h < 0) { + y += h; + h = -h; + } else if(!h) + h = 1; + + if(overlay_w > 0) { + if(x == overlay_x && y == overlay_y && w == overlay_w && h == overlay_h) + return; + draw_overlay_rect(); + } + + overlay_x = x; + overlay_y = y; + overlay_w = w; + overlay_h = h; + + draw_overlay_rect(); +} + +void clear_xoverlay(void) { + if(overlay_w > 0) { + draw_overlay_rect(); + overlay_w = 0; + } +} + +void set_xoverlay_drawable(Fl_Window* win) { + overlay_drawable = win; +} + +Pixmap create_mask(Fl_Image* img) { + if(!img) + return 0; + + // no alpha + if(img->d() != 4) + return 0; + + int iw = img->w(); + int ih = img->h(); + + unsigned char* xim_data = new unsigned char[((iw >> 3) + 8) * ih]; + + XImage* xim = XCreateImage(fl_display, fl_visual->visual, 1, ZPixmap, 0, (char*)xim_data, iw, ih, 8, 0); + if(!xim) { + delete [] xim_data; + return 0; + } + + const char* src = img->data()[0]; + unsigned char a; + + for(int y = 0; y < ih; y++) { + for(int x = 0; x < iw; x++) { + // jump rgb and pick alpha + src += 3; + a = *src++; + + if(a < 128) { + // these are transparent + XPutPixel(xim, x, y, 0); + } + else { + // these are opaque + XPutPixel(xim, x, y, 1); + } + } + } + + Window drawable = XCreateSimpleWindow(fl_display, RootWindow(fl_display, fl_screen), 0, 0, iw, + ih, 0, 0, BlackPixel(fl_display, fl_screen)); + + Pixmap pix = XCreatePixmap(fl_display, drawable, iw, ih, 1); + + XGCValues gcv; + gcv.graphics_exposures = False; + GC dgc = XCreateGC(fl_display, pix, GCGraphicsExposures, &gcv); + + XPutImage(fl_display, pix, dgc, xim, 0, 0, 0, 0, iw, ih); + + XDestroyWindow(fl_display, drawable); + XFreeGC(fl_display, dgc); + delete [] xim->data; + xim->data = 0; + XDestroyImage(xim); + + return pix; +} + +char* get_basename(const char* path) { + char* p = strrchr(path, '/'); + if(p) + return (p + 1); + + return (char*)path; +} diff --git a/eiconman/Utils.h b/eiconman/Utils.h new file mode 100644 index 0000000..66dd9b1 --- /dev/null +++ b/eiconman/Utils.h @@ -0,0 +1,53 @@ +/* + * $Id$ + * + * Eiconman, desktop and icon manager + * Part of Equinox Desktop Environment (EDE). + * Copyright (c) 2000-2007 EDE Authors. + * + * This program is licensed under terms of the + * GNU General Public License version 2 or newer. + * See COPYING for details. + */ + +#ifndef __UTILS_H__ +#define __UTILS_H__ + +#include +#include + +#include // Pixmap + +extern Atom _XA_NET_WORKAREA; +extern Atom _XA_NET_WM_WINDOW_TYPE; +extern Atom _XA_NET_WM_WINDOW_TYPE_DESKTOP; +extern Atom _XA_NET_NUMBER_OF_DESKTOPS; +extern Atom _XA_NET_CURRENT_DESKTOP; +extern Atom _XA_NET_DESKTOP_NAMES; +extern Atom _XA_XROOTPMAP_ID; + +// via XGetTextProperty/XSetTextProperty +extern Atom _XA_EDE_DESKTOP_NOTIFY; +// via XChangeProperty (prop = Fl_Color, sizeof(int)) +extern Atom _XA_EDE_DESKTOP_NOTIFY_COLOR; + +void init_atoms(void); + +int net_get_workspace_count(void); +int net_get_current_desktop(void); +bool net_get_workarea(int& x, int& y, int& w, int &h); +void net_make_me_desktop(Fl_Window* w); +int net_get_workspace_names(char**& names); + +bool ede_get_desktop_notify(char* txt, int txt_len); +Fl_Color ede_get_desktop_notify_color(void); + +void draw_xoverlay(int x, int y, int w, int h); +void clear_xoverlay(void); +void set_xoverlay_drawable(Fl_Window* win); + +Pixmap create_mask(Fl_Image* img); + +char* get_basename(const char* path); + +#endif diff --git a/eiconman/Wallpaper.cpp b/eiconman/Wallpaper.cpp new file mode 100644 index 0000000..03317a4 --- /dev/null +++ b/eiconman/Wallpaper.cpp @@ -0,0 +1,534 @@ +/* + * $Id$ + * + * Eiconman, desktop and icon manager + * Part of Equinox Desktop Environment (EDE). + * Copyright (c) 2000-2007 EDE Authors. + * + * This program is licensed under terms of the + * GNU General Public License version 2 or newer. + * See COPYING for details. + */ + +#include "Wallpaper.h" +#include "Utils.h" + +#include + +#include +#include +#include +#include + +#include // memcpy + +#define CALC_PIXEL(tmp, rshift, rmask, gshift, gmask, bshift, bmask) \ + tmp = 0; \ + if(rshift >= 0) \ + tmp |= (((int)r << rshift) & rmask); \ + else \ + tmp |= (((int)r >> (-rshift)) & rmask); \ +\ + if(gshift >= 0) \ + tmp |= (((int)g << gshift) & gmask); \ + else \ + tmp |= (((int)g >> (-gshift)) & gmask); \ +\ + if(bshift >= 0) \ + tmp |= (((int)b << bshift) & bmask); \ + else \ + tmp |= (((int)b >> (-bshift)) & bmask); + + +Pixmap create_xpixmap(Fl_Image* img, XImage* xim, Pixmap pix) { + if(!img) + return 0; + + if(xim) { + if(xim->data) { + delete [] xim->data; + xim->data = 0; + } + XDestroyImage(xim); + xim = 0; + } + + if(pix) + XFreePixmap(fl_display, pix); + + unsigned long rmask = fl_visual->visual->red_mask; + unsigned long gmask = fl_visual->visual->green_mask; + unsigned long bmask = fl_visual->visual->blue_mask; + unsigned long start_mask; + int start_shift; + int rshift = 0; + int gshift = 0; + int bshift = 0; + + if(fl_visual->depth == 24 || fl_visual->depth == 16) { + unsigned long n; + if(fl_visual->depth == 24) { + start_shift = 24; + start_mask = 0x80000000; + } else { + start_shift = 8; + start_mask = 0x8000; + } + + rshift = start_shift; + n = start_mask; + while(!(n & rmask)) { + n >>= 1; + rshift--; + } + + gshift = start_shift; + n = start_mask; + while(!(n & gmask)) { + n >>= 1; + gshift--; + } + + bshift = start_shift; + n = start_mask; + while(!(n & bmask)) { + n >>= 1; + bshift--; + } + } + + /* + * Figure out bitmap_pad and create image coresponding to the current + * display depth except for 8 bpp display + */ + int bitmap_pad = 0; + if(fl_visual->depth > 16) + bitmap_pad = 32; + else if(fl_visual->depth > 8) + bitmap_pad = 16; + else { + EWARNING(ESTRLOC ": Visual %i not supported\n", xim->bits_per_pixel); + + if(xim) { + if(xim->data) { + delete [] xim->data; + xim->data = 0; + } + XDestroyImage(xim); + xim = 0; + } + return 0; + } + + xim = XCreateImage(fl_display, fl_visual->visual, fl_visual->depth, ZPixmap, 0, 0, img->w(), img->h(), bitmap_pad, 0); + + int iw = img->w(); + int ih = img->h(); + int id = img->d(); + + bool msb = false; + if(ImageByteOrder(fl_display) == MSBFirst) + msb = true; + else + msb = false; + + unsigned int r, g, b, tmp; + unsigned char* dest = new unsigned char[iw * ih * id]; + unsigned char* destptr = dest; + unsigned char* src = (unsigned char*)img->data()[0]; + + if(xim->bits_per_pixel == 32) { + if(id == 3 || id == 4) { + for(int j = 0; j < ih; j++) { + for(int i = 0; i < iw; i++) { + r = *src++; + g = *src++; + b = *src++; + + if(id == 4) + src++; + + CALC_PIXEL(tmp, rshift, rmask, gshift, gmask, bshift, bmask); + + if(msb) { + // big endian + *destptr++ = (tmp & 0xff000000) >> 24; + *destptr++ = (tmp & 0xff0000) >> 16; + *destptr++ = (tmp & 0xff00) >> 8; + *destptr++ = (tmp & 0xff); + } else { + // little endian + *destptr++ = (tmp & 0xff); + *destptr++ = (tmp & 0xff00) >> 8; + *destptr++ = (tmp & 0xff0000) >> 16; + *destptr++ = (tmp & 0xff000000) >> 24; + } + } + } + } else { + for(int j = 0; j < ih; j++) { + for(int i = 0; i < iw; i++) { + r = *src++; + g = *src++; + b = *src++; + + if(msb) { + *destptr++ = 0; + *destptr++ = b; + *destptr++ = g; + *destptr++ = r; + } else { + *destptr++ = r; + *destptr++ = g; + *destptr++ = b; + *destptr++ = 0; + } + } + } + } + } else if(xim->bits_per_pixel == 24) { + if(id == 3 || id == 4) { + for(int j = 0; j < ih; j++) { + for(int i = 0; i < iw; i++) { + r = *src++; + g = *src++; + b = *src++; + + if(id == 4) + src++; + + CALC_PIXEL(tmp, rshift, rmask, gshift, gmask, bshift, bmask); + + if(msb) { + // big endian + *destptr++ = (tmp & 0xff0000) >> 16; + *destptr++ = (tmp & 0xff00) >> 8; + *destptr++ = (tmp & 0xff); + + } else { + // little endian + *destptr++ = (tmp & 0xff); + *destptr++ = (tmp & 0xff00) >> 8; + *destptr++ = (tmp & 0xff0000) >> 16; + } + } + } + } else { + for(int j = 0; j < ih; j++) { + for(int i = 0; i < iw; i++) { + r = *src++; + g = *src++; + b = *src++; + + if(msb) { + // big endian + *destptr++ = b; + *destptr++ = g; + *destptr++ = r; + } else { + // little endian + *destptr++ = r; + *destptr++ = g; + *destptr++ = b; + } + } + } + } + } else if(xim->bits_per_pixel == 16) { + if(id == 3 || id == 4) { + for(int j = 0; j < ih; j++) { + for(int i = 0; i < iw; i++) { + r = *src++; + g = *src++; + b = *src++; + + if(id == 4) + src++; + + CALC_PIXEL(tmp, rshift, rmask, gshift, gmask, bshift, bmask); + + if(msb) { + // big endian + *destptr++ = (tmp >> 8) & 0xff; + *destptr++ = (tmp & 0xff); + + } else { + // little endian + *destptr++ = (tmp & 0xff); + *destptr++ = (tmp >> 8) & 0xff; + } + } + } + } else { + for(int j = 0; j < ih; j++) { + for(int i = 0; i < iw; i++) { + r = *src >> 3; src++; + g = *src >> 2; src++; + b = *src >> 3; src++; + + *destptr++ = r << 11 | g << 5 | b; + } + } + } + } + + xim->data = (char*)dest; + + /* + * Creating another window as drawable is needed since fl_window (as drawable) can't be + * used here (valid only in draw()). + */ + Window drawable = XCreateSimpleWindow(fl_display, RootWindow(fl_display, fl_screen), 0, 0, iw, + ih, 0, 0, BlackPixel(fl_display, fl_screen)); + + pix = XCreatePixmap(fl_display, drawable, iw, ih, fl_visual->depth); + + /* + * The same applies as above; + * fl_gc can't be used here. + */ + XGCValues gcv; + gcv.graphics_exposures = False; + GC dgc = XCreateGC(fl_display, pix, GCGraphicsExposures, &gcv); + + XPutImage(fl_display, pix, dgc, xim, 0, 0, 0, 0, iw, ih); + + XDestroyWindow(fl_display, drawable); + XFreeGC(fl_display, dgc); + + return pix; +} + +#define PIXEL_POS(x, y, w, d) ((( (y) * (w)) + (x) ) * (d)) + +bool create_tile(Fl_Image* orig, Fl_RGB_Image*& copied, int X, int Y, int W, int H) { + if(orig->w() >= W && orig->h() >= H) + return false; + + int iw = orig->w(); + int ih = orig->h(); + int idepth = orig->d(); + int tx = X - (X % iw); + int ty = Y - (Y % ih); + int tw = W + tx; + int th = H + ty; + + unsigned char* dest = new unsigned char[tw * th * orig->d()]; + unsigned char* destptr = dest; + unsigned char* src = (unsigned char*)orig->data()[0]; + int ppos = 0; + // for bounds checks + int imax = iw * ih * idepth; + + if(idepth == 3 || idepth == 4) { + for(int j = 0, cj = 0; j < th; j++, cj++) { + if(cj > ih) cj = 0; + + for(int i = 0, ci = 0; i < tw; i++, ci++) { + if(ci > iw) ci = 0; + ppos = PIXEL_POS(ci, cj, iw, idepth); + if(ppos > imax) ppos = imax; + + *destptr++ = src[ppos]; + *destptr++ = src[ppos + 1]; + *destptr++ = src[ppos + 2]; + + if(idepth == 4) + *destptr++ = src[ppos + 3]; + } + } + } else if(idepth == 2) { + for(int j = 0, cj = 0; j < th; j++, cj++) { + if(cj > ih) cj = 0; + + for(int i = 0, ci = 0; i < tw; i++, ci++) { + if(ci > iw) ci = 0; + ppos = PIXEL_POS(ci, cj, iw, idepth); + if(ppos > imax) ppos = imax; + + *destptr++ = src[ppos]; + *destptr++ = src[ppos + 1]; + } + } + } else { + for(int j = 0, cj = 0; j < th; j++, cj++) { + if(cj > ih) cj = 0; + + for(int i = 0, ci = 0; i < tw; i++, ci++) { + if(ci > iw) ci = 0; + ppos = PIXEL_POS(ci, cj, iw, idepth); + if(ppos > imax) ppos = imax; + + *destptr++ = src[ppos]; + } + } + } + + Fl_RGB_Image* c = new Fl_RGB_Image(dest, tw, th, idepth, orig->ld()); + c->alloc_array = 1; + copied = c; + + return true; +} + +Wallpaper::Wallpaper(int X, int Y, int W, int H) : + Fl_Box(X, Y, W, H, 0), rootpmap_image(NULL), rootpmap_pixmap(0), tiled(false) { +} + +Wallpaper::~Wallpaper() { + if(rootpmap_image) { + if(rootpmap_image->data) + delete [] rootpmap_image->data; + XDestroyImage(rootpmap_image); + } + + if(rootpmap_pixmap) + XFreePixmap(fl_display, rootpmap_pixmap); +} + +bool Wallpaper::set(const char* path) { + EASSERT(path != NULL); + + tiled = false; + + Fl_Image* i = Fl_Shared_Image::get(path); + if(!i) + return false; + image(i); + + set_rootpmap(); + + return true; +} + +bool Wallpaper::set_tiled(const char* path) { + EASSERT(path != NULL); + + Fl_Image* i = Fl_Shared_Image::get(path); + if(!i) + return false; + + Fl_RGB_Image* res = 0; + if(create_tile(i, res, x(), y(), w(), h())) { + image(res); + tiled = true; + + set_rootpmap(); + + return true; + } + else { + EWARNING(ESTRLOC ": Unable to create tiles for %s\n", path); + tiled = false; + } + + return false; +} + +void Wallpaper::set_rootpmap(void) { + if(!image()) + return; + + rootpmap_pixmap = create_xpixmap(image(), rootpmap_image, rootpmap_pixmap); + + if(!rootpmap_pixmap) + return; + + XChangeProperty(fl_display, RootWindow(fl_display, fl_screen), + _XA_XROOTPMAP_ID, XA_PIXMAP, 32, PropModeReplace, (unsigned char *)&rootpmap_pixmap, 1); + +#if 0 + XGCValues gcv; + gcv.graphics_exposures = False; + GC dgc = XCreateGC(fl_display, pix, GCGraphicsExposures, &gcv); + + XImage img; + img.byte_order = LSBFirst; // TODO: check + img.format = ZPixmap; + img.depth = fl_visual->depth; // depth of screen or depth of image() ? + + // find out bits_per_pixel field + int num_pfv; + XPixmapFormatValues* pfv = 0; + XPixmapFormatValues* pfvlst = 0; + pfvlst = XListPixmapFormats(fl_display, &num_pfv); + for(pfv = pfvlst; pfv < pfvlst + num_pfv; pfv++) { + if(pfv->depth == fl_visual->depth) + break; + } + + img.bits_per_pixel = pfv->bits_per_pixel; + if(img.bits_per_pixel & 7) { + EWARNING("Can't work with %i bpp !!!\n", img.bits_per_pixel); + return; + } +#endif +} + +void Wallpaper::draw(void) { + if(!image()) + return; + + int ix, iy, iw, ih; + Fl_Image* im = image(); + + iw = im->w(); + ih = im->h(); + + if(iw == 0 || ih == 0) + return; + + if(!tiled) { + // center image in the box + ix = (w()/2) - (iw/2); + iy = (h()/2) - (ih/2); + ix += x(); + iy += y(); + } else { + ix = x(); + iy = y(); + } + + ix = x(); + iy = y(); + + im->draw(ix, iy); + + /* + * For debugging purposes :) + * Uncommenting this (and removing GC/Window creation in create_xpixmap + * will draw _XA_XROOTPMAP_ID Pixmap directly in Wallpaper widget. + * It is used to check Fl_Image->Image conversion. + */ +#if 0 + if(global_xim) { + Pixmap pix = fl_create_offscreen(image()->w(), image()->h()); + fl_begin_offscreen(pix); + XPutImage(fl_display, pix, fl_gc, global_xim, 0, 0, 0, 0, image()->w(), image()->h()); + fl_end_offscreen(); + + fl_copy_offscreen(ix, iy, image()->w(), image()->h(), pix, 0, 0); + + XChangeProperty(fl_display, RootWindow(fl_display, fl_screen), + _XA_XROOTPMAP_ID, XA_PIXMAP, 32, PropModeReplace, (unsigned char *)&pix, 1); + + } +#endif +} + +int Wallpaper::handle(int event) { + switch(event) { + /* + * Route all DND events to parent (desktop), otherwise + * desktop will not get them if Wallpaper is visible + */ + case FL_DND_ENTER: + case FL_DND_DRAG: + case FL_DND_LEAVE: + case FL_DND_RELEASE: + case FL_PASTE: + return parent()->handle(event); + } + + return 0; +} diff --git a/eiconman/Wallpaper.h b/eiconman/Wallpaper.h new file mode 100644 index 0000000..b671c0a --- /dev/null +++ b/eiconman/Wallpaper.h @@ -0,0 +1,41 @@ +/* + * $Id$ + * + * Eiconman, desktop and icon manager + * Part of Equinox Desktop Environment (EDE). + * Copyright (c) 2000-2007 EDE Authors. + * + * This program is licensed under terms of the + * GNU General Public License version 2 or newer. + * See COPYING for details. + */ + +#ifndef __WALLPAPER_H__ +#define __WALLPAPER_H__ + +#include + +#include // XImage, Pixmap + +/* + * Class responsible for displaying images at background + * their scaling (TODO), caching(TODO) and making coffee at spear time. + */ +class Wallpaper : public Fl_Box { + private: + XImage* rootpmap_image; + Pixmap rootpmap_pixmap; + bool tiled; + void set_rootpmap(void); + + public: + Wallpaper(int X, int Y, int W, int H); + ~Wallpaper(); + + bool set(const char* path); + bool set_tiled(const char* path); + virtual void draw(void); + virtual int handle(int event); +}; + +#endif diff --git a/eiconman/eiconman.conf b/eiconman/eiconman.conf new file mode 100644 index 0000000..0bdacb6 --- /dev/null +++ b/eiconman/eiconman.conf @@ -0,0 +1,28 @@ +[Desktop] + Color = 45 + WallpaperUse = 0 + Wallpaper = /home/foo/xxx/baz/tax + +[Icons] + Label Background = 827223040 + Label Foreground = 7 + Label Fontsize = 10 + Label Maxwidth = 55 + Label Transparent = 1 + Label Visible = 1 + Gridspacing = 10 + OneClickExec = 0 + AutoArrange = 1 + +[Demo folder] + X = 20 + Y = 151 + +[Home.desktop] + X = 113 + Y = 16 + +[trash.desktop] + X = 20 + Y = 20 + diff --git a/eiconman/eiconman.conf.old b/eiconman/eiconman.conf.old new file mode 100644 index 0000000..a27530e --- /dev/null +++ b/eiconman/eiconman.conf.old @@ -0,0 +1,32 @@ +# general settings for desktop +[Desktop] + Color=35 + WallpaperUse=0 + Wallpaper=/home/sanel/wallpapers/Abaddon.png + +# general settings for icons on desktop +[Icons] + Label Foreground=7 + Gridspacing=10 + OneClickExec=0 + Label Transparent=True + Label Background=216 + AutoArrange=0 + Label Maxwidth=55 + Label Fontsize=10 + +# positions of each icon on desktop (if icon is visible) + + + +[Home.desktop] + X=13 + Y=8 + +[System.desktop] + X=12 + Y=212 + +[trash.desktop] + X=15 + Y=106 diff --git a/eiconman/eiconman.cpp b/eiconman/eiconman.cpp new file mode 100644 index 0000000..2b95953 --- /dev/null +++ b/eiconman/eiconman.cpp @@ -0,0 +1,1035 @@ +/* + * $Id$ + * + * Eiconman, desktop and icon manager + * Part of Equinox Desktop Environment (EDE). + * Copyright (c) 2000-2007 EDE Authors. + * + * This program is licensed under terms of the + * GNU General Public License version 2 or newer. + * See COPYING for details. + */ + +#include "eiconman.h" +#include "DesktopIcon.h" +#include "Utils.h" +#include "Wallpaper.h" +#include "NotifyBox.h" + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#if 0 +#include +#endif + +#include +#include // rand, srand +#include // time + +#define CONFIG_NAME "eiconman.conf" + + +#define SELECTION_SINGLE (Fl::event_button() == 1) +#define SELECTION_MULTI (Fl::event_button() == 1 && (Fl::event_key(FL_Shift_L) || Fl::event_key(FL_Shift_R))) + +#define MIN(x,y) ((x) < (y) ? (x) : (y)) +#define MAX(x,y) ((x) > (y) ? (x) : (y)) + +/* + * Which widgets Fl::belowmouse() should skip. This should be updated + * when new non-icon child is added to Desktop window. + */ +#define NOT_SELECTABLE(widget) ((widget == this) || (widget == wallpaper) || (widget == dmenu)) + +Fl_Menu_Item desktop_menu[] = { + {_(" &New desktop item "), 0, 0, 0, FL_SUBMENU}, + {_(" &Application... "), 0, 0}, + {_(" &Directory... "), 0, 0}, + {_(" &URL... "), 0, 0}, + {_(" &Link... "), 0, 0}, + {0}, + {_(" &Arrange "), 0, 0, 0, FL_SUBMENU | FL_MENU_DIVIDER}, + {_(" &By name "), 0, 0}, + {_(" &Vertical line up "), 0, 0}, + {_(" &Horizontal line up "), 0, 0}, + {0}, + {_(" &Copy "), 0, 0}, + {_(" &Paste "), 0, 0, 0, FL_MENU_DIVIDER}, + {_(" &Icons settings... "), 0, 0}, + {_(" &Background... "), 0, 0}, + {0} +}; + + +#if 0 +XserverRegion xregion; +XserverRegion xpart; +Damage xdamage; +int xevent_base, xerror_base; +#endif + +Desktop* Desktop::pinstance = NULL; +bool running = false; + +inline unsigned int random_pos(int max) { + return (rand() % max); +} + +inline bool intersects(int x1, int y1, int w1, int h1, int x2, int y2, int w2, int h2) { + return (MAX(x1, x2) <= MIN(w1, w2) && + MAX(y1, y2) <= MIN(h1, h2)); +} + +// assume fl_open_display() is called before +inline void dpy_sizes(int& width, int& height) { + width = DisplayWidth(fl_display, fl_screen); + height = DisplayHeight(fl_display, fl_screen); +} + +void exit_signal(int signum) { + EDEBUG(ESTRLOC ": Exiting (got signal %d)\n", signum); + running = false; +} + +void restart_signal(int signum) { + EDEBUG(ESTRLOC ": Restarting (got signal %d)\n", signum); +} + +int desktop_xmessage_handler(int event) { +#if 0 + if(fl_xevent->type == xevent_base + XDamageNotify) { + XDamageNotifyEvent* xdev = (XDamageNotifyEvent*)fl_xevent; + + EDEBUG(ESTRLOC ": Damaged region %i %i %i %i on 0x%lx\n", xdev->area.x, xdev->area.y, + xdev->area.width, xdev->area.height, xdev->drawable); + + //XDamageSubtract(fl_display, xdev->damage, None, None); + XFixesSetRegion(fl_display, xpart, &xdev->area, 1); + XFixesUnionRegion(fl_display, xregion, xregion, xpart); + } + + XDamageSubtract(fl_display, xdamage, xregion, None); + XFixesSetRegion(fl_display, xregion, 0, 0); +#endif + + if(fl_xevent->type == PropertyNotify) { + if(fl_xevent->xproperty.atom == _XA_NET_CURRENT_DESKTOP) { + Desktop::instance()->notify_desktop_changed(); + return 1; + } + + if(fl_xevent->xproperty.atom == _XA_EDE_DESKTOP_NOTIFY) { + char buff[256]; + if(ede_get_desktop_notify(buff, 256) && buff[0] != '\0') + Desktop::instance()->notify_box(buff, true); + return 1; + } + + if(fl_xevent->xproperty.atom == _XA_EDE_DESKTOP_NOTIFY_COLOR) { + Desktop::instance()->notify_box_color(ede_get_desktop_notify_color()); + return 1; + } + + if(fl_xevent->xproperty.atom == _XA_NET_WORKAREA) { + Desktop::instance()->update_workarea(); + return 1; + } + } + + return 0; +} + +Desktop::Desktop() : DESKTOP_WINDOW(0, 0, 100, 100, "") { + selection_x = selection_y = 0; + moving = false; + + selbox = new SelectionOverlay; + selbox->x = selbox->y = selbox->w = selbox->h = 0; + selbox->show = false; + + dsett = new DesktopSettings; + dsett->color = FL_GRAY; + dsett->wp_use = false; +} + +Desktop::~Desktop() { + EDEBUG("Desktop::~Desktop()\n"); + + delete dsett; + delete selbox; + delete notify; +} + +void Desktop::init_internals(void) { + init_atoms(); + update_workarea(); + + /* + * NOTE: order how childs are added is important. First + * non iconable ones should be added (wallpaper, menu, ...) + * then icons, so they can be drawn at top of them. + */ + begin(); + dmenu = new Fl_Menu_Button(0, 0, 0, 0); + dmenu->menu(desktop_menu); + + wallpaper = new Wallpaper(0, 0, w(), h()); + wallpaper->set("/home/sanel/wallpapers/katebig.jpg"); + //wallpaper->set_tiled("/home/sanel/wallpapers/katesmall.jpg"); + //wallpaper->set_tiled("/home/sanelz/walls/katesmall.jpg"); + //wallpaper->set_tiled("/home/sanelz/walls/kate.jpg"); + //wallpaper->set("/home/sanelz/walls/katebig.jpg"); + //wallpaper->hide(); + //wallpaper->set("/home/sanelz/walls/katesmall.jpg"); + //wallpaper->set("/home/sanelz/walls/nin/1024x768-04.jpg"); + //wallpaper->set("/home/sanelz/walls/nin/1024x768-02.jpg"); + end(); + + notify = new NotifyBox(w(), h()); + set_bg_color(dsett->color, false); + + read_config(); + + running = true; +} + +void Desktop::init(void) { + if(Desktop::pinstance != NULL) + return; + Desktop::pinstance = new Desktop(); + Desktop::pinstance->init_internals(); +} + +void Desktop::shutdown(void) { + if(Desktop::pinstance == NULL) + return; + + delete Desktop::pinstance; + Desktop::pinstance = NULL; +} + +Desktop* Desktop::instance(void) { + EASSERT(Desktop::pinstance != NULL && "Desktop::init() should be run first"); + return Desktop::pinstance; +} + +/* + * This function must be overriden so window can inform + * wm to see it as desktop. It will send data when window + * is created, but before is shown. + */ +void Desktop::show(void) { + if(!shown()) { + Fl_X::make_xid(this); + net_make_me_desktop(this); +#if 0 + XDamageQueryExtension(fl_display, &xevent_base, &xerror_base); + + xdamage = XDamageCreate(fl_display, fl_xid(this), XDamageReportBoundingBox); + xregion = XFixesCreateRegionFromWindow(fl_display, fl_xid(this), 0); + xpart = XFixesCreateRegionFromWindow(fl_display, fl_xid(this), 0); +#endif + } +} + +/* + * If someone intentionaly hide desktop + * then quit from it. + */ +void Desktop::hide(void) { + running = false; +} + +void Desktop::update_workarea(void) { + int X, Y, W, H; + if(!net_get_workarea(X, Y, W, H)) { + EWARNING(ESTRLOC ": wm does not support _NET_WM_WORKAREA; using screen sizes...\n"); + X = Y = 0; + dpy_sizes(W, H); + } + + resize(X, Y, W, H); +} + +void Desktop::set_bg_color(int c, bool do_redraw) { + if(color() == c) + return; + + dsett->color = c; + color(c); + if(do_redraw) + redraw(); +} + +void Desktop::read_config(void) { + edelib::Config conf; + if(!conf.load(CONFIG_NAME)) { + EWARNING(ESTRLOC ": Can't load %s, using default...\n", CONFIG_NAME); + return; + } + + /* + * TODO: + * Add IconArea[X,Y,W,H] so icons can live + * inside that area only (aka margins). + */ + int default_bg_color = FL_BLUE; + int default_wp_use = false; + char wpath[256]; + + // read Desktop section + conf.get("Desktop", "Color", dsett->color, default_bg_color); + + if(conf.error() != edelib::CONF_ERR_SECTION) { + conf.get("Desktop", "WallpaperUse", dsett->wp_use, default_wp_use); + conf.get("Desktop", "Wallpaper", wpath, sizeof(wpath)); + + // keep path but disable wallpaper if file does not exists + if(!edelib::file_exists(wpath)) { + EDEBUG(ESTRLOC ": %s as wallpaper does not exists\n", wpath); + dsett->wp_use = false; + } + } else { + // color is already filled + dsett->wp_use = default_wp_use; + } + + // read Icons section + conf.get("Icons", "Label Background", gisett.label_background, FL_BLUE); + conf.get("Icons", "Label Foreground", gisett.label_foreground, FL_WHITE); + conf.get("Icons", "Label Fontsize", gisett.label_fontsize, 12); + conf.get("Icons", "Label Maxwidth", gisett.label_maxwidth, 75); + conf.get("Icons", "Label Transparent",gisett.label_transparent, false); + conf.get("Icons", "Label Visible", gisett.label_draw, true); + conf.get("Icons", "OneClickExec", gisett.one_click_exec, false); + conf.get("Icons", "AutoArrange", gisett.auto_arrange, true); + + /* + * Now try to load icons, first looking inside ~/Desktop directory + * then inside config since config could contain removed entries + * from $HOME/Desktop + * + * FIXME: dir_exists() can't handle '~/Desktop' ??? + */ + edelib::String dd = edelib::dir_home(); + if(dd.empty()) { + EWARNING(ESTRLOC ": Can't read home directory; icons will not be loaded\n"); + return; + } + dd += "/Desktop"; + load_icons(dd.c_str(), conf); +} + +void Desktop::save_config(void) { + // TODO +} + +void Desktop::load_icons(const char* path, edelib::Config& conf) { + EASSERT(path != NULL); + + if(!edelib::dir_exists(path)) { + EDEBUG(ESTRLOC ": %s does not exists\n", path); + return; + } + + edelib::vector lst; + + // list without full path, so we can use name as entry in config file + if(!dir_list(path, lst)) { + EDEBUG(ESTRLOC ": Can't read %s\n", path); + return; + } + + const char* name = NULL; + int icon_x = 0; + int icon_y = 0; + edelib::String full_path; + full_path.reserve(256); + + bool can_add = false; + + edelib::MimeType mt; + + unsigned int sz = lst.size(); + for(unsigned int i = 0; i < sz; i++) { + name = lst[i].c_str(); + + full_path = path; + full_path += '/'; + full_path += name; + + can_add = false; + + IconSettings is; + + // see is possible .desktop file, icon, name fields are filled from read_desktop_file() + if(edelib::str_ends(name, ".desktop")) { + if(read_desktop_file(full_path.c_str(), is)) + can_add = true; + } else { + // then try to figure out it's mime; if fails, ignore it + if(mt.set(full_path.c_str())) { + EDEBUG(ESTRLOC ": Loading icon as mime-type %s\n", mt.icon_name().c_str()); + is.icon = mt.icon_name(); + // icon label is name of file + is.name = name; + is.type = ICON_FILE; + + can_add = true; + } else { + EDEBUG(ESTRLOC ": Failed mime-type for %s, ignoring...\n", name); + can_add = false; + } + } + + if(can_add) { + is.key_name = name; + // random_pos() is used if X/Y keys are not found + conf.get(name, "X", icon_x, random_pos(w() - 10)); + conf.get(name, "Y", icon_y, random_pos(h() - 10)); + + EDEBUG(ESTRLOC ": %s found with: %i %i\n", name, icon_x, icon_y); + is.x = icon_x; + is.y = icon_y; + + DesktopIcon* dic = new DesktopIcon(&gisett, &is, dsett->color); + add_icon(dic); + } + } +} + +// read .desktop files +bool Desktop::read_desktop_file(const char* path, IconSettings& is) { + EASSERT(path != NULL); + + if(!edelib::file_exists(path)) { + EDEBUG(ESTRLOC ": %s don't exists\n"); + return false; + } + + edelib::DesktopFile dconf; + if(!dconf.load(path)) { + EWARNING(ESTRLOC ": Can't read %s\n", path); + return false; + } + + char buff[128]; + int buffsz = sizeof(buff); + + /* + * Check for 'EmptyIcon' key since via it is determined + * is icon trash type or not (in case of trash, 'Icon' key is used for full trash). + * FIXME: any other way to check for trash icons ??? + */ + if(dconf.get("Desktop Entry", "EmptyIcon", buff, buffsz)) { + is.type = ICON_TRASH; + is.icon = buff; + } else + is.type = ICON_NORMAL; + + if(!dconf.icon(buff, buffsz)) { + EWARNING(ESTRLOC ": No Icon key, balling out\n"); + return false; + } + + if(is.type == ICON_TRASH) + is.icon2 = buff; + else + is.icon = buff; + + edelib::DesktopFileType dtype = dconf.type(); + if(dtype == edelib::DESK_FILE_TYPE_LINK) { + is.cmd_is_url = true; + dconf.url(buff, buffsz); + } + else { + is.cmd_is_url = false; + dconf.exec(buff, buffsz); + } + + is.cmd = buff; + + if(!dconf.name(buff, buffsz)) { + EDEBUG(ESTRLOC ": No Name key\n"); + is.name = "(none)"; + } else + is.name = buff; + + return true; +} + +void Desktop::add_icon(DesktopIcon* ic) { + EASSERT(ic != NULL); + + icons.push_back(ic); + add((Fl_Widget*)ic); +} + +void Desktop::unfocus_all(void) { + unsigned int sz = icons.size(); + DesktopIcon* ic; + + for(unsigned int i = 0; i < sz; i++) { + ic = icons[i]; + if(ic->is_focused()) { + ic->do_unfocus(); + ic->fast_redraw(); + } + } +} + +void Desktop::select(DesktopIcon* ic, bool do_redraw) { + EASSERT(ic != NULL); + + if(in_selection(ic)) + return; + + selectionbuff.push_back(ic); + + if(!ic->is_focused()) { + ic->do_focus(); + + if(do_redraw) + ic->fast_redraw(); + } +} + +void Desktop::select_only(DesktopIcon* ic) { + EASSERT(ic != NULL); + + unfocus_all(); + selectionbuff.clear(); + selectionbuff.push_back(ic); + + ic->do_focus(); + ic->fast_redraw(); +} + +bool Desktop::in_selection(const DesktopIcon* ic) { + EASSERT(ic != NULL); + + unsigned int sz = selectionbuff.size(); + for(unsigned int i = 0; i < sz; i++) { + if(ic == selectionbuff[i]) + return true; + } + + return false; +} + +void Desktop::move_selection(int x, int y, bool apply) { + unsigned int sz = selectionbuff.size(); + if(sz == 0) + return; + + int prev_x, prev_y, tmp_x, tmp_y; + DesktopIcon* ic; + + for(unsigned int i = 0; i < sz; i++) { + ic = selectionbuff[i]; + + prev_x = ic->drag_icon_x(); + prev_y = ic->drag_icon_y(); + + tmp_x = x - selection_x; + tmp_y = y - selection_y; + + ic->drag(prev_x + tmp_x, prev_y + tmp_y, apply); + + // very slow if not checked + //if(apply == true) + // ic->fast_redraw(); + } + + selection_x = x; + selection_y = y; + + /* + * Redraw whole screen so it reflects + * new icon position + */ + if(apply) + redraw(); +} + +/* + * Tries to figure out icon below mouse. It is alternative to + * Fl::belowmouse() since with this we hunt only icons, not other + * childs (wallpaper, menu), which can be returned by Fl::belowmouse() + * and bad things be hapened. + */ +DesktopIcon* Desktop::below_mouse(int px, int py) { + unsigned int sz = icons.size(); + + DesktopIcon* ic = NULL; + for(unsigned int i = 0; i < sz; i++) { + ic = icons[i]; + if(ic->x() < px && ic->y() < py && px < (ic->x() + ic->h()) && py < (ic->y() + ic->h())) + return ic; + } + + return NULL; +} + +void Desktop::select_in_area(void) { + if(!selbox->show) + return; + + int ax = selbox->x; + int ay = selbox->y; + int aw = selbox->w; + int ah = selbox->h; + + if(aw < 0) { + ax += aw; + aw = -aw; + } else if(!aw) + aw = 1; + + if(ah < 0) { + ay += ah; + ah = -ah; + } else if(!ah) + ah = 1; + + /* + * XXX: This function can fail since icon coordinates are absolute (event_x_root) + * but selbox use relative (event_root). It will work as expected if desktop is at x=0 y=0. + * This should be checked further. + */ + unsigned int sz = icons.size(); + DesktopIcon* ic = NULL; + + for(unsigned int i = 0; i < sz; i++) { + ic = icons[i]; + EASSERT(ic != NULL && "Impossible to happen"); + + if(intersects(ax, ay, ax+aw, ay+ah, ic->x(), ic->y(), ic->w()+ic->x(), ic->h()+ic->y())) { + if(!ic->is_focused()) { + ic->do_focus(); + // updated from Desktop::draw() + ic->damage(EDAMAGE_CHILD_LABEL); + } + } else { + if(ic->is_focused()) { + ic->do_unfocus(); + // updated from Desktop::draw() + ic->fast_redraw(); + //ic->damage(EDAMAGE_CHILD_LABEL); + //ic->redraw(); + //ic->damage(EDAMAGE_CHILD_LABEL); + } + } + } +} + +void Desktop::notify_box(const char* msg, bool copy) { + if(!msg) + return; + + if(copy) + notify->copy_label(msg); + else + notify->label(msg); + + if(!notify->shown()) + notify->show(); +} + +void Desktop::notify_box_color(Fl_Color col) { + notify->color(col); +} + +void Desktop::notify_desktop_changed(void) { + int num = net_get_current_desktop(); + if(num == -1) + return; + + char** names; + int ret = net_get_workspace_names(names); + if(num >= ret) { + XFreeStringList(names); + return; + } + + notify_box(names[num], true); + XFreeStringList(names); +} + +void Desktop::drop_source(const char* src, int src_len, int x, int y) { + if(!src) + return; + + if(src_len < 1) + return; + + char* src_copy = new char[src_len + 1]; + int real_len = 0; + + // mozilla sends junk in form: ascii<0>ascii<0>..., don't know why + for(int i = 0, j = 0; i < src_len; i++) { + if(src[i] != 0) { + src_copy[j++] = src[i]; + real_len++; + } + } + src_copy[real_len] = '\0'; + + if(real_len < 1) { + delete [] src_copy; + return; + } + + EDEBUG(ESTRLOC ": DND on Desktop, got: %s\n", src_copy); + + // valid url's (if got) ends with \r\n, clean that + char* pp = strstr(src_copy, "\r\n"); + if(pp) + *pp = '\0'; + + char* sptr = 0; + if((real_len > 7) && (strncmp(src_copy, "file://", 7) == 0)) + sptr = src_copy + 7; + else + sptr = src_copy; + + if(!edelib::file_exists(sptr) && !edelib::dir_exists(sptr)) { + fl_message("Droping file content is not implemented yet. Soon, soon... :)"); + delete [] src_copy; + return; + } + + IconSettings is; + is.x = x; + is.y = y; + + bool is_read = false; + + if(edelib::str_ends(src_copy, ".desktop")) { + edelib::DesktopFile dconf; + + edelib::String path = sptr; + edelib::DesktopFile dfile; + + if(dfile.load(path.c_str())) { + char buff[256]; + if(dfile.type() == edelib::DESK_FILE_TYPE_LINK) { + dfile.url(buff, 256); + is.cmd_is_url = true; + } + else { + dfile.exec(buff, 256); + is.cmd_is_url = false; + } + is.cmd = buff; + is.type = ICON_NORMAL; + + dfile.name(buff, 256); + is.name = buff; + dfile.icon(buff, 256); + is.icon = buff; + + is_read = true; + } + } + + if(!is_read) { + // absolute path is (for now) seen as non-url + if(sptr[0] == '/') + is.cmd_is_url = false; + else + is.cmd_is_url = true; + + is.cmd = "(none)"; + is.type = ICON_NORMAL; + + edelib::MimeType mt; + if(!mt.set(sptr)) { + EWARNING(ESTRLOC ": MimeType for %s (%s) failed, not dropping icon\n", sptr, src_copy); + delete [] src_copy; + return; + } + + is.name = get_basename(sptr); + is.icon = mt.icon_name(); + } + + DesktopIcon* dic = new DesktopIcon(&gisett, &is, color()); + add_icon(dic); + + delete [] src_copy; + + redraw(); +} + +void Desktop::draw(void) { + if(!damage()) + return; + + if(damage() & (FL_DAMAGE_ALL | FL_DAMAGE_EXPOSE)) { + /* + * If any overlay was previously visible during full + * redraw, it will not be cleared because of fast flip. + * This will assure that does not happened. + */ + clear_xoverlay(); + + DESKTOP_WINDOW::draw(); + EDEBUG(ESTRLOC ": REDRAW ALL\n"); + } + + if(damage() & EDAMAGE_OVERLAY) { + if(selbox->show) + draw_xoverlay(selbox->x, selbox->y, selbox->w, selbox->h); + else + clear_xoverlay(); + + /* + * now scan all icons and see if they needs redraw, and if do + * just update their label since it is indicator of selection + */ + for(int i = 0; i < children(); i++) { + if(child(i)->damage() == EDAMAGE_CHILD_LABEL) { + update_child(*child(i)); + child(i)->clear_damage(); + EDEBUG(ESTRLOC ": ICON REDRAW \n"); + } + } + } + + clear_damage(); +} + +int Desktop::handle(int event) { + switch(event) { + case FL_FOCUS: + case FL_UNFOCUS: + case FL_SHORTCUT: + return 1; + + case FL_PUSH: { + /* + * First check where we clicked. If we do it on desktop + * unfocus any possible focused childs, and handle + * specific clicks. Otherwise, do rest for childs. + */ + Fl_Widget* clicked = Fl::belowmouse(); + + if(NOT_SELECTABLE(clicked)) { + EDEBUG(ESTRLOC ": DESKTOP CLICK !!!\n"); + if(!selectionbuff.empty()) { + /* + * Only focused are in selectionbuff, so this is + * fine to do; also will prevent full redraw when is clicked on desktop + */ + unfocus_all(); + selectionbuff.clear(); + } + + // track position so moving can be deduced + if(Fl::event_button() == 1) { + selbox->x = Fl::event_x(); + selbox->y = Fl::event_y(); + } else if(Fl::event_button() == 3) { + dmenu->menu()->popup(Fl::event_x(), Fl::event_y()); + } + + return 1; + } + + // from here, all events are managed for icons + DesktopIcon* tmp_icon = (DesktopIcon*)clicked; + + /* + * do no use assertion on this, since + * fltk::belowmouse() can miss our icon + */ + if(!tmp_icon) + return 1; + + if(SELECTION_MULTI) { + Fl::event_is_click(0); + select(tmp_icon); + return 1; + } else if(SELECTION_SINGLE) { + if(!in_selection(tmp_icon)) { + /* + * for testing: + * notify_box(tmp_icon->label()); + */ + select_only(tmp_icon); + } + } else if(Fl::event_button() == 3) { + select_only(tmp_icon); + /* + * for testing: + * notify_box(tmp_icon->label()); + */ + } + + /* + * Let child handle the rest. + * Also prevent click on other mouse buttons during move. + */ + if(!moving) + tmp_icon->handle(FL_PUSH); + + EDEBUG(ESTRLOC ": FL_PUSH from desktop\n"); + selection_x = Fl::event_x_root(); + selection_y = Fl::event_y_root(); + + return 1; + } + + case FL_DRAG: + moving = true; + if(!selectionbuff.empty()) { + EDEBUG(ESTRLOC ": DRAG icon from desktop\n"); + move_selection(Fl::event_x_root(), Fl::event_y_root(), false); + } else { + EDEBUG(ESTRLOC ": DRAG from desktop\n"); + /* + * Moving is started with pushed button. + * From this point selection box is created and is rolled until release + */ + if(selbox->x != 0 || selbox->y != 0) { + selbox->w = Fl::event_x() - selbox->x; + selbox->h = Fl::event_y() - selbox->y; + + selbox->show = true; + + // see if there some icons inside selection area + select_in_area(); + + // redraw selection box + damage(EDAMAGE_OVERLAY); + } + } + + return 1; + + case FL_RELEASE: + EDEBUG(ESTRLOC ": RELEASE from desktop\n"); + EDEBUG(ESTRLOC ": clicks: %i\n", Fl::event_is_click()); + + if(selbox->show) { + selbox->x = selbox->y = selbox->w = selbox->h = 0; + selbox->show = false; + damage(EDAMAGE_OVERLAY); + + /* + * Now pickup those who are in is_focused() state. + * + * Possible flickers due overlay will be later removed when is + * called move_selection(), which will in turn redraw icons again + * after position them. + */ + if(!selectionbuff.empty()) + selectionbuff.clear(); + + for(unsigned int i = 0; i < icons.size(); i++) { + if(icons[i]->is_focused()) + select(icons[i], false); + } + + return 1; + } + + if(!selectionbuff.empty() && moving) + move_selection(Fl::event_x_root(), Fl::event_y_root(), true); + + /* + * Do not send FL_RELEASE during move + * + * TODO: should be alowed FL_RELEASE to multiple icons? (aka. run + * command for all selected icons ? + */ + if(selectionbuff.size() == 1 && !moving) + selectionbuff[0]->handle(FL_RELEASE); + + moving = false; + return 1; + + case FL_DND_ENTER: + case FL_DND_DRAG: + case FL_DND_LEAVE: + return 1; + + case FL_DND_RELEASE: { + DesktopIcon* di = below_mouse(Fl::event_x(), Fl::event_y()); + if(di) + return di->handle(event); + return 1; + } + + case FL_PASTE: { + DesktopIcon* di = below_mouse(Fl::event_x(), Fl::event_y()); + if(di) + return di->handle(event); + + drop_source(Fl::event_text(), Fl::event_length(), Fl::event_x(), Fl::event_y()); + return 1; + } + + case FL_ENTER: + case FL_LEAVE: + case FL_MOVE: + return DESKTOP_WINDOW::handle(event); + + default: + break; + } + + return 0; +} + +int main() { + signal(SIGTERM, exit_signal); + signal(SIGKILL, exit_signal); + signal(SIGINT, exit_signal); + signal(SIGHUP, restart_signal); + + srand(time(NULL)); + + // a lot of preparing code depends on this + fl_open_display(); + + fl_register_images(); + + edelib::IconTheme::init("edeneu"); + + Desktop::init(); + Desktop::instance()->show(); + + /* + * XSelectInput will redirect PropertyNotify messages, which + * are listened for + */ + XSelectInput(fl_display, RootWindow(fl_display, fl_screen), PropertyChangeMask | StructureNotifyMask | ClientMessage); + + Fl::add_handler(desktop_xmessage_handler); + + while(running) + Fl::wait(); + + Desktop::shutdown(); + + edelib::IconTheme::shutdown(); + + return 0; +} diff --git a/eiconman/eiconman.h b/eiconman/eiconman.h new file mode 100644 index 0000000..c78fcb1 --- /dev/null +++ b/eiconman/eiconman.h @@ -0,0 +1,150 @@ +/* + * $Id$ + * + * Eiconman, desktop and icon manager + * Part of Equinox Desktop Environment (EDE). + * Copyright (c) 2000-2007 EDE Authors. + * + * This program is licensed under terms of the + * GNU General Public License version 2 or newer. + * See COPYING for details. + */ + +#ifndef __EICONMAN_H__ +#define __EICONMAN_H__ + +#include +#include +#include + +#include +#include +#include + +#define EDAMAGE_CHILD_LABEL 0x10 +#define EDAMAGE_OVERLAY 0x20 + +struct DesktopSettings { + int color; // background color + bool wp_use; // use wallpaper or not +}; + +struct GlobalIconSettings { + int label_background; + int label_foreground; + int label_fontsize; + int label_maxwidth; + bool label_transparent; + bool label_draw; + bool one_click_exec; + bool auto_arrange; + bool same_size; +}; + +#define ICON_NORMAL 1 // .desktop file +#define ICON_TRASH 2 // trash.desktop (specific since have two icons for empty/full) +#define ICON_FILE 3 // real file +#define ICON_SYMLINK 4 // symbolic link + +/* + * Settings representing related to icon on desktop. To complicate our lives + * (and to, at least, simplify code) it can be: + * - .desktop file content (normal or trash like) + * - real file copied/moved inside ~/Desktop directory + * - symlink in ~/Desktop directory pointing to the real file + */ +struct IconSettings { + int x, y; + int type; // ICON_NORMAL, ICON_TRASH,... + bool cmd_is_url; // interpret cmd as url, like system:/,trash:/,$HOME + + edelib::String name; + edelib::String cmd; + edelib::String icon; + edelib::String icon2; // for stateable icons, like trash (empty/full) + edelib::String key_name; // name used as key when storing positions + edelib::String full_path; // for tracking changes +}; + +// Selection overlay +struct SelectionOverlay { + int x, y, w, h; + bool show; +}; + +class Wallpaper; +class DesktopIcon; +class NotifyBox; + +class Fl_Menu_Button; + +typedef edelib::vector DesktopIconList; + +#define DESKTOP_WINDOW Fl_Window + +class Desktop : public DESKTOP_WINDOW { + private: + static Desktop* pinstance; + + int selection_x, selection_y; + bool moving; + + SelectionOverlay* selbox; + + GlobalIconSettings gisett; + DesktopSettings* dsett; + + Fl_Menu_Button* dmenu; + Wallpaper* wallpaper; + NotifyBox* notify; + + DesktopIconList icons; + DesktopIconList selectionbuff; + + void init_internals(void); + + void load_icons(const char* path, edelib::Config& conf); + bool read_desktop_file(const char* path, IconSettings& is); + + void add_icon(DesktopIcon* ic); + + void unfocus_all(void); + + void select(DesktopIcon* ic, bool do_redraw = true); + void select_only(DesktopIcon* ic); + bool in_selection(const DesktopIcon* ic); + void move_selection(int x, int y, bool apply); + + void select_in_area(void); + + void drop_source(const char* src, int src_len, int x, int y); + + DesktopIcon* below_mouse(int px, int py); + + public: + Desktop(); + ~Desktop(); + + virtual void show(void); + virtual void hide(void); + virtual void draw(void); + virtual int handle(int event); + + static void init(void); + static void shutdown(void); + static Desktop* instance(void); + + void read_config(void); + void save_config(void); + + void update_workarea(void); + void area(int& X, int& Y, int& W, int& H) { X = x(); Y = y(); W = w(); H = h(); } + + void set_bg_color(int c, bool do_redraw = true); + + void notify_box(const char* msg, bool copy = false); + void notify_box_color(Fl_Color col); + void notify_desktop_changed(void); +}; + +#endif diff --git a/eiconman/fl/deskconf.fl b/eiconman/fl/deskconf.fl new file mode 100644 index 0000000..68e1a77 --- /dev/null +++ b/eiconman/fl/deskconf.fl @@ -0,0 +1,56 @@ +# data file for the Fltk User Interface Designer (fluid) +version 1.0108 +header_name {.h} +code_name {.cxx} +Function {} {open +} { + Fl_Window {} {open selected + xywh {416 256 540 260} type Double resizable visible + } { + Fl_Box {} { + xywh {75 173 100 15} box BORDER_BOX + } + Fl_Box {} { + xywh {20 20 210 158} box THIN_UP_BOX + } + Fl_Box {} { + xywh {33 30 184 138} box DOWN_BOX color 56 + code0 {/* box size is intentionaly odd so preserve aspect ratio */} + } + Fl_Box {} { + xywh {50 183 145 14} box THIN_UP_BOX + } + Fl_Input {} { + label {Image:} + xywh {310 55 190 25} + } + Fl_Button {} { + label {...} + xywh {505 55 25 25} + } + Fl_Choice {} { + label {Mode:} open + xywh {310 91 220 24} down_box BORDER_BOX + } {} + Fl_Button {} { + label {Background color} + xywh {310 136 25 24} color 73 align 8 + } + Fl_Button {} { + label {&OK} + xywh {250 227 90 25} + } + Fl_Button {} { + label {&Apply} + xywh {345 227 90 25} + } + Fl_Button {} { + label {&Cancel} + xywh {440 227 90 25} + } + Fl_Check_Button {} { + label { Use wallpaper} + xywh {310 20 220 25} down_box DOWN_BOX + } + } +} diff --git a/eiconman/test/notify.cpp b/eiconman/test/notify.cpp new file mode 100644 index 0000000..a125c2c --- /dev/null +++ b/eiconman/test/notify.cpp @@ -0,0 +1,70 @@ +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +Fl_Button* color_button = 0; +Fl_Input* txt = 0; + +void color_cb(Fl_Widget*, void*) { + Fl_Color c = fl_show_colormap(color_button->color()); + color_button->color(c); +} + +void send_cb(Fl_Widget*, void*) { + printf("send: %s color: %i\n", txt->value(), color_button->color()); + + Atom _XA_EDE_DESKTOP_NOTIFY = XInternAtom(fl_display, "_EDE_DESKTOP_NOTIFY", False); + Atom _XA_EDE_DESKTOP_NOTIFY_COLOR = XInternAtom(fl_display, "_EDE_DESKTOP_NOTIFY_COLOR", False); + //Atom _XA_UTF8_STRING = XInternAtom(fl_display, "UTF8_STRING", false); + + // max size + unsigned char txt_send[8192]; + int i; + const char* txt_val = txt->value() ? txt->value() : "(none)"; + int len = strlen(txt_val); + + for(i = 0; i < 8192-2 && i < len; i++) + txt_send[i] = txt_val[i]; + + txt_send[i] = '\0'; + + // send text + XChangeProperty(fl_display, RootWindow(fl_display, fl_screen), + _XA_EDE_DESKTOP_NOTIFY, XA_STRING, 8, PropModeReplace, + txt_send, i + 1); + + // send color + int col = color_button->color(); + XChangeProperty(fl_display, RootWindow(fl_display, fl_screen), + _XA_EDE_DESKTOP_NOTIFY_COLOR, XA_CARDINAL, 32, PropModeReplace, + (unsigned char*)&col, sizeof(int)); +} + +int main() { + fl_open_display(); + + Fl_Double_Window* win = new Fl_Double_Window(295, 144, "Notify test"); + win->begin(); + txt = new Fl_Input(10, 15, 275, 25); + txt->align(FL_ALIGN_TOP_LEFT); + + color_button = new Fl_Button(260, 50, 25, 25, "Color"); + color_button->align(FL_ALIGN_LEFT); + color_button->callback(color_cb); + Fl_Box* bx = new Fl_Box(10, 50, 164, 85, "Type some text and choose color, then press Send. " + "Desktop should get notified about this."); + bx->align(FL_ALIGN_WRAP); + + Fl_Button* send_button = new Fl_Button(195, 110, 90, 25, "&Send"); + send_button->callback(send_cb); + win->end(); + win->show(); + return Fl::run(); +} diff --git a/eiconman/test/notify.fl b/eiconman/test/notify.fl new file mode 100644 index 0000000..4aaae09 --- /dev/null +++ b/eiconman/test/notify.fl @@ -0,0 +1,27 @@ +# data file for the Fltk User Interface Designer (fluid) +version 1.0108 +header_name {.h} +code_name {.cxx} +Function {} {open +} { + Fl_Window {} { + label {Notify test} open + xywh {465 279 295 144} type Double visible + } { + Fl_Input {} { + xywh {10 15 275 25} labelsize 14 align 5 textsize 14 + } + Fl_Button {} { + label {&Send} + xywh {195 110 90 25} labelsize 14 + } + Fl_Button {} { + label Color + xywh {260 50 25 25} labelsize 14 align 4 + } + Fl_Box {} { + label {Type some text and choose color, then press Send. Desktop should get notified about this.} selected + xywh {10 50 164 85} labelsize 14 align 128 + } + } +} diff --git a/eiconsconf/Jamfile b/eiconsconf/Jamfile new file mode 100644 index 0000000..733f3bb --- /dev/null +++ b/eiconsconf/Jamfile @@ -0,0 +1,16 @@ +# +# $Id$ +# +# Part of Equinox Desktop Environment (EDE). +# Copyright (c) 2000-2007 EDE Authors. +# +# This program is licenced under terms of the +# GNU General Public Licence version 2 or newer. +# See COPYING for details. + +SubDir TOP eiconsconf ; + +SOURCE = eiconsconf.cpp eicon.cpp ; + +MakeProgram eiconsconf : $(SOURCE) ; +ExtractStrings locale : $(SOURCE) ; diff --git a/eiconsconf/Makefile b/eiconsconf/Makefile new file mode 100644 index 0000000..a5e180c --- /dev/null +++ b/eiconsconf/Makefile @@ -0,0 +1,22 @@ + +CPPFILES = ../edelib2/Util.cpp ../edelib2/Config.cpp eiconsconf.cpp eicon.cpp +TARGET = eiconsconf + +POFILES = locale/ru.po\ + locale/sr.po\ + locale/sk.po\ + locale/hu.po\ + +include ../makeinclude + +install: + $(INSTALL_PROGRAM) $(TARGET) $(bindir) + $(INSTALL_LOCALE) + +uninstall: + $(RM) $(bindir)/$(TARGET) + +clean: + $(RM) $(TARGET) + $(RM) *.o + diff --git a/eiconsconf/eicon.cpp b/eiconsconf/eicon.cpp new file mode 100644 index 0000000..9ec809b --- /dev/null +++ b/eiconsconf/eicon.cpp @@ -0,0 +1,98 @@ +/* + * $Id$ + * + * Icon properties (for eiconman - the EDE desktop) + * Part of Equinox Desktop Environment (EDE). + * Copyright (c) 2000-2006 EDE Authors. + * + * This program is licenced under terms of the + * GNU General Public Licence version 2 or newer. + * See COPYING for details. + */ + +#include "eicon.h" + +using namespace fltk; +using namespace edelib; + + +int label_background = 46848 +; +int label_foreground = WHITE; +int label_fontsize = 12; +int label_maxwidth = 75; +int label_gridspacing = 16 +; +bool label_trans = true; +bool label_engage_1click = false; +bool auto_arr = false; + +static void sendClientMessage(XWindow w, Atom a, long x) +{ +/* XEvent ev; + long mask; + + memset(&ev, 0, sizeof(ev)); + ev.xclient.type = ClientMessage; + ev.xclient.window = w; + ev.xclient.message_type = a; + ev.xclient.format = 32; + ev.xclient.data.l[0] = x; + ev.xclient.data.l[1] = CurrentTime; + mask = 0L; + if (w == RootWindow(fl_display, fl_screen)) + mask = SubstructureRedirectMask; + XSendEvent(fl_display, w, False, mask, &ev);*/ +} + +void sendUpdateInfo() +{ +// no worky +/* unsigned int i, nrootwins; + Window dw1, dw2, *rootwins = 0; + int screen_count = ScreenCount(fl_display); + extern Atom FLTKChangeSettings; + for (int s = 0; s < screen_count; s++) { + Window root = RootWindow(fl_display, s); + XQueryTree(fl_display, root, &dw1, &dw2, &rootwins, &nrootwins); + for (i = 0; i < nrootwins; i++) { + if (rootwins[i]!=RootWindow(fl_display, fl_screen)) { + sendClientMessage(rootwins[i], FLTKChangeSettings, 0); + } + } + } + XFlush(fl_display);*/ +} + +void + readIconsConfiguration() +{ + Config globalConfig(Config::find_file("ede.conf", 0), true, false); + globalConfig.set_section("IconManager"); + + globalConfig.read("Label Background", label_background, 46848); + globalConfig.read("Label Transparent", label_trans, false); + globalConfig.read("Label Foreground", label_foreground, WHITE); + globalConfig.read("Label Fontsize", label_fontsize, 12); + globalConfig.read("Label Maxwidth", label_maxwidth, 75); + globalConfig.read("Gridspacing", label_gridspacing, 16); + globalConfig.read("OneClickExec", label_engage_1click, false); + globalConfig.read("AutoArrange", auto_arr, false); +} + +void writeIconsConfiguration() +{ + Config globalConfig(Config::find_file("ede.conf", true)); + globalConfig.set_section("IconManager"); + + globalConfig.write("Label Background", label_background); + globalConfig.write("Label Transparent", label_trans); + globalConfig.write("Label Foreground", label_foreground); + globalConfig.write("Label Fontsize", label_fontsize); + globalConfig.write("Label Maxwidth", label_maxwidth); + globalConfig.write("Gridspacing", label_gridspacing); + globalConfig.write("OneClickExec", label_engage_1click); + globalConfig.write("AutoArrange", auto_arr); +} + + diff --git a/eiconsconf/eicon.h b/eiconsconf/eicon.h new file mode 100644 index 0000000..598f9e6 --- /dev/null +++ b/eiconsconf/eicon.h @@ -0,0 +1,43 @@ +/* + * $Id$ + * + * Icon properties (for eiconman - the EDE desktop) + * Part of Equinox Desktop Environment (EDE). + * Copyright (c) 2000-2006 EDE Authors. + * + * This program is licenced under terms of the + * GNU General Public Licence version 2 or newer. + * See COPYING for details. + */ + + +#ifndef EICON_H +#define EICON_H + +#include +//#include +#include //#include +//#include +#include //#include +#include "../edelib2/Config.h" +#include "../edelib2/NLS.h" + +extern int label_background; +extern int label_foreground; +extern int label_fontsize; +extern int label_maxwidth; +extern int label_gridspacing; +extern bool label_trans; +extern bool label_engage_1click; +extern bool auto_arr; + +void + readIconsConfiguration() +; +void + writeIconsConfiguration() +; +void sendUpdateInfo(); + +#endif + diff --git a/eiconsconf/eiconsconf.cpp b/eiconsconf/eiconsconf.cpp new file mode 100644 index 0000000..72b50d9 --- /dev/null +++ b/eiconsconf/eiconsconf.cpp @@ -0,0 +1,191 @@ +// generated by Fast Light User Interface Designer (fluid) version 2.0100 + +#include "eiconsconf.h" +/* + * $Id$ + * + * Icon properties (for eiconman - the EDE desktop) + * Part of Equinox Desktop Environment (EDE). + * Copyright (c) 2000-2006 EDE Authors. + * + * This program is licenced under terms of the + * GNU General Public Licence version 2 or newer. + * See COPYING for details. + */ +#include +#include "../edelib2/NLS.h" +#include "../edeconf.h" +#include "eicon.h" + +fltk::Window *iconsConfWindow=(fltk::Window *)0; + +static void cb_OK(fltk::Button*, void*) { + writeIconsConfiguration(); + sendUpdateInfo(); + exit(0); +} + +static void cb_Cancel(fltk::Button*, void*) { + exit(0); +} + +static void cb_Apply(fltk::Button*, void*) { + writeIconsConfiguration(); + sendUpdateInfo(); +} + +fltk::Button *colorButton=(fltk::Button *)0; + +static void cb_colorButton(fltk::Button*, void*) { + changeBoxColor(colorButton); + label_background = (int) colorButton->color(); +} + +fltk::Button *colorButton1=(fltk::Button *)0; + +static void cb_colorButton1(fltk::Button*, void*) { + changeBoxColor(colorButton1); + label_foreground = (int) colorButton1->color(); +} + +fltk::ValueSlider *maxWidthSlider=(fltk::ValueSlider *)0; + +static void cb_maxWidthSlider(fltk::ValueSlider*, void*) { + label_maxwidth = (int) maxWidthSlider->value(); +} + +fltk::ValueSlider *fontsizeSlider=(fltk::ValueSlider *)0; + +static void cb_fontsizeSlider(fltk::ValueSlider*, void*) { + label_fontsize = (int) fontsizeSlider->value(); +} + +fltk::ValueSlider *gridspaceSlider=(fltk::ValueSlider *)0; + +static void cb_gridspaceSlider(fltk::ValueSlider*, void*) { + label_gridspacing = (int) gridspaceSlider->value(); +} + +fltk::CheckButton *autoArrButton=(fltk::CheckButton *)0; + +static void cb_autoArrButton(fltk::CheckButton* o, void*) { + auto_arr = (o->value()>0); +} + +fltk::CheckButton *engageButton=(fltk::CheckButton *)0; + +static void cb_engageButton(fltk::CheckButton*, void*) { + label_engage_1click = (int) engageButton->value(); +} + +fltk::CheckButton *bg_color_check=(fltk::CheckButton *)0; + +static void cb_bg_color_check(fltk::CheckButton* o, void*) { + if(o->value()) colorButton->activate(); + else colorButton->deactivate(); + label_trans = (o->value()==0); +} + +#include + +int main (int argc, char **argv) { + + fltk::Window* w; + //fl_init_locale_support("eiconsconf", PREFIX"/share/locale"); + readIconsConfiguration(); + {fltk::Window* o = iconsConfWindow = new fltk::Window(265, 310, "Icons settings"); + w = o; + o->set_vertical(); + o->begin(); + {fltk::Button* o = new fltk::Button(25, 277, 75, 25, "&OK"); + o->callback((fltk::Callback*)cb_OK); + } + {fltk::Button* o = new fltk::Button(185, 277, 75, 25, "&Cancel"); + o->callback((fltk::Callback*)cb_Cancel); + } + {fltk::Button* o = new fltk::Button(105, 277, 75, 25, "&Apply"); + o->callback((fltk::Callback*)cb_Apply); + } + {fltk::TabGroup* o = new fltk::TabGroup(1, 5, 259, 262); + o->set_vertical(); + o->color((fltk::Color)0xfffffffe); + o->begin(); + {fltk::Group* o = new fltk::Group(0, 20, 255, 239, "Look&&feel"); + o->begin(); + {fltk::Button* o = colorButton = new fltk::Button(164, 20, 60, 18, "Background color: "); + o->callback((fltk::Callback*)cb_colorButton); + o->align(fltk::ALIGN_LEFT); + o->color((fltk::Color)label_background); + if(label_trans) o->deactivate(); + } + {fltk::Button* o = colorButton1 = new fltk::Button(164, 45, 60, 18, "Label color: "); + o->callback((fltk::Callback*)cb_colorButton1); + o->align(fltk::ALIGN_LEFT); + o->color((fltk::Color) label_foreground); + } + {fltk::ValueSlider* o = maxWidthSlider = new fltk::ValueSlider(114, 78, 125, 20, "Maximum width: "); + o->minimum(48); + o->maximum(200); + o->step(1); + o->value(50); + o->slider_size(10); + o->callback((fltk::Callback*)cb_maxWidthSlider); + o->align(fltk::ALIGN_LEFT); + o->value(label_maxwidth); + } + {fltk::ValueSlider* o = fontsizeSlider = new fltk::ValueSlider(114, 108, 125, 20, "Font height: "); + o->type(fltk::ValueSlider::TICK_ABOVE); + o->minimum(8); + o->maximum(48); + o->step(1); + o->value(10); + o->slider_size(10); + o->callback((fltk::Callback*)cb_fontsizeSlider); + o->align(fltk::ALIGN_LEFT); + o->value(label_fontsize); + } + {fltk::ValueSlider* o = gridspaceSlider = new fltk::ValueSlider(114, 138, 125, 20, "Grid spacing: "); + o->type(fltk::ValueSlider::TICK_ABOVE); + o->minimum(1); + o->maximum(50); + o->step(1); + o->value(10); + o->slider_size(10); + o->callback((fltk::Callback*)cb_gridspaceSlider); + o->align(fltk::ALIGN_LEFT); + o->value(label_gridspacing); + } + {fltk::CheckButton* o = autoArrButton = new fltk::CheckButton(24, 198, 222, 20, "Auto arrange icons"); + o->callback((fltk::Callback*)cb_autoArrButton); + o->value(auto_arr); + } + {fltk::CheckButton* o = engageButton = new fltk::CheckButton(24, 173, 222, 20, "Engage with just one click"); + o->callback((fltk::Callback*)cb_engageButton); + o->value(label_engage_1click); + } + {fltk::CheckButton* o = bg_color_check = new fltk::CheckButton(226, 20, 20, 18); + o->callback((fltk::Callback*)cb_bg_color_check); + o->tooltip("Clear this, to get transparent background."); + if(!label_trans) o->set(); + } + o->end(); + } + o->end(); + } + o->end(); + o->resizable(o); + } + w->show(argc, argv); + return fltk::run(); +} + +void changeBoxColor(fltk::Button *box) { + //Fl_Button *colorBox = box; + fltk::Color oldColor = box->color(); + fltk::Color defColor = oldColor; + fltk::color_chooser(_("Choose color"), defColor); + if ( defColor != oldColor ) { + box->color(defColor); + box->redraw(); + } +} diff --git a/eiconsconf/eiconsconf.fld b/eiconsconf/eiconsconf.fld new file mode 100644 index 0000000..94b9431 --- /dev/null +++ b/eiconsconf/eiconsconf.fld @@ -0,0 +1,131 @@ +# data file for the FLTK User Interface Designer (FLUID) +version 2.0100 +images_dir ./icons +header_name {.h} +code_name {.cpp} +gridx 5 +gridy 5 +snap 3 +decl {/* + * $Id$ + * + * Icon properties (for eiconman - the EDE desktop) + * Part of Equinox Desktop Environment (EDE). + * Copyright (c) 2000-2006 EDE Authors. + * + * This program is licenced under terms of the + * GNU General Public Licence version 2 or newer. + * See COPYING for details. + */} {} + +decl {\#include } {} + +decl {\#include "../edelib2/NLS.h"} {} + +decl {\#include "../edeconf.h"} {} + +decl {\#include "eicon.h"} {} + +Function {} {open +} { + code {//fl_init_locale_support("eiconsconf", PREFIX"/share/locale"); +readIconsConfiguration();} {} + {fltk::Window} iconsConfWindow { + label {Icons settings} open + xywh {386 204 265 310} resizable visible + } { + {fltk::Button} {} { + label {&OK} + callback {writeIconsConfiguration(); +sendUpdateInfo(); +exit(0);} + xywh {25 277 75 25} + } + {fltk::Button} {} { + label {&Cancel} + callback {exit(0);} + xywh {185 277 75 25} + } + {fltk::Button} {} { + label {&Apply} + callback {writeIconsConfiguration(); +sendUpdateInfo();} + xywh {105 277 75 25} + } + {fltk::TabGroup} {} {open + xywh {1 5 259 262} color 0xfffffffe + } { + {fltk::Group} {} { + label {Look&&feel} open + xywh {0 20 255 239} + } { + {fltk::Button} colorButton { + label {Background color: } + callback {changeBoxColor(colorButton); +label_background = (int) colorButton->color();} + xywh {164 20 60 18} align 4 + extra_code {o->color((fltk::Color)label_background); +if(label_trans) o->deactivate();} + } + {fltk::Button} colorButton1 { + label {Label color: } + callback {changeBoxColor(colorButton1); +label_foreground = (int) colorButton1->color();} + xywh {164 45 60 18} align 4 + extra_code {o->color((fltk::Color) label_foreground);} + } + {fltk::ValueSlider} maxWidthSlider { + label {Maximum width: } + callback {label_maxwidth = (int) maxWidthSlider->value();} + xywh {114 78 125 20} align 4 minimum 48 maximum 200 step 1 value 50 slider_size 10 + extra_code {o->value(label_maxwidth);} + } + {fltk::ValueSlider} fontsizeSlider { + label {Font height: } + callback {label_fontsize = (int) fontsizeSlider->value();} + xywh {114 108 125 20} type TICK_ABOVE align 4 minimum 8 maximum 48 step 1 value 10 slider_size 10 + extra_code {o->value(label_fontsize);} + } + {fltk::ValueSlider} gridspaceSlider { + label {Grid spacing: } + callback {label_gridspacing = (int) gridspaceSlider->value();} + xywh {114 138 125 20} type TICK_ABOVE align 4 minimum 1 maximum 50 step 1 value 10 slider_size 10 + extra_code {o->value(label_gridspacing);} + } + {fltk::CheckButton} autoArrButton { + label {Auto arrange icons} + callback {auto_arr = (o->value()>0);} + xywh {24 198 222 20} + extra_code {o->value(auto_arr);} + } + {fltk::CheckButton} engageButton { + label {Engage with just one click} + callback {label_engage_1click = (int) engageButton->value();} + xywh {24 173 222 20} + extra_code {o->value(label_engage_1click);} + } + {fltk::CheckButton} bg_color_check { + callback {if(o->value()) colorButton->activate(); +else colorButton->deactivate(); +label_trans = (o->value()==0);} + tooltip {Clear this, to get transparent background.} + xywh {226 20 20 18} + extra_code {if(!label_trans) o->set();} + } + } + } + } +} + +Function {changeBoxColor(fltk::Button *box)} {open return_type void +} { + code {//Fl_Button *colorBox = box; +fltk::Color oldColor = box->color(); +fltk::Color defColor = oldColor; +fltk::color_chooser(_("Choose color"), defColor); +if ( defColor != oldColor ) { + box->color(defColor); + box->redraw(); +}} {selected + } +} diff --git a/eiconsconf/eiconsconf.h b/eiconsconf/eiconsconf.h new file mode 100644 index 0000000..85d75bb --- /dev/null +++ b/eiconsconf/eiconsconf.h @@ -0,0 +1,21 @@ +// generated by Fast Light User Interface Designer (fluid) version 2.0100 + +#ifndef eiconsconf_h +#define eiconsconf_h +#include +extern fltk::Window* iconsConfWindow; +#include +#include +#include +extern fltk::Button* colorButton; +extern fltk::Button* colorButton1; +#include +extern fltk::ValueSlider* maxWidthSlider; +extern fltk::ValueSlider* fontsizeSlider; +extern fltk::ValueSlider* gridspaceSlider; +#include +extern fltk::CheckButton* autoArrButton; +extern fltk::CheckButton* engageButton; +extern fltk::CheckButton* bg_color_check; +void changeBoxColor(fltk::Button *box); +#endif diff --git a/eiconsconf/locale/hu.po b/eiconsconf/locale/hu.po new file mode 100644 index 0000000..5d093b4 --- /dev/null +++ b/eiconsconf/locale/hu.po @@ -0,0 +1,67 @@ +msgid "" +msgstr "" +"Project-Id-Version: \n" +"POT-Creation-Date: \n" +"PO-Revision-Date: 2005-02-09 11:22+0100\n" +"Last-Translator: Nemeth Otto \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: eiconsconf.cpp:85 +msgid "Icons settings" +msgstr "Ikon beállítások" + +#: eiconsconf.cpp:87 +msgid "&OK" +msgstr "&OK" + +#: eiconsconf.cpp:90 +msgid "&Cancel" +msgstr "Mégs&em" + +#: eiconsconf.cpp:93 +msgid "&Apply" +msgstr "&Alkalmaz" + +#: eiconsconf.cpp:97 +msgid "Look&&feel" +msgstr "Megjelenés" + +#: eiconsconf.cpp:99 +msgid "Background color: " +msgstr "Háttér szín:" + +#: eiconsconf.cpp:106 +msgid "Label color: " +msgstr "Szöveg szín:" + +#: eiconsconf.cpp:112 +msgid "Maximum width: " +msgstr "Maximális szélesség:" + +#: eiconsconf.cpp:123 +msgid "Font height: " +msgstr "Font magasság:" + +#: eiconsconf.cpp:134 +msgid "Grid spacing: " +msgstr "Rácshoz igazítás:" + +#: eiconsconf.cpp:145 +msgid "Auto arrange icons" +msgstr "Ikonok automatikus rendezése" + +#: eiconsconf.cpp:151 +msgid "Engage with just one click" +msgstr "Egy kattintással aktivál" + +#: eiconsconf.cpp:159 +msgid "Clear this, to get transparent background." +msgstr "Töröld a kijelölést a szövegháttér eltűnéséhez" + +#: eiconsconf.cpp:176 +msgid "Choose color" +msgstr "Szín kiválasztása" + diff --git a/eiconsconf/locale/id.po b/eiconsconf/locale/id.po new file mode 100644 index 0000000..5089303 --- /dev/null +++ b/eiconsconf/locale/id.po @@ -0,0 +1,71 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR Free Software Foundation, Inc. +# FIRST AUTHOR , YEAR. +# +msgid "" +msgstr "" +"Project-Id-Version: eiconsconf 1.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2005-02-04 12:25+0100\n" +"PO-Revision-Date: 202-11-29 14:58+0700\n" +"Last-Translator: Bambang Purnomosidi D. P. \n" +"Language-Team: id \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=iso-8859-2\n" +"Content-Transfer-Encoding: 8bit\n" + +#: eiconsconf.cpp:85 +msgid "Icons settings" +msgstr "Seting ikon" + +#: eiconsconf.cpp:87 +msgid "&OK" +msgstr "&OK" + +#: eiconsconf.cpp:90 +msgid "&Cancel" +msgstr "&Batal" + +#: eiconsconf.cpp:93 +msgid "&Apply" +msgstr "&Terapkan" + +#: eiconsconf.cpp:97 +msgid "Look&&feel" +msgstr "Look&&feel" + +#: eiconsconf.cpp:99 +msgid "Background color: " +msgstr "Warna latar belakang" + +#: eiconsconf.cpp:106 +msgid "Label color: " +msgstr "Warna label" + +#: eiconsconf.cpp:112 +msgid "Maximum width: " +msgstr "Lebar maximum: " + +#: eiconsconf.cpp:123 +msgid "Font height: " +msgstr "Tinggi font: " + +#: eiconsconf.cpp:134 +msgid "Grid spacing: " +msgstr "Spasi grid: " + +#: eiconsconf.cpp:145 +msgid "Auto arrange icons" +msgstr "Ikon tersusun otomatis" + +#: eiconsconf.cpp:151 +msgid "Engage with just one click" +msgstr "Bekerja hanya dengan satu klik" + +#: eiconsconf.cpp:159 +msgid "Clear this, to get transparent background." +msgstr "Bersihkan ini, untuk mendapatkan latar belakang transparan." + +#: eiconsconf.cpp:176 +msgid "Choose color" +msgstr "Pilih warna" diff --git a/eiconsconf/locale/messages.pot b/eiconsconf/locale/messages.pot new file mode 100644 index 0000000..718f79d --- /dev/null +++ b/eiconsconf/locale/messages.pot @@ -0,0 +1,73 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2005-02-04 12:25+0100\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=CHARSET\n" +"Content-Transfer-Encoding: 8bit\n" + +#: eiconsconf.cpp:85 +msgid "Icons settings" +msgstr "" + +#: eiconsconf.cpp:87 +msgid "&OK" +msgstr "" + +#: eiconsconf.cpp:90 +msgid "&Cancel" +msgstr "" + +#: eiconsconf.cpp:93 +msgid "&Apply" +msgstr "" + +#: eiconsconf.cpp:97 +msgid "Look&&feel" +msgstr "" + +#: eiconsconf.cpp:99 +msgid "Background color: " +msgstr "" + +#: eiconsconf.cpp:106 +msgid "Label color: " +msgstr "" + +#: eiconsconf.cpp:112 +msgid "Maximum width: " +msgstr "" + +#: eiconsconf.cpp:123 +msgid "Font height: " +msgstr "" + +#: eiconsconf.cpp:134 +msgid "Grid spacing: " +msgstr "" + +#: eiconsconf.cpp:145 +msgid "Auto arrange icons" +msgstr "" + +#: eiconsconf.cpp:151 +msgid "Engage with just one click" +msgstr "" + +#: eiconsconf.cpp:159 +msgid "Clear this, to get transparent background." +msgstr "" + +#: eiconsconf.cpp:176 +msgid "Choose color" +msgstr "" diff --git a/eiconsconf/locale/ru.po b/eiconsconf/locale/ru.po new file mode 100644 index 0000000..62967ee --- /dev/null +++ b/eiconsconf/locale/ru.po @@ -0,0 +1,72 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR Free Software Foundation, Inc. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2005-02-04 12:25+0100\n" +"PO-Revision-Date: 2002-11-28 HO:MI+ZONE\n" +"Last-Translator: aabbvv \n" +"Language-Team: RUSSIAN \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=koi8-r\n" +"Content-Transfer-Encoding: 8bit\n" + +#: eiconsconf.cpp:85 +msgid "Icons settings" +msgstr " " + +#: eiconsconf.cpp:87 +msgid "&OK" +msgstr "&OK" + +#: eiconsconf.cpp:90 +msgid "&Cancel" +msgstr "" + +#: eiconsconf.cpp:93 +msgid "&Apply" +msgstr "" + +#: eiconsconf.cpp:97 +msgid "Look&&feel" +msgstr " " + +#: eiconsconf.cpp:99 +msgid "Background color: " +msgstr " : " + +#: eiconsconf.cpp:106 +msgid "Label color: " +msgstr " : " + +#: eiconsconf.cpp:112 +msgid "Maximum width: " +msgstr " : " + +#: eiconsconf.cpp:123 +msgid "Font height: " +msgstr " : " + +#: eiconsconf.cpp:134 +msgid "Grid spacing: " +msgstr " : " + +#: eiconsconf.cpp:145 +msgid "Auto arrange icons" +msgstr " " + +#: eiconsconf.cpp:151 +msgid "Engage with just one click" +msgstr " " + +#: eiconsconf.cpp:159 +msgid "Clear this, to get transparent background." +msgstr " " + +#: eiconsconf.cpp:176 +msgid "Choose color" +msgstr " " diff --git a/eiconsconf/locale/sk.po b/eiconsconf/locale/sk.po new file mode 100644 index 0000000..0bb930d --- /dev/null +++ b/eiconsconf/locale/sk.po @@ -0,0 +1,71 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR Free Software Foundation, Inc. +# FIRST AUTHOR , YEAR. +# +msgid "" +msgstr "" +"Project-Id-Version: eiconsconf 1.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2005-02-04 12:25+0100\n" +"PO-Revision-Date: 2002-04-21 14:50+0200\n" +"Last-Translator: Martin Pekar \n" +"Language-Team: Slovak \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: eiconsconf.cpp:85 +msgid "Icons settings" +msgstr "Nastavenie ikon" + +#: eiconsconf.cpp:87 +msgid "&OK" +msgstr "&OK" + +#: eiconsconf.cpp:90 +msgid "&Cancel" +msgstr "&Zrušiť" + +#: eiconsconf.cpp:93 +msgid "&Apply" +msgstr "&Použiť" + +#: eiconsconf.cpp:97 +msgid "Look&&feel" +msgstr "Look&&feel" + +#: eiconsconf.cpp:99 +msgid "Background color: " +msgstr "Farba pozadia:" + +#: eiconsconf.cpp:106 +msgid "Label color: " +msgstr "Farba menovky:" + +#: eiconsconf.cpp:112 +msgid "Maximum width: " +msgstr "Maximálna šírka:" + +#: eiconsconf.cpp:123 +msgid "Font height: " +msgstr "Veľkosť fontu:" + +#: eiconsconf.cpp:134 +msgid "Grid spacing: " +msgstr "Odstup mriežky:" + +#: eiconsconf.cpp:145 +msgid "Auto arrange icons" +msgstr "Automaticky usporiadavať ikony" + +#: eiconsconf.cpp:151 +msgid "Engage with just one click" +msgstr "Potvrdiť iba jedným kliknutím" + +#: eiconsconf.cpp:159 +msgid "Clear this, to get transparent background." +msgstr "Ak je tlačidlo odškrtnuté, budú sa zobrazovať transparentné ikony." + +#: eiconsconf.cpp:176 +msgid "Choose color" +msgstr "Voľba farby" diff --git a/eiconsconf/locale/sr.po b/eiconsconf/locale/sr.po new file mode 100644 index 0000000..4e23efd --- /dev/null +++ b/eiconsconf/locale/sr.po @@ -0,0 +1,71 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR Free Software Foundation, Inc. +# FIRST AUTHOR , YEAR. +# +msgid "" +msgstr "" +"Project-Id-Version: eiconsconf 1.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2005-02-04 12:25+0100\n" +"PO-Revision-Date: 2002-11-30 01:46+0100\n" +"Last-Translator: Dejan Lekic \n" +"Language-Team: LINUKS.org T.T. \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: eiconsconf.cpp:85 +msgid "Icons settings" +msgstr "Подешавања икона" + +#: eiconsconf.cpp:87 +msgid "&OK" +msgstr "&У реду" + +#: eiconsconf.cpp:90 +msgid "&Cancel" +msgstr "&Одустани" + +#: eiconsconf.cpp:93 +msgid "&Apply" +msgstr "&Примени" + +#: eiconsconf.cpp:97 +msgid "Look&&feel" +msgstr "Изглед и особине" + +#: eiconsconf.cpp:99 +msgid "Background color: " +msgstr "Боја позадине:" + +#: eiconsconf.cpp:106 +msgid "Label color: " +msgstr "Боја наслова:" + +#: eiconsconf.cpp:112 +msgid "Maximum width: " +msgstr "Максимална ширина:" + +#: eiconsconf.cpp:123 +msgid "Font height: " +msgstr "Висина фонта:" + +#: eiconsconf.cpp:134 +msgid "Grid spacing: " +msgstr "Размак међу линијама:" + +#: eiconsconf.cpp:145 +msgid "Auto arrange icons" +msgstr "Аутоматско ређање икона" + +#: eiconsconf.cpp:151 +msgid "Engage with just one click" +msgstr "Стартуј једним кликом:" + +#: eiconsconf.cpp:159 +msgid "Clear this, to get transparent background." +msgstr "Искључити ово, да би се добила провидна позадина." + +#: eiconsconf.cpp:176 +msgid "Choose color" +msgstr "Изаберите боју" diff --git a/eimage/Jamfile b/eimage/Jamfile new file mode 100644 index 0000000..7804d48 --- /dev/null +++ b/eimage/Jamfile @@ -0,0 +1,14 @@ +# +# $Id$ +# +# Part of Equinox Desktop Environment (EDE). +# Copyright (c) 2000-2007 EDE Authors. +# +# This program is licenced under terms of the +# GNU General Public Licence version 2 or newer. +# See COPYING for details. + +SubDir TOP eimage ; + +MakeProgram eimage : eimage.cpp ; +ExtractStrings locale : eimage.cpp ; diff --git a/eimage/Makefile b/eimage/Makefile new file mode 100644 index 0000000..bf79c45 --- /dev/null +++ b/eimage/Makefile @@ -0,0 +1,17 @@ + +CPPFILES = eimage.cpp +TARGET = eimage + +include ../makeinclude + +install: + $(INSTALL_PROGRAM) $(TARGET) $(bindir) + $(INSTALL_LOCALE) + +uninstall: + $(RM) $(bindir)/$(TARGET) + +clean: + $(RM) $(TARGET) + $(RM) *.o + diff --git a/eimage/eimage.cpp b/eimage/eimage.cpp new file mode 100644 index 0000000..3e75fe9 --- /dev/null +++ b/eimage/eimage.cpp @@ -0,0 +1,400 @@ +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + + +#define DEBUG 1 + + + +// Supported image types +const char* supported[] = {"bm","bmp","gif","jpg","pbm","pgm","png","ppm","xbm","xpm",0}; + + + +// Global variables used everywhere +char filename[FL_PATH_MAX], directory[FL_PATH_MAX]; +Fl_Window* w; +float zoomfactor; +bool autozoom=false; +Fl_Shared_Image *im; + +class ScrolledImage; +ScrolledImage* s; + + +// Directory list cache used in prevnext() +dirent **files; +int nfiles; + + +// Forward declaration of funcs for use from callbacks +void nextpic(); +void prevpic(); +void loadimage(); +void newdir(); + + + +// Callbacks for main menu +void next_cb(Fl_Widget*,void*) { nextpic(); } +void prev_cb(Fl_Widget*,void*) { prevpic(); } +void open_cb(Fl_Widget*,void*) { + // construct filename filter + char filter[FL_PATH_MAX]; + snprintf(filter, FL_PATH_MAX, "Image files(*.{%s", supported[0]); + for (int i=1; supported[i]; i++) + snprintf(filter, FL_PATH_MAX, "%s,%s", filter, supported[i]); + snprintf(filter, FL_PATH_MAX, "%s})", filter); + + const char* f = fl_file_chooser("Choose image or directory",filter,directory); + if (!f) return; + + strncpy(filename,f,FL_PATH_MAX); + newdir(); + loadimage(); +} + +void manage_cb(Fl_Widget* b,void*) {} // call file manager +void fullscreen_cb(Fl_Widget* b,void*) { + static bool isfull=false; + static int X,Y,W,H; + if (isfull) { + w->fullscreen_off(X,Y,W,H); + isfull=false; + } else { + X=w->x(); Y=w->y(); W=w->w(); H=w->h(); + w->fullscreen(); + isfull=true; + } +} +void zoomin_cb(Fl_Widget* b,void*) { + if (zoomfactor>=1) zoomfactor += 0.2; else zoomfactor += zoomfactor/5; + autozoom=false; + loadimage(); +} +void zoomout_cb(Fl_Widget* b,void*) { + if (zoomfactor>=1) zoomfactor -= 0.2; else zoomfactor -= zoomfactor/5; + autozoom=false; + loadimage(); +} +void zoomrestore_cb(Fl_Widget* b,void*) { zoomfactor = 1; autozoom=false; loadimage(); } +void zoomauto_cb(Fl_Widget *b,void*) { autozoom = !autozoom; loadimage(); } +void about_cb(Fl_Widget* b,void*) {} // about window +void exit_cb(Fl_Widget* b,void*) { exit(0); } + + + +// Main popup menu +Fl_Menu_Item mainmenu[] = { + {"&Open", FL_CTRL+'o', open_cb}, + {"&Manage", 0, manage_cb, 0, FL_MENU_DIVIDER}, + + {"&Previous", FL_Page_Up, prev_cb}, + {"&Next", FL_Page_Down, next_cb, 0, FL_MENU_DIVIDER}, + + {"&Zoom in", '+', zoomin_cb}, + {"Zoom &out", '-', zoomout_cb}, + {"Zoom &auto", FL_CTRL+'a', zoomauto_cb}, + {"&Restore", '/', zoomrestore_cb, 0, FL_MENU_DIVIDER}, + + {"&Fullscreen", FL_F+11, fullscreen_cb, 0, FL_MENU_DIVIDER}, + + {"A&bout", 0, about_cb}, + {"&Exit", FL_Escape, exit_cb}, + {0} +}; + + + + +class ScrolledImage : public Fl_Scroll { +private: + Fl_Box* b; + Fl_Menu_Button* mb; + +public: + ScrolledImage(int x, int y, int w, int h, const char*l = 0) + : Fl_Scroll(x,y,w,h,l) { + align(FL_ALIGN_INSIDE|FL_ALIGN_CENTER); + begin(); + + b = new Fl_Box(w/2,h/2,0,0); + + mb = new Fl_Menu_Button (0,0,0,0,""); + mb->type(Fl_Menu_Button::POPUP3); + mb->menu(0); + + end(); + redraw(); + } + + void image(Fl_Image* a) { b->image(a); } + void image(Fl_Image& a) { b->image(a); } + Fl_Image* image() { return b->image(); } + void label(const char* a) { + if (a) resizebox(0,0); // center label + b->label(a); + } + + // Resize the box containing image + void resizebox(int W, int H) { + int X=0,Y=0; + int aw = w()-scrollbar.w(); int ah=h()-hscrollbar.h(); + if(aw>W) X=(aw-W)/2; + if(ah>H) Y=(ah-H)/2; + b->resize(X,Y,W,H); + } + + void resize(int x,int y,int w,int h) { + Fl_Scroll::resize(x,y,w,h); + resizebox(b->w(),b->h()); // refresh image position + redraw(); + } + + virtual int handle(int event) { + if (event == FL_PUSH) { + if(Fl::event_button()==3 && mb->menu()!=0) { + mb->popup(); + return 1; + } + } + // sometimes PgUp and PgDown aren't handled + else if (event == FL_SHORTCUT && mb->menu()!=0) { + int key = Fl::event_key(); + if (key==FL_Page_Up || key==FL_Page_Down) + return mb->handle(event); + } + return Fl_Scroll::handle(event); + } + + void setmenu(Fl_Menu_Item* menu) { + if (menu!=0) { + mb->menu(menu); + } + } +}; + + + + +// Directory changed, get new directory from filename +void newdir() { + int p=0; + for (int i=0; irelease(); im=0; } + im = Fl_Shared_Image::get(filename); // image type is autodetected now + + if (!im) { + if (DEBUG) fprintf(stderr, "Fl_Shared_Image::get() failed!\n"); + s->image(0); + snprintf(tmp, FL_PATH_MAX, "Can't load image %s\n",filename); + s->label(strdup(tmp)); + s->redraw(); + return; + } + + // Measure image + int realw=im->w(), realh=im->h(); + int scaledw,scaledh; + + if (autozoom) { + // Adjust zoom factor so picture fits inside window + // When user switches to manual zooming, this factor will remain + float fw=(float)s->w()/realw; float fh=(float)s->h()/realh; + if (fw < fh) zoomfactor=fw; else zoomfactor=fh; + } + + // Resample image to new size + scaledw=realw*zoomfactor; + scaledh=realh*zoomfactor; + + if (zoomfactor!=1) { + Fl_Image *temp = im->copy(scaledw,scaledh); + im = (Fl_Shared_Image*) temp; + } + + // Set image + s->resizebox(scaledw,scaledh); + s->image(im); + + s->label(0); // clear any previous labels + s->redraw(); + + // set window title + if (zoomfactor==1) + snprintf(tmp,FL_PATH_MAX,"%s (%dx%d) - View picture",fl_filename_name(filename),realw,realh); + else + snprintf(tmp,FL_PATH_MAX,"%s (%dx%d) - zoom %1.1fx - View picture",fl_filename_name(filename),realw,realh,zoomfactor); + w->label(strdup(tmp)); +} + + +// Get next/previous picture file in directory +// (universal func. to be called from nextpic() and prevpic() ) +void prevnext(int direction) { + char tmp[FL_PATH_MAX]; // the string buffer + + if (DEBUG) + fprintf(stderr, "Prevnext() - file: %s dir: %s direction: %d\n",filename,directory,direction); + + if (nfiles == 0) { // read directory + nfiles = fl_filename_list(directory,&files); + } + + // Select next picture after current + bool found=false; + if (filename[0]) { + const char* justname = fl_filename_name(filename); + + // this basically means: if direction is 1 go from first to last, else from last to first + for (int i=(direction?0:nfiles-1); (direction?i=0); i+=(direction?1:-1)) { + if (strncmp(justname,files[i]->d_name,FL_PATH_MAX) == 0) { + found=true; + continue; // skip to next file + } + if (found) { + for (int j=0; supported[j]; j++) { + snprintf(tmp,FL_PATH_MAX,"*.%s",supported[j]); + if (fl_filename_match(files[i]->d_name,tmp)) { + snprintf(filename,FL_PATH_MAX,"%s/%s",directory,files[i]->d_name); + loadimage(); + return; + } + } + } + } + } + + if (found) { //this means that the current picture is the last/first in directory + if (im) { im->release(); im=0; } + s->image(0); + filename[0]=0; + + if (direction) + s->label("This was the last picture.\nPress 'Next' again for first one."); + else + s->label("This was the first picture.\nPress 'Previous' again for last one."); + s->redraw(); + return; + + } else { + // Just give first (or last) picture in directory + for (int i=(direction?0:nfiles-1); (direction?i=0); i+=(direction?1:-1)) { + for (int j=0; supported[j]; j++) { + snprintf(tmp,FL_PATH_MAX,"*.%s",supported[j]); + if (fl_filename_match(files[i]->d_name,tmp)) { + snprintf(filename,FL_PATH_MAX,"%s/%s",directory,files[i]->d_name); + loadimage(); + return; + } + } + } + } + + // Nothing found... + if (DEBUG) fprintf(stderr, "Nextpic() - nothing found\n"); + + if (im) { im->release(); im=0; } + s->image(0); + filename[0]=0; + snprintf(tmp,FL_PATH_MAX,"No pictures in directory %s",directory); + s->label(strdup(tmp)); + s->redraw(); + + // Window title + snprintf(tmp,FL_PATH_MAX,"View picture - nothing found in %s",directory); + w->label(strdup(tmp)); +} + +void nextpic() { prevnext(1); } +void prevpic() { prevnext(0); } + + + +int main (int argc, char **argv) { + filename[0]='\0'; directory[0]='\0'; zoomfactor=1; im=0; + fl_register_images(); + + + // Main window + + w = new Fl_Window(200, 200, "View picture"); + s = new ScrolledImage(0,0,200,200); + s->color(33); + s->labelcolor(FL_WHITE); + s->setmenu(mainmenu); + w->resizable(s); + w->end(); + w->align(FL_ALIGN_INSIDE|FL_ALIGN_CENTER); + + + + // Analyze command line + + if (argc==1) { // No params + strncpy (directory, getenv("HOME"), FL_PATH_MAX); + nextpic(); + + } else if (fl_filename_isdir(argv[1])) { // Param is directory + strncpy (directory, argv[1], FL_PATH_MAX); + nextpic(); + argc--; argv++; // ignore this param and forward rest to fltk + + } else { // Param is file + if (argv[1][0] == '~' && argv[1][1] == '/') // expand home dir + snprintf (filename, FL_PATH_MAX, "%s/%s", getenv("HOME"), argv[1]+2); + else if (argv[1][0] != '/') // relative filename + snprintf (filename, FL_PATH_MAX, "%s/%s", getenv("PWD"), argv[1]); + else // absolute filename + strncpy (filename, argv[1], FL_PATH_MAX); + + struct stat last_stat; // Does file exist? + if (stat(argv[0], &last_stat)!=0) { + char tmp[FL_PATH_MAX]; + snprintf(tmp,FL_PATH_MAX,"File not found - %s",filename); + s->label(tmp); + } else + loadimage(); + + newdir(); // rebuild char[] directory + argc--; argv++; // ignore this param and forward rest to fltk + } + + // Resize window to image size or screen + int W,H; + if (im->w()>Fl::w()) W=Fl::w(); else W=im->w(); + if (im->h()>Fl::h()) H=Fl::h(); else H=im->h(); + w->resize(0,0,W,H); + // Window manager should make sure that window is fully visible + + w->show(argc,argv); + return Fl::run(); +} + diff --git a/einstaller/Jamfile b/einstaller/Jamfile new file mode 100644 index 0000000..9bf4b82 --- /dev/null +++ b/einstaller/Jamfile @@ -0,0 +1,16 @@ +# +# $Id$ +# +# Part of Equinox Desktop Environment (EDE). +# Copyright (c) 2000-2007 EDE Authors. +# +# This program is licenced under terms of the +# GNU General Public Licence version 2 or newer. +# See COPYING for details. + +SubDir TOP einstaller ; + +SOURCE = einstaller.cpp einstall.cpp ; + +MakeProgram einstaller : $(SOURCE) ; +ExtractStrings locale : $(SOURCE) ; diff --git a/einstaller/Makefile b/einstaller/Makefile new file mode 100644 index 0000000..8429d06 --- /dev/null +++ b/einstaller/Makefile @@ -0,0 +1,21 @@ + +CPPFILES = einstaller.cpp einstall.cpp ../edelib2/Util.cpp ../edelib2/Run.cpp ../edelib2/process.cpp ../edelib2/pty.cpp ../edelib2/Config.cpp +TARGET = einstaller + +POFILES = locale/ru.po\ + locale/sk.po\ + locale/hu.po\ + +include ../makeinclude + +install: + $(INSTALL_PROGRAM) $(TARGET) $(bindir) + $(INSTALL_LOCALE) + +uninstall: + $(RM) $(bindir)/$(TARGET) + +clean: + $(RM) $(TARGET) + $(RM) *.o + diff --git a/einstaller/TODO b/einstaller/TODO new file mode 100644 index 0000000..36ab74f --- /dev/null +++ b/einstaller/TODO @@ -0,0 +1,8 @@ +- use PtyProcess directly + * look for (#) signs for progress bar +- new checkbox - "Show options" + * analyze output from ./configure --help and show options + * for packages, show "Suggests:" and "Recommends:" +- separate rpm/dpkg/installpkg code into neat classes, so it's easy to add support +for others +- add support for dependency resolvers (apt-get, urpmi, emerge) diff --git a/einstaller/einstall.cpp b/einstaller/einstall.cpp new file mode 100644 index 0000000..f93cdb5 --- /dev/null +++ b/einstaller/einstall.cpp @@ -0,0 +1,274 @@ +/* + * $Id$ + * + * Package manager for Equinox Desktop Environment + * Part of Equinox Desktop Environment (EDE). + * Copyright (c) 2000-2006 EDE Authors. + * + * This program is licenced under terms of the + * GNU General Public Licence version 2 or newer. + * See COPYING for details. + */ + +#include +#include +#include +#include +#include + +#include "einstall.h" +#include "einstaller.h" + +#include +#include // for PATH_MAX +#include "../edelib2/process.h" +#include "../edelib2/Run.h" + +using namespace fltk; +using namespace edelib; + + + +// TODO: Check for memleaks +// TODO: use generated temp file names + + + +// This is a simple Pty helper function to reduce typing +// Mostly copied from edelib2/Run.cpp but some important changes +// TODO: Consider merging with Run.cpp + +int ptyrun(const char *command) +{ + fprintf (stderr, "command: %s\n",command); + extern char **environ; + + // Initialize PTY + PtyProcess *child = new PtyProcess(); + child->setEnvironment((const char**)environ); // environ is C constant + + const char *cmdparts[4]; + cmdparts[0] = "/bin/sh"; + cmdparts[1] = "-c"; + cmdparts[2] = command; + cmdparts[3] = NULL; + + if (child->exec(cmdparts[0], cmdparts) < 0) { + fprintf (stderr, "Failed to start pty\n"); + return -1; + } + + // Wait for process to actually start. Shouldn't last long + while (1) { + int p = child->pid(); + if (p != 0 && child->checkPid(p)) + break; + int exit = child->checkPidExited(p); + if (exit != -2) { + // Process is DOA + fprintf (stderr, "Process has died unexpectedly! Exit status: %d\n",exit); + delete child; + } + fprintf (stderr, "Not started yet...\n"); + } + + int status = child->checkPidExited(child->pid()); + while (status == PtyProcess::NotExited) { + char *buffer = child->readLine(); + if (buffer != 0) { + result_output->insert(buffer); + result_output->relayout(); + result_output->scroll(result_output->buffer()->length(),0); + fltk::flush(); + } + status = child->checkPidExited(child->pid()); + } + fprintf (stderr, "status: %d\n",status); + delete child; + return status; +} + + +// Install program from source code using standard procedure (configure, make, make install) + +void sourcecode(const char* directory, const char* logname) +{ + char workpath[PATH_MAX], workfile[PATH_MAX], command[PATH_MAX]; + + // Buffer for stat() + struct stat *buf = (struct stat*)malloc(sizeof(struct stat)); + + // Sometimes archives contain everything in one directory + DIR *my_dir; + int count; + struct dirent *my_dirent; + char my_char[PATH_MAX]; + strcpy (workpath, directory); + +recurse: + my_dir = opendir(workpath); + count=0; + while ((my_dirent = (struct dirent64*) readdir(my_dir)) != NULL) { + strncpy(my_char, my_dirent->d_name, PATH_MAX); + count++; + } + closedir(my_dir); + if (count < 4) { // suspicious + char tmp[PATH_MAX*2+1]; + strcpy (tmp, workpath); + strcat (tmp, "/"); + strcat (tmp, my_char); + stat(tmp, buf); + if (strcmp(my_char,".")!=0 && strcmp(my_char,"..")!=0 && S_ISDIR(buf->st_mode)) { + strncpy (workpath, tmp, PATH_MAX); + goto recurse; + } + } + + // Main program loop + install_progress->position(0); + while (1) { + snprintf(workfile, sizeof(workfile)-1, "%s/Makefile", workpath); + if (stat (workfile, buf) == 0) { + install_progress->position(50); + snprintf(command, sizeof(command)-1, "cd %s; make", workpath); + ptyrun(command); + install_progress->position(75); + snprintf(command, sizeof(command)-1, "cd %s; make install >> %s", workpath, logname); + run_program(command,true,true,false); + install_progress->position(100); + result_output->insert(_("=== Program installed! ===\n")); + break; + } + + snprintf(workfile, sizeof(workfile)-1, "%s/configure", workpath); + if (stat (workfile, buf) == 0) { + install_progress->position(25); + snprintf(command, sizeof(command)-1, "cd %s; ./configure", workpath); + ptyrun(command); + + // Test to see if configure succeeded + snprintf(workfile, sizeof(workfile)-1, "%s/Makefile", workpath); + if (stat (workfile, buf) == 0) { + install_progress->position(50); + continue; // go back to start + } else { + result_output->insert(_("There was an error running configure. See below for details.\n\n")); + break; + } + } + + snprintf(workfile, sizeof(workfile)-1, "%s/configure.in", workpath); + if (stat (workfile, buf) == 0) { + snprintf(command, sizeof(command)-1, "cd %s; autoconf", workpath); + ptyrun(command); + + // Test to see if autoconf succeeded + snprintf(workfile, sizeof(workfile)-1, "%s/configure", workpath); + if (stat (workfile, buf) == 0) { + install_progress->position(25); + continue; // go back to start + } + } + + // Nothing found... + result_output->insert(_("This archive is not recognized as source code. Try looking inside with archiver.\n")); + break; + } + + // Clean up + snprintf(command, sizeof(command)-1, "rm -fr %s", directory); + run_program(command); + free(buf); +} + + +void install_package(const char *package, bool nodeps) +{ + char tempname[PATH_MAX], logname[PATH_MAX], tempdir[PATH_MAX]; + + const char *e = filename_ext(package); + strncpy(tempname, "/tmp/einstXXXXXX", PATH_MAX); // Use better temp file name + close(mkstemp(tempname)); + remove(tempname); + strncpy(logname, tempname, PATH_MAX); + + if (strlen(e)<1) { + result_output->insert(_("Package type is not recognized. Einstaller presently supports rpm, deb, tgz and source code packages.\n")); + result_output->relayout(); + return; + } + + if (strcmp(e, ".rpm")==0) { + char command[PATH_MAX]; + + if (nodeps) + snprintf(command, PATH_MAX, "rpm -i --nodeps %s >& %s", package, logname); + else + snprintf(command, PATH_MAX, "rpm -i %s >& %s", package, logname); + run_program(command,true,true,false); + install_progress->position(100); + } + else if (strcmp(e, ".tgz")==0) { + char command[PATH_MAX]; + snprintf(command, PATH_MAX, "installpkg %s >& %s", package, logname); + run_program(command,true,true,false); + install_progress->position(100); + } + else if (strcmp(e, ".deb")==0) { + char command[PATH_MAX]; + snprintf(command, PATH_MAX, "dpkg -i %s >& %s", package, logname); + run_program(command,true,true,false); + install_progress->position(100); + } + else if (strcmp(e, ".gz")==0) { + char command[PATH_MAX]; + + // Create temp directory + strncpy(tempdir, "/tmp/einstdXXXXXX", PATH_MAX); + mkdtemp(tempdir); + + snprintf(command, PATH_MAX, "tar xzvC %s -f %s", tempdir, package); + ptyrun(command); + sourcecode(tempdir, logname); + } + else if (strcmp(e, ".bz2")==0) { + char command[PATH_MAX]; + + // Create temp directory + strncpy(tempdir, "/tmp/einstdXXXXXX", PATH_MAX); + mkdtemp(tempdir); + + snprintf(command, PATH_MAX, "tar xjvC %s -f %s", tempdir, package); + ptyrun(command); + sourcecode(tempdir, logname); + } + else if (strcmp(e, ".tar")==0) { + char command[PATH_MAX]; + + // Create temp directory + strncpy(tempdir, "/tmp/einstdXXXXXX", PATH_MAX); + mkdtemp(tempdir); + + snprintf(command, PATH_MAX, "tar xvC %s -f %s", tempdir, package); + ptyrun(command); + sourcecode(tempdir, logname); + } + else { + result_output->insert(_("Package type is not recognized. Einstaller presently supports rpm, deb, tgz and source code packages.\n")); + result_output->relayout(); + return; + } + + char line[1024]; + FILE* log = fopen(logname, "r"); + + if (log != NULL) { + while(fgets(line, sizeof(line), log)) + result_output->insert(line); + result_output->relayout(); + result_output->scroll(result_output->buffer()->length(),0); + fclose(log); + } + unlink(logname); +} diff --git a/einstaller/einstall.h b/einstaller/einstall.h new file mode 100644 index 0000000..41f70cd --- /dev/null +++ b/einstaller/einstall.h @@ -0,0 +1,26 @@ +/* + * $Id$ + * + * Package manager for Equinox Desktop Environment + * Part of Equinox Desktop Environment (EDE). + * Copyright (c) 2000-2006 EDE Authors. + * + * This program is licenced under terms of the + * GNU General Public Licence version 2 or newer. + * See COPYING for details. + */ +#ifndef _EINSTALL_H +#define _EINSTALL_H + +#include +#include +#include +#include +#include +#include "../edelib2/NLS.h" + +void install_package(const char*, bool); + +#endif + + diff --git a/einstaller/einstaller.cpp b/einstaller/einstaller.cpp new file mode 100644 index 0000000..62a5baa --- /dev/null +++ b/einstaller/einstaller.cpp @@ -0,0 +1,156 @@ +/* + * $Id$ + * + * Package manager for Equinox Desktop Environment + * Part of Equinox Desktop Environment (EDE). + * Copyright (c) 2000-2006 EDE Authors. + * + * This program is licenced under terms of the + * GNU General Public Licence version 2 or newer. + * See COPYING for details. + */ + +#include "einstaller.h" +#include "einstall.h" + +#include +#include +#include +#include + +#include "icons/install.xpm" +#include "../edelib2/NLS.h" + +#include "../edeconf.h" + +using namespace fltk; + + +static TextBuffer *out_buffer; +static Window* install_window; + +static xpmImage datas_install((const char **)install); + +Group* steps_group; +Group* step1_group; +Input* package_name_input; +CheckButton* nodeps_button; +Group* step2_group; +TextEditor* result_output; +ProgressBar* install_progress; +Button* prev_button; +Button* next_button; + +static void cb_package_name_input(Button*, void*) { + next_button->activate(); +} + +static void cb_Browse(Button*, void*) { +// char *file_types = _("Packages (*.rpm; *.tgz; *.deb), *.{rpm|tgz|deb}, All files (*.*), *"); + const char *f = file_chooser(_("Package selection"), "*.{rpm|tgz|deb|gz|bz2}", package_name_input->value()); + if (f) { + package_name_input->value(f); + next_button->activate(); + } +} + +static void cb_prev_button(Button*, void*) { + step1_group->show(); + step2_group->hide(); + prev_button->deactivate(); + next_button->activate(); + out_buffer->remove(0,out_buffer->length()); + flush(); +} + + +static void cb_next_button(Button*, void*) { + step1_group->hide(); + step2_group->show(); + prev_button->activate(); + next_button->deactivate(); + flush(); + install_package(package_name_input->value(), nodeps_button->value()); +} + +static void cb_Close(Button*, void*) { + exit(0); +} + + +int main (int argc, char **argv) { + // fl_init_locale_support("einstaller", PREFIX"/share/locale"); + out_buffer = new TextBuffer(); + + {Window* o = install_window = new Window(505, 315, "Install software package"); + o->begin(); + { + InvisibleBox* o = new InvisibleBox(5, 5, 135, 270); + o->set_vertical(); + o->image(datas_install); + o->box(DOWN_BOX); + o->color((Color)0x7d8300); + } + { + Group* o = steps_group = new Group(145, 5, 350, 270); + o->box(FLAT_BOX); + o->begin(); + { + Group* o = step1_group = new Group(0, 0, 350, 270); + o->box(ENGRAVED_BOX); + o->begin(); + { + InvisibleBox* o = new InvisibleBox(5, 5, 340, 120, "Welcome. This installation wizard will help you to install new software on your computer."); + o->labelsize(18); + o->align(ALIGN_TOP|ALIGN_LEFT|ALIGN_INSIDE|ALIGN_WRAP); + } + { + Input* o = package_name_input = new Input(5, 125, 240, 25, "Enter the name of software package you want to install:"); + o->align(ALIGN_TOP|ALIGN_LEFT|ALIGN_WRAP); + o->callback((Callback*)cb_package_name_input); + } + { + Button* o = new Button(250, 125, 90, 25, "&Browse..."); + o->callback((Callback*)cb_Browse); + } + nodeps_button = new CheckButton(5, 160, 338, 25, "Ignore dependencies"); + o->end(); + } + { + Group* o = step2_group = new Group(0, 0, 350, 270); + o->box(ENGRAVED_BOX); + o->hide(); + o->begin(); + { + TextEditor* o = result_output = new TextEditor(5, 20, 335, 155, "Installation results:"); + o->align(ALIGN_TOP|ALIGN_LEFT|ALIGN_WRAP); + o->buffer(out_buffer); + } + { + ProgressBar* o = install_progress = new ProgressBar(5, 210, 335, 20, "Installation status:"); + o->align(ALIGN_TOP|ALIGN_LEFT); + } + o->end(); + } + o->end(); + } + { + Button* o = prev_button = new Button(195, 280, 90, 25, "<< &Previous"); + o->callback((Callback*)cb_prev_button); + o->deactivate(); + } + { + Button* o = next_button = new Button(295, 280, 90, 25, "&Install"); + o->callback((Callback*)cb_next_button); + o->deactivate(); + } + { + Button* o = new Button(405, 280, 90, 25, "&Close"); + o->callback((Callback*)cb_Close); + } + o->end(); + ; + } // Window + install_window->show(argc, argv); + return run(); +} diff --git a/einstaller/einstaller.fl b/einstaller/einstaller.fl new file mode 100644 index 0000000..47f41b0 --- /dev/null +++ b/einstaller/einstaller.fl @@ -0,0 +1,97 @@ +# data file for the FLTK User Interface Designer (FLUID) +version 2.0100 +images_dir ./ +header_name {.h} +code_name {.cpp} +gridx 5 +gridy 5 +snap 3 +decl {// Installer for EDE is (C) Copyright 2001-2002 by Martin Pekar, this program is provided under the terms of GNU GPL v.2, see file COPYING for more information.} {} + +decl {\#include } {} + +decl {\#include "einstall.h"} {} + +decl {fltk::TextBuffer *out_buffer;} {} + +Function {} {open +} { + code {fl_init_locale_support("einstaller", PREFIX"/share/locale"); +out_buffer = new Fl_Text_Buffer();} {} + {fltk::Window} install_window { + label {Install software package} open + private xywh {383 118 505 310} + extra_code {;} visible + } { + {fltk::InvisibleBox} {} { + xywh {5 5 135 270} box DOWN_BOX image {icons/install.xpm} color 0x7d8300 + } + {fltk::Group} steps_group {open + xywh {150 0 505 275} box FLAT_BOX + } { + {fltk::Group} step1_group {open selected + xywh {0 5 350 270} box ENGRAVED_BOX + } { + {fltk::Input} package_name_input { + label {Enter the name of software package you want to install:} + xywh {5 127 250 23} align 133 + } + {fltk::Button} {} { + label {&Browse...} + callback {char *file_types = _("Packages (*.rpm; *.tgz; *.deb), *.{rpm|tgz|deb}, All files (*.*), *"); +const char *f = file_chooser(_("Package selection"), file_types, package_name_input->value()); + + if (f) { + package_name_input->value(f); + }} + xywh {260 127 80 25} + } + {fltk::InvisibleBox} {} { + label {Welcome. This installation wizard will help you to install new software on your computer.} + xywh {0 0 340 90} align 149 labelsize 18 + } + {fltk::CheckButton} nodeps_button { + label {Ignore dependencies} + xywh {2 160 338 25} + } + } + {fltk::Group} step2_group {open + xywh {5 5 350 270} hide box ENGRAVED_BOX + } { + {fltk::Output} result_output { + label {Installation results:} + xywh {5 20 335 155} align 133 + extra_code {o->buffer(out_buffer);} + class {fltk::TextEditor} + } + {fltk::ValueInput} install_progress { + label {Installation status:} + xywh {5 210 335 20} align 5 + class {fltk::ProgressBar} + } + } + } + {fltk::Button} prev_button { + label {<< &Previous} + callback {step1_group->show(); +step2_group->hide(); +prev_button->deactivate();} + xywh {230 280 80 25} deactivate + } + {fltk::Button} next_button { + label {&Install} + callback {step1_group->hide(); +step2_group->show(); +prev_button->activate(); +install_package();} + xywh {315 280 80 25} + extra_code {;} + } + {fltk::Button} {} { + label {&Close} + callback {exit(0);} + private xywh {415 280 80 25} + extra_code {;} + } + } +} diff --git a/einstaller/einstaller.fld b/einstaller/einstaller.fld new file mode 100644 index 0000000..2edaec8 --- /dev/null +++ b/einstaller/einstaller.fld @@ -0,0 +1,107 @@ +# data file for the FLTK User Interface Designer (FLUID) +version 2,0003 +images_dir ./ +i18n +header_name {.h} +code_name {.cpp} +gridx 5 +gridy 5 +snap 3 +decl {// Installer for EDE is (C) Copyright 2001-2002 by Martin Pekar, this program is provided under the terms of GNU GPL v.2, see file COPYING for more information.} {} + +decl {\#include } {} + +decl {\#include "einstall.h"} {} + +decl {Fl_Text_Buffer *out_buffer;} {} + +Function {} {open +} { + code {fl_init_locale_support("einstaller", PREFIX"/share/locale"); +out_buffer = new Fl_Text_Buffer();} {} + Fl_Window install_window { + label {Install software package} open + private xywh {48 99 505 310} hide + extra_code {;} + } { + Fl_Box {} { + xywh {5 5 135 270} box DOWN_BOX image {icons/install.xpm} color 0x7d8300 + } + Fl_Group steps_group {open + xywh {140 0 355 275} box FLAT_BOX + } { + Fl_Group step1_group {open + xywh {5 5 350 270} box ENGRAVED_BOX + } { + Fl_Input package_name_input { + label {Enter the name of software package you want to install:} + xywh {10 132 250 23} align 133 + extra_code {;} + } + Fl_Button {} { + label {&Browse...} + callback {char *file_types = _("Packages (*.rpm; *.tgz; *.deb), *.{rpm|tgz|deb}, All files (*.*), *"); +const char *f = fl_select_file(package_name_input->value(), file_types, _("Package selection")); + + if (f) { + package_name_input->value(f); + }} selected + xywh {265 132 80 25} + extra_code {\#include } + } + Fl_Box {} { + label {Welcome. This installation wizard will help you to install new software on your computer.} + xywh {5 5 340 90} align 149 label_size 18 + extra_code {;} + } + Fl_Check_Button nodeps_button { + label {Ignore dependencies} + xywh {7 165 338 25} + extra_code {;} + } + } + Fl_Group step2_group {open + xywh {5 5 350 270} hide box ENGRAVED_BOX + } { + Fl_Output result_output { + label {Installation results:} + xywh {10 25 335 155} align 133 + extra_code {\#include +; +o->buffer(out_buffer);} + class Fl_Text_Editor + } + Fl_Value_Input install_progress { + label {Installation status:} + xywh {10 215 335 20} align 5 + extra_code {\#include +;} + class Fl_ProgressBar + } + } + } + Fl_Button prev_button { + label {<< &Previous} + callback {step1_group->show(); +step2_group->hide(); +prev_button->deactivate();} + xywh {230 280 80 25} deactivate + extra_code {;} + } + Fl_Button next_button { + label {&Install} + callback {step1_group->hide(); +step2_group->show(); +prev_button->activate(); +install_package();} + xywh {315 280 80 25} + extra_code {;} + } + Fl_Button {} { + label {&Close} + callback {exit(0);} + private xywh {415 280 80 25} + extra_code {;} + } + } +} diff --git a/einstaller/einstaller.h b/einstaller/einstaller.h new file mode 100644 index 0000000..8b265bc --- /dev/null +++ b/einstaller/einstaller.h @@ -0,0 +1,30 @@ +/* + * $Id$ + * + * Package manager for Equinox Desktop Environment + * Part of Equinox Desktop Environment (EDE). + * Copyright (c) 2000-2006 EDE Authors. + * + * This program is licenced under terms of the + * GNU General Public Licence version 2 or newer. + * See COPYING for details. + */ + + +#ifndef einstaller_h +#define einstaller_h +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern fltk::TextEditor* result_output; +extern fltk::ProgressBar* install_progress; +#endif diff --git a/einstaller/icons/install.xpm b/einstaller/icons/install.xpm new file mode 100644 index 0000000..7316166 --- /dev/null +++ b/einstaller/icons/install.xpm @@ -0,0 +1,490 @@ +/* XPM */ +const char *install[] = { +/* columns rows colors chars-per-pixel */ +"120 260 224 2", +" c Gray0", +". c #0f0f3f3f0f0f", +"X c #0f0f37372f2f", +"o c #202018180f0f", +"O c #20201f1f1f1f", +"+ c #2f2f28281010", +"@ c #2f2f28281f1f", +"# c #3f3f37371f1f", +"$ c #2f2f27272020", +"% c #2f2f2f2f2f2f", +"& c #202037372f2f", +"* c #202038383030", +"= c #20203f3f3f3f", +"- c #30302f2f2f2f", +"; c #303037372f2f", +": c #3f3f37372f2f", +"> c #3f3f37373030", +", c #000017174040", +"< c #00001f1f4040", +"1 c #00001f1f4f4f", +"2 c #00001f1f5050", +"3 c #00001f1f5f5f", +"4 c #000000007f7f", +"5 c #00001f1f6060", +"6 c #00001f1f6f6f", +"7 c #00001f1f7f7f", +"8 c #000028285f5f", +"9 c #0f0f37374040", +"0 c #000027276f6f", +"q c #000028286060", +"w c #000028286f6f", +"e c #000027277070", +"r c #000028287070", +"t c #00002f2f7070", +"y c #00003f3f7f7f", +"u c #20203f3f5050", +"i c #0f0f67670000", +"p c #0f0f68681f1f", +"a c #2f2f4f4f1010", +"s c #3f3f40403030", +"d c #2f2f68680000", +"f c #2f2f6f6f1010", +"g c #0f0f58584f4f", +"h c #000050505f5f", +"j c #101048484040", +"k c #0f0f60605f5f", +"l c #000068686060", +"z c #0f0f68686060", +"x c #000067677070", +"c c #000070706060", +"v c #000070706f6f", +"b c #000070707070", +"n c #000078787070", +"m c #00007f7f7f7f", +"M c #2f2f48484040", +"N c #2f2f50504f4f", +"B c #2f2f57575f5f", +"V c #202060604040", +"C c #2f2f68686060", +"Z c #303070707070", +"A c #4f4f38382020", +"S c #404048481010", +"D c #4f4f48482020", +"F c #4f4f40403030", +"G c #4f4f47473f3f", +"H c #5f5f47472f2f", +"J c #4f4f60601f1f", +"K c #707048481f1f", +"L c #6f6f68681f1f", +"P c #4f4f48484040", +"I c #4f4f50504040", +"U c #4f4f50504f4f", +"Y c #4f4f58584f4f", +"T c #5f5f57574f4f", +"R c #50505f5f5f5f", +"E c #4f4f70707070", +"W c #6f6f67674f4f", +"Q c #6f6f67675f5f", +"! c #6f6f6f6f6f6f", +"~ c #707070706060", +"^ c #707070706f6f", +"/ c #707078786f6f", +"( c #707078787070", +") c Gray50", +"_ c #00001f1f8f8f", +"` c #00000f0fa0a0", +"' c #00001717a0a0", +"] c #00001717afaf", +"[ c #00001f1fafaf", +"{ c #000027278080", +"} c #000027278f8f", +"| c #00002f2f8080", +" . c #00002f2f8f8f", +".. c #000027279090", +"X. c #00002f2f9090", +"o. c #00002f2f9f9f", +"O. c #0f0f37379090", +"+. c #00002727afaf", +"@. c #00002f2fa0a0", +"#. c #00002f2fafaf", +"$. c #00002f2fb0b0", +"%. c #00003737a0a0", +"&. c #00003737b0b0", +"*. c #00003737bfbf", +"=. c #00002f2fd0d0", +"-. c #00004f4f9f9f", +";. c #1f1f58589f9f", +":. c #00004040a0a0", +">. c #00004040bfbf", +",. c #00004848bfbf", +"<. c #00005858afaf", +"1. c #000078788080", +"2. c #00004747c0c0", +"3. c #00004040cfcf", +"4. c #00005050c0c0", +"5. c #00005858c0c0", +"6. c #00005858cfcf", +"7. c #00004848e0e0", +"8. c #00005050e0e0", +"9. c #00005757ffff", +"0. c #00006060cfcf", +"q. c #10106060cfcf", +"w. c #00006060ffff", +"e. c #00006f6ff0f0", +"r. c #0f0f6868f0f0", +"t. c #1f1f6f6fffff", +"y. c #3f3f7070cfcf", +"u. c #4f4f68689090", +"i. c #0000bfbf0000", +"p. c #202088881010", +"a. c #1f1f90906060", +"s. c #0000a0a04040", +"d. c #2f2fc7c72020", +"f. c #1f1fd0d04f4f", +"g. c #5f5f88881f1f", +"h. c #6060a0a01010", +"j. c #505090906f6f", +"k. c #6060cfcf2020", +"l. c #4040dfdf6f6f", +"z. c #000080808080", +"x. c #0000bfbfbfbf", +"c. c #3f3f90909090", +"v. c #20208f8fdfdf", +"b. c #707090909090", +"n. c #70709090afaf", +"m. c #50509797c0c0", +"M. c #6f6f9f9fcfcf", +"N. c #6060f0f0a0a0", +"B. c #bfbf00000000", +"V. c #a0a038381010", +"C. c #90906f6f1f1f", +"Z. c #9f9f70704f4f", +"A. c #808078786f6f", +"S. c #8f8f78786060", +"D. c #909088883f3f", +"F. c #8f8fb8b81010", +"G. c #9090b8b83f3f", +"H. c #bfbfbfbf0000", +"J. c #8f8f80806f6f", +"K. c #808080807070", +"L. c #8f8f87877070", +"P. c #bfbf98984040", +"I. c #afaf88886060", +"U. c #afaf98986f6f", +"Y. c #c0c0a7a77070", +"T. c #c0c0d8d82f2f", +"R. c Yellow", +"E. c #dfdfdfdf4f4f", +"W. c #808087878080", +"Q. c #8f8f88888f8f", +"!. c #8f8f90908f8f", +"~. c #909088888080", +"^. c #909090908080", +"/. c #9f9f90908f8f", +"(. c #9f9f98988f8f", +"). c #9f9f98989090", +"_. c #9f9f98989f9f", +"`. c #80809f9fa0a0", +"'. c #8f8fa0a0b0b0", +"]. c #a0a098989090", +"[. c #a0a0a7a79f9f", +"{. c #afafa8a89f9f", +"}. c #bfbfafaf9090", +"|. c #a0a0a8a8afaf", +" X c #afafa8a8a0a0", +".X c #a0a0b7b7afaf", +"XX c #b0b0afafa0a0", +"oX c #b0b0b0b0afaf", +"OX c #bfbfb7b7afaf", +"+X c #b0b0b8b8bfbf", +"@X c #bfbfb8b8b0b0", +"#X c Gray75", +"$X c #80809797f0f0", +"%X c #8080a7a7cfcf", +"&X c #9f9fb7b7c0c0", +"*X c #b0b0b8b8cfcf", +"=X c #a0a0afaff0f0", +"-X c #9090cfcfcfcf", +";X c #9090f0f0efef", +":X c #afafc8c8d0d0", +">X c #b0b0c7c7c0c0", +",X c #a0a0c8c8efef", +" j m m m m m m m m m m m m m m m m m m m m m m m m m m m ", +") m m m m m m m m m m m m m m m m Z sX4X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6XuX; ; s s s s s s j m m m m m m m m m m m m m m m m m m m m m m m m m m m ", +") m m m m m m m m m m m m m m m m Z aX5X6X6X5X5X5X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6XuX; ; s s s s s s j m m m m m m m m m m m m m m m m m m m m m m m m m m m ", +") m m m m m m m m m m m m m m m m Z pX5X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6XuX; ; s s s s s s j m m m m m m m m m m m m m m m m m m m m m m m m m m m ", +") m m m m m m m m m m m m m m m m Z pX5X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6XuX; ; s s s s s s j m m m m m m m m m m m m m m m m m m m m m m m m m m m ", +") m m m m m m m m m m m m m m m m Z pX5X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6XuX; ; s s s s s s j m m m m m m m m m m m m m m m m m m m m m m m m m m m ", +") m m m m m m m m m m m m m m m m Z pX5X6X6X6X6X|.`.`.`.`.'.+X+X+X+X#X#X#X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6XuX- ; s s s s s s j m m m m m m m m m m m m m m m m m m m m m m m m m m m ", +") m m m m m m m m m m m m m m m m Z pX6X6X6X6X4 , , 4 4 4 , , 4 4 4 5 5 4 2 5 5 5 5 5 5 y ;.B B B ;.;.u.u.n.n.n.n.|.+X+X+X+X+X+X+X#X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6XuX% ; s s s s s s j m m m m m m m m m m m m m m m m m m m m m m m m m m m ", +") m m m m m m m m m m m m m m m m Z aX6X6X6X6X4 , 5 4 4 4 4 4 4 4 4 4 4 4 4 4 4 , , , , , , , , , , , , , , , , , , 2 2 2 , , , 2 3 2 2 2 3 q q w u.6X6X6X6X6X6X6X6X6XuX% ; s s s s s s j m m m m m m m m m m m m m m m m m m m m m m m m m m m ", +") m m m m m m m m m m m m m m m m Z sX6X6X6X6X4 , 6 ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 , , , , q 6X6X6X6X6X6X6X6X6XuX% ; s s s s s s j m m m m m m m m m m m m m m m m m m m m m m m m m m m ", +") m m m m m m m m m m m m m m m m Z sX6X6X6X6X4 , 7 ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` q 6X6X6X6X6X6X6X6X6XuX% ; s s s s s s j m m m m m m m m m m m m m m m m m m m m m m m m m m m ", +") m m m m m m m m m m m m m m m m Z sX6X6X6X6X4 , _ ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` 4 q 6X6X6X6X6X6X6X6X6XuX% ; s s s s s s j m m m m m m m m m m m m m m m m m m m m m m m m m m m ", +") m m m m m m m m m m m m m m m m Z sX6X6X6X6X4 , 4 ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` 4 q 6X6X6X6X6X6X6X6X6XpX@ ; s s s s s s j m m m m m m m m m m m m m m m m m m m m m m m m m m m ", +") m m m m m m m m m m m m m m m m Z sX6X6X6X6X4 , 4 ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` 4 q 6X6X6X6X6X6X6X6X6XpX@ ; s s s s s s j m m m m m m m m m m m m m m m m m m m m m m m m m m m ", +") m m m m m m m m m m m m m m m m Z sX6X6X6X6X4 , 4 ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` 4 q 6X6X6X6X6X6X6X6X6XuX% ; s s s s s s = m m m m m m m m m m m m m m m m m m m m m m m m m m m ", +") m m m m m m m m m m m m m m m m Z sX6X6X6X6X4 , ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` 4 0 5X6X6X6X6X6X6X6X6XuX% ; s s s s s s = m m m m m m m m m m m m m m m m m m m m m m m m m m m ", +") m m m m m m m m m m m m m m m m Z sX6X6X6X6X4 , ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` 6 5X6X6X6X6X6X6X6X6XuX% ; s s s s s s = m m m m m m m m m m m m m m m m m m m m m m m m m m m ", +") m m m m m m m m m m m m m m m m Z sX6X6X6X6X4 , ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` 6 5X6X6X6X6X6X6X6X6XuX% ; s s s s s s j m m m m m m m m m m m m m m m m m m m m m m m m m m m ", +") m m m m m m m m m m m m m m m m Z sX4X6X6X6X4 , ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` 6 5X6X6X6X6X6X6X6X6XuX% ; s s s s s s j m m m m m m m m m m m m m m m m m m m m m m m m m m m ", +") m m m m m m m m m m m m m m m m Z sX5X6X6X6X4 , ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` 6 5X6X6X6X6X6X6X6X6XuX% ; s s s s s s j m m m m m m m m m m m m m m m m m m m m m m m m m m m ", +") m m m m m m m m m m m m m m m m C sX6X6X6X6X4 , ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` 0 5X6X6X6X6X6X6X6X6XuX$ ; s s s s s s j m m m m m m m m m m m m m m m m m m m m m m m m m m m ", +") m m m m m m m m m m m m m m m m C sX6X6X6X6X4 , ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` 0 5X6X6X6X6X6X6X6X6XpX$ ; s s s s s s j m m m m m m m m m m m m m m m m m m m m m m m m m m m ", +") m m m m m m m m m m m m m m m m C sX6X6X6X6X4 , ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` 0 5X6X6X6X6X6X6X6X6XpX$ ; s s s s s s j m m m m m m m m m m m m m m m m m m m m m m m m m m m ", +") m m m m m m m m m m m m m m m m C sX6X6X6X6X4 , ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` 0 5X6X6X6X6X6X6X6X6XpX$ ; s s s s s s j m m m m m m m m m m m m m m m m m m m m m m m m m m m ", +") m m m m m m m m m m m m m m m m C sX6X6X6X6X4 , ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' 0 4X6X6X6X6X6X6X6X6XpX$ ; s s s s s s j m m m m m m m m m m m m m m m m m m m m m m m m m m m ", +") m m m m m m m m m m m m m m m m C sX6X6X6X6X4 , ' ' ' ' ] ' ] ' ' ' ' ] ' ' ' ' ' ] ' ' ] ] ' ' ] ' ] ' ' ' ] ' ] ' ' ' ] ' ] ' ' ] ' ' ' ] ' ] 0 4X6X6X6X6X6X6X6X6XpX$ ; s s s s s s j m m m m m m m m m m m m m m m m m m m m m m m m m m m ", +") m m m m m m m m m m m m m m m m C aX6X6X6X6X4 , [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ 0 4X6X6X6X6X6X6X6X6XpX@ ; s s s s s s j m m m m m m m m m m m m m m m m m m m m m m m m m m m ", +") m m m m m m m m m m m m m m m m C aX5X6X6X6X4 , [ [ [ [ [ [ [ [ [ [ [ +.o.X.#.#.#.#.#.#.#.+.+.[ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ t 4X6X6X6X6X6X6X6X6XpX$ ; s s s s s s j m m m m m m m m m m m m m m m m m m m m m m m m m m m ", +") m m m m m m m m m m m m m m m m C aX4X6X6X6X4 , +.+.+.+.+.+.+.+.+.+.+.X.y .X.X.X.#.#.$.#.#.#.+.+.+.+.+.+.+.+.+.+.+.+.+.+.t 4X6X6X6X6X6X6X6X6XpX% ; s s s s s s j m m m m m m m m m m m m m m m m m m m m m m m m m m m ", +") m m m m m m m m m m m m m m m m C pX5X6X6X6X4 , +.+.$.$.$.$.$.+.+.+.$.;. m.M.M.M.m.m.m.u.;.;.y &.$.+.$.$.+.$.+.+.+.+.+.+.+.t 4X6X6X6X6X6X6X6X6XpX$ ; s s s s s s j m m m m m m m m m m m m m m m m m m m m m m m m m m m ", +") m m m m m m m m m m m m m m m m C uX5X6X6X6X4 , $.$.$.$.$.$.$.$.$.$.&.q. &X&X&X&X&X&X&X&X%X%XM.M.M.M.M.M.M.M.M.m. ;.&.$.$.$.$.$.$.$.$.$.$.$.$.t 4X6X6X6X6X6X6X6X6XpX$ ; s s s s s s j m m m m m m m m m m m m m m m m m m m m m m m m m m m ", +") m m m m m m m m m m m m m m m m C uX6X4X6X6X4 , $.$.$.$.$.$.$.$.$.$.>.q. +X+X+X+X+X+X+X+X+X+X+X+X+X+X+X+X+X+X+X&X ;.>.$.$.$.$.$.$.$.$.$.$.$.$.t 4X6X6X6X6X6X6X6X6XpX$ ; s s s s s s j m m m m m m m m m m m m m m m m m m m m m m m m m m m ", +") m m m m m m m m m m m m m m m m C yX6X4X6X6X4 , &.&.&.&.&.&.&.&.&.&.>.q. +X+X&X&X&X>X>X>X>X>X+X+X+X+X+X+X+X+X+X&X ;.>.&.&.&.&.&.&.&.&.&.&.&.&.t >X6X6X6X6X6X6X6X6XpX% ; s s s s s s j m m m m m m m m m m m m m m m m m m m m m m m m m m m ", +") m m m m m m m m m m m m m m m m C sX6X4X6X6X4 , *.&.*.*.&.*.&.&.*.&.,.q. +X+X-Xu.;.;.u.m.m.n.%X:X9X9X7X:X-X>X+X&X ;.,.&.*.&.*.&.&.*.&.&.*.&.*.t >X6X6X6X6X6X6X6X6XpX$ ; s s s s s s j m m m m m m m m m m m m m m m m m m m m m m m m m m m ", +") m m m m m m m m m m m m m m m m C sX6X5X6X6X4 2 >.>.>.>.>.>.>.>.>.>.,.q. +X>X-X%Xn.m.m.u.;.;.u.sXsXsXsXsXsX>X+X&X ;.,.>.>.>.>.>.>.>.>.>.>.>.>.t >X6X6X6X6X6X6X6X6XpX@ ; s s s s s s j m m m m m m m m m m m m m m m m m m m m m m m m m m m ", +") m m m m m m m m m m m m m m m m C sX6X5X6X6X4 2 >.>.>.>.>.>.>.>.>.>.,.q. +X&X-X-X-X-X-X-X-X-X-X:X:X7X9XsXsXsX+X&X ;.,.>.>.>.>.>.>.>.>.>.>.>.>.t >X6X6X6X6X6X6X6X6XpX@ ; s s s s s s j m m m m m m m m m m m m m m m m m m m m m m m m m m m ", +") m m m m m m m m m m m m m m m m C sX6X4X6X6X4 , ,.,.,.,.,.,.,.,.,.,.,.q. M.M.M.M.%X%X-X-X-X-X-X-X-X-X-X-X-X>X+X-X ;.,.,.,.,.,.,.,.,.,.,.,.,.,.y >X6X6X6X6X6X6X6X6XpX@ ; s s s s s s j m m m m m m m m m m m m m m m m m m m m m m m m m m m ", +") m m m m m m m m m m m m m m m m C sX6X4X6X6X4 2 2.,.2.,.2.2.2.,.2.,.,.6. q.q.y.y.m.M.M.M.M.M.M.M.M.M.M.%X-X-X-X%X ;.6.2.,.2.,.2.2.,.2.2.2.2.2.y >X6X6X6X6X6X6X6X6XpX@ ; s s s s s s j m m m m m m m m m m m m m m m m m m m m m m m m m m m ", +") m m m m m m m m m m m m m m m m C sX6X4X6X6X4 2 4.4.4.4.4.4.4.4.4.4.4.4. y y ;.;.;.q.q.y.y.y.m.M.M.M.M. ;.6.4.4.4.4.4.4.4.4.4.4.4.4.y >X6X6X6X6X6X6X6X6XpX@ ; s s s s s s g m m m m m m m m m m m m m m m m m m m m m m m m m m m ", +") m m m m m m m m m m m m m m m m C sX6X4X6X6X4 2 4.4.4.4.4.4.4.4.4.4.4.4.4.4.4.4.5.<. y y ;.;.;. <.5.4.4.4.4.4.4.4.4.4.4.4.4.y >X6X6X6X6X6X6X6X6XpX@ ; s s s s s s g m m m m m m m m m m m m m m m m m m m m m m m m m m m ", +") m m m m m m m m m m m m m m m m C sX6X4X6X6X4 2 5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.<. 5.5.5.5.5.5.5.5.5.5.5.5.5.5.y >X6X6X6X6X6X6X6X6XpX@ ; s s s s s s g m m m m m m m m m m m m m m m m m m m m m m m m m m m ", +") m m m m m m m m m m m m m m m m C sX6X4X6X6X4 2 6.5.6.6.6.6.6.6.6.6.6.5.6.6.6.6.6.6.6.6.6.6.6.6.6.6.6.6.6.6.6.6.6.6.6.5.6.6.6.6.6.6.6.6.6.6.6.6.y >X6X6X6X6X6X6X6X6XpX@ ; s s s s s : k m m m m m m m m m m m m m m m m m m m m m m m m m m m ", +") m m m m m m m m m m m m m m m m C sX6X4X6X6X4 2 5.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.y *X6X6X6X6X6X6X6X6XpX$ ; s s s s s ; k m m m m m m m m m m m m m m m m m m m m m m m m m m m ", +") m m m m m m m m m m m m m m m m C sX6X4X6X6X4 2 0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.y *X6X6X6X6X6X6X6X6XpX$ ; s s s s s s * m m m m m m m m m m m m m m m m m m m m m m m m m m m ", +") m m m m m m m m m m m m m m m m B sX6X4X6X6X4 2 5.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.y *X6X6X6X6X6X6X6X6XpX$ ; s s s s s s & m m m m m m m m m m m m m m m m m m m m m m m m m m m ", +") m m m m m m m m m m m m m m m m k sX6X4X6X6X4 2 5.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.y *X6X6X6X6X6X6X6X6XpX$ ; s s s s s s j m m m m m m m m m m m m m m m m m m m m m m m m m m m ", +") m m m m m m m m m m m m m m m m C sX6X4X6X6X4 5 5.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.y *X6X6X6X6X6X6X6X6XpX$ ; s s s s s s j m m m m m m m m m m m m m m m m m m m m m m m m m m m ", +") m m m m m m m m m m m m m m m m C sX6X6X6X6X4 5 0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.y *X6X6X6X6X6X6X6X6XpX$ ; s s s s s s j m m m m m m m m m m m m m m m m m m m m m m m m m m m ", +") m m m m m m m m m m m m m m m m C sX6X6X6X6X4 5 0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.y +X6X6X6X6X6X6X6X6XpX$ ; s s s s s s j m m m m m m m m m m m m m m m m m m m m m m m m m m m ", +") m m m m m m m m m m m m m m m m C sX6X6X6X6X4 %.5.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.y +X>X6X6X6X6X6X6X6XpX@ ; s s s s s s j m m m m m m m m m m m m m m m m m m m m m m m m m m m ", +") m m m m m m m m m m m m m m m m C sX6X6X6X6X4 4 y 0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.y +X6X6X6X6X6X6X6X6XpX$ ; s s s s s s j m m m m m m m m m m m m m m m m m m m m m m m m m m m ", +") m m m m m m m m m m m m m m m m C sX6X6X6X6X4 4 4 4 4 <.5.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.5.y &X6X6X6X6X6X6X6X6XpX% ; s s s s s s j m m m m m m m m m m m m m m m m m m m m m m m m m m m ", +") m m m m m m m m m m m m m m m m C sX5X6X6X6X6Xn.'.u.;.4 4 4 4 4 4 4 <.5.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.5.q 6X6X6X6X6X6X6X6X6XpX$ ; s s s s s s j m m m m m m m m m m m m m m m m m m m m m m m m m m m ", +") m m m m m m m m m m m m m m m m C sX5X6X6X6X6X6X6X6X6X6X+X&X&X&Xu.;.4 4 4 4 4 4 4 <.5.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.5.q 6X6X6X6X6X6X6X6X6XpX$ ; s s s s s s j m m m m m m m m m m m m m m m m m m m m m m m m m m m ", +") m m m m m m m m m m m m m m m m C sX4X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X>X+X&X&Xn.;.4 4 4 4 4 4 4 <.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.5.q 6X6X6X6X6X6X6X6X6XpX$ ; s s s s s s j n z j k m m m m m m m m m m m m m m m m m m m m m m m ", +") m m m m m m m m m m m m m m m m C sX4X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X4X>X+X&Xn.u.4 4 4 4 4 4 4 <.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.5.q 6X6X6X6X6X6X6X6X6XpX% ; s s s s > ; * * = k * z m m m m m m m m m m m m m m m m m m m m m m ", +") m m m m m m m m m m m m m m m m C sX4X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X4X>X&X'.u.4 4 4 4 4 4 4 5.0.0.0.0.0.0.0.0.0.q 6X6X6X6X6X6X6X6X6XpX$ ; > ; ; % ; * W U.U.U.z = m m m m m m m m m m m m m m m m m m m m m m ", +") m m m m m m m m m m m m m m m m C sX5X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X>X+X'.b.4 4 4 4 4 4 4 5.0.<.y 6X6X6X6X6X6X6X6X@X).$ % ; * W I.U.U.U.U.U.U.U.= k m m m m m m m m m m m m m m m m m m m m m ", +") m m m m m m m m m m m m m m m m z sX#X4X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X>X.X'.4 4 4 4 6X6X6X6X2X!.R > s s W S.U.U.U.U.U.U.U.U.U.U.U.U.* n m m m m m m m m m m m m m m m m n m m m ", +") m m m m m m m m m m m m m m m m z aX#X#X#X#X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X#X).Q > > G W S.U.U.U.U.U.U.U.U.U.U.U.U.U.U.U.U.j k m m m m m m m m m m m m m v k * * n m m ", +") m m m m m m m m m m m m m m m m m n v v z C `.#X#X#X#X#X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X5X[.^ G > G T S.U.U.U.U.U.U.U.U.U.U.U.U.U.U.U.U.U.U.U.U.U.* v m m m m m m m m m n k = * M N M m m m ", +") m m m m m m m m m m m m m m m m m m m m m m n v v z z Z |.#X#X#X#X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6XR > I T S.U.U.U.U.U.U.U.U.U.U.U.U.U.U.U.U.U.U.U.U.U.U.U.U.U.U.k m m m m m m n k * * D D D D ; v m m m ", +") m m m m m m m m m m m m m m m m m m m m m m m m m m m n v v z z Z _.oX#X#X#X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X|.~ U.U.U.U.U.U.U.U.U.U.U.U.U.U.U.U.U.U.U.U.U.U.U.U.U.U.U.U.U.U.v m m m m n k * ; D D F D D D M m m m m ", +") m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m n v z z I [.#X#X#X#X#X#X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6XS.U.U.U.U.U.U.U.U.U.U.U.U.U.U.U.U.U.U.U.U.U.U.U.U.U.U.Z.W I.sXsX5Xn & g G D D D D D D D D * v m m m m ", +") m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m E I > % % - ; L.OX#X#X#X#X#X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X4X~ U.U.U.U.U.U.U.U.U.U.U.U.U.U.U.U.U.U.U.U.U.U.I.W I.5XsXaXZ.D # D D D D D D D D D D D D = m m m m m ", +") m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m g B I U U U I s o o o $ Q #X#X#X#X#X6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X+X~ U.U.U.U.U.U.U.U.U.U.U.U.U.U.U.U.U.U.U.Z.W Y.sXsXsX}.# D D D D D D D D D D D D D O j m m m m m ", +") m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m z l P I I I I I I I G U P > @ O o o o o O #X#X#X#X#X#X6X6X6X6X6X6X6X6X6X6XW.T U.U.U.U.U.U.U.U.U.U.U.U.U.U.U.I.Z.U.rXsXsXsXsXsX# D D D D D D D D D D : $ o = m m m m m ", +") m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m j C Q R R T U I I I I G I I P G G > ; % $ O o o o o O #X#X#X#X#X6X6X6X6X6X6XW D U.U.U.U.U.U.U.U.U.U.U.U.Z.D.}.sXsXsXsXsXsXsXI.D D D D D D D D D D o o = m m m m m ", +") m m m m m m m m z N N j j N N z n n n n m m m m m m m m m z l E ) / ^ ! Q R R T U I G I I I P G G > ; % % @ O O o o o o o o o #X#X#X#X#X6X6XW H U.U.U.U.U.U.U.U.I.Z.Y.yXsXsXsXsXsXsXsXsXsXo D D D D D D D # = m m m m m ", +") m m m m m m n Y Y Q ~ (.[.[.~.!./.L./ E E C C z m m m m g n ).!.Q.W.) K.( ^ ! ! Q R T U U I I I P G s > ; % % @ @ O O O o o o o O O O o o o #X#X#XY # U.U.U.U.U.Z.I.OXsXsXsXsXsXsXsXsXsXsXsXW D D D D D D & Z c.M m m m m m ", +") m m m m m m v oXyXpXaXuXyX6XoX/.~ T T ~ (.].XXZ m m k v `.oX|. X[._./.!.Q.W.) ) / ^ ! T R R T U I I P G s > ; ; % % % % @ @ @ @ @ % % % ; ; ; ; $ % ; # U.I.I.}.aXsXsXsXsXsXsXsXsXsXsXsXsXyXo D D D # A OX+XsXsXR m m m m m ", +") m m m m m m v oX~ G I ~ ~.OXuXsXsXpXyXL.XXZ j j z.4X4X4X+X@XoXXX X_._.).!.Q.W.) K.^ Q ! ! Q R R T U P P G G s > > ; ; ; ; ; ; ; ; > s s G G P I G W # H ^.6XuXsXsXsXsXsXsXsXsXsXsXsXsXD D D Z.sXsXsX:XsXsXR m m m m m ", +") m m m m m m k @X~ {.~.! o $ 2X6X6X6X6X5X5X#X2X@X@XoX|. X[._./.!.Q.K.! ( / ^ ! Q R R T U I P P G G G G G G G G G G G P P I I I s U.S.W D D : # D H W S.OXuXsXsXsX}.o A }.sXsXsXsXsX7XsXsXR m m m m m ", +") m m m m m m k 5XI OXO o !.6X6X6X6X6X6X6X6X6X6X4X4X4X2X@XoXXX X[._.).!.) ) ) K.( ^ ! ! Q R R T U I I I I I I I I I I I I I P G : U.U.U.U.U.U.U.S.S.W W D : # D o W sXsXsXsXsXsXsXsX7XsXsXR m m m m m ", +") m m m m m m k 6XF o s 2X6X6X6X6X6X6X6X6X6X6X6X6X6X6X5X5X#X2X@X@XoX|. X[./.W.K.W.W.) ) / ^ ! Q R R T U I I I I I I I I P G G P F U.U.U.U.U.U.U.U.U.U.U.U.U.U.~ @ Y.sXsXsXsXsXsXsXsXsXsX9XsXsXR m m m m m ", +") m m m m m m z 6XG o ~ yXsXsXsXsX6X6X6X6X6X6X6X6X6X6X6X6X6X6X6X4X4X4X2X@XoXXX X[./.W.K.) K.K.( ^ ! ! ! Q R T U I P G G G G P I I F U.U.U.U.U.U.U.U.U.U.U.U.U.U.W H aXsXsXsXsXsXsXsXsXsXsXsXsX0XsXsXR m m m m m ", +") m m m m m m k 6XO O ) ~ W.) !.|.sXsXsXsXsXsXsX6X6X6X6X6X6X6X6X6X6X6X5X5X#X2X@X@XoX X X[./.Q.W.) / ^ ! Q Q R R R R T U I I I I I F U.U.U.U.U.U.U.U.U.U.U.U.U.U.W Z.sXsXsXsXsXsXsXsXsXsXsXsXsXsXsX0XsXsXC m m m m m ", +") m m m m m m k yX O / / / / / / ) W.Q./.W._._.sXsXsXsXsXsXsX6X6X6X6X6X6X6X6X4X4X4X+X@XoXXX X_._.).!.Q.W.) K.( ^ ! ! Q R R T U I F U.U.U.U.U.U.U.U.U.U.U.U.U.U.W rXsXsXsXsXsXsXsXsXsXsXsXsXsXsXsX0XsXsXN m m m m m ", +") m m m m m m k pX O / / / / / / / / / / / / / / W.Q.!.!.{.oXsXsXsXsXsXsXsXsX6X6X6X5X5X#X2X@X@XoX X X[._./.!.Q.W.) ) / ^ ! Q R R G U.U.U.U.U.U.U.U.U.U.U.U.U.U.W sXsXsXsXsXsXsXsXsXsXsXsXsXsXsXsX0XsXsXN m m m m m ", +") m m m m m m k aX O / / / / / / / / / / / / / / / / / ~.L.~.) W.!.!.Q._._.|.sXsXsXsXsX#X#X#X#X4X+X@XoXXX X_._.).!.Q.W.) K.( ^ ! I U.U.U.U.U.U.U.U.U.U.U.U.U.U.W sXsXsXsXsXsXsXsXsXsXsXsXsXsXsXsX0XsXsXN m m m m m ", +") m m m m m m g aX O / / / / / / / / / / / / / / / / / L.^./.K./ / / / / / ^ W.Q.!.!.!._._.sXsX#X#X#X#X#X#X#XoX|. X[._./.!.Q.W.) T U.U.U.U.U.U.U.U.U.U.U.U.U.U.W sXsXsXsXsXsXsXsXsXsXsXsXsXsXsXsX0XsXsXN m m m m m ", +") m m m m m m j aX O / / / / / / / / / / / / / / / / / K.L.(.L./ / / / / / / / / / / / / ~ W.Q.!.!.W.) Q.sXsX#X#X#X#X#X#X_._.).!.T U.U.U.U.U.U.U.U.U.U.U.U.U.U.W sXsXsXsXsXsXsXsXsXsXsXsXsXsXsXsX0XsXsXN m m m m m ", +") m m m m m m k rX O / / / / / / / / / / / / / / / / / ) L.(.~./ / / / / / / / / / / / / / / / / / / / ~ ) Q.!.!.( ( ( sX#X#X#X#XT U.U.U.U.U.U.U.U.U.U.U.U.U.U.W sXsXsXsXsXsXsXsXsXsXsXsXsXsXsXsXaXsXsXN m m m m m ", +") m m m m m m j {. O / / / / / / / / / / / / / / / / / / L.^.(.L./ / / / / / / / / / / / / / / / / / / / / / / / / / ~ ) Q.!._.^ P U.U.U.U.U.U.U.U.U.U.U.U.U.U.W sXsXsXsXsXsXsXsXsXsXsXsXsXsXsXsXaXsXsXN m m m m m ", +") m m m m m m j XX O / / / / / / / / / / / / / / / / / / ) L.(./.L./ / / / / / / / / / / / / / / / / / ~ ~ ~ / / / / / / / / / ~ : U.U.U.U.U.U.U.U.U.U.U.U.U.U.W sXsXsXsXsXsXsXsXsXsXsXsXsXsXsXsXaXsXsX= m m m m m ", +") m m m m m m j ^. O A./ / / / / / / / / / / / / / / / / / K.L.(.(.L.A./ / / / / / / / / / / / / / / |.|.|.|._.!.W./ ~ ~ ~ ~ / / ; U.U.U.U.U.U.U.U.U.U.U.U.U.U.D sXsXsXsXsXsXsXsXsXsXsXsXsXsXsXsXaXsXsX= m m m m m ", +") m m m m m m N J. O K.K.K.K.K.) A.A.A./ / / / / / / / / / / L.^.^.(.^.L.A./ / / / / / / / / / / / ~ |.|.|.|.|.|.|.|.|.|.|.|._.Q.s U.U.U.U.U.U.U.U.U.U.U.U.U.U.@ sXsXsXsXsXsXsXsXsXsXsXsXsXsXsXsXaXsXsX= m m m m m ", +") m m m m m m N 5XuX6XXX~ I % O W.W.W.W.W.L.L.L.K.K.K.K.) ) ) A./ / / / / K.~.L.^.(.^.L.A./ / / / / / / / / / / |.|.|.|.|.|.|.|.|.|.|.|.|.|.P U.U.U.U.U.U.U.U.U.U.U.U.U.U.@ sXsXsXsXsXsXsXsXsXsXsXsXsXsXsXsXaXsXsX= m m m m m ", +") m m m m m m N 4X4X4X5X5X6XyXaXsX6X].T O !.!.Q.~.~.~.~.W.W.W.W.W.W.L.L.L.K.K.K.K.) ) K.L.~.L.^.(.^.L.) / / / / / / / / / K.W.[.|.|.|.|.|.|.|.|.|.|.|.P U.U.U.U.U.U.U.U.U.U.U.U.U.U.@ sXsXsXsXsXsXsXsXsXsXsXsXsXsXsXsXaXsXsX= m m m m m ", +") m m m m m m N 5X6X6X5X4X4X5X].~ OX6X_.O )./././././.!.!.!.!.Q.~.~.~.~.W.W.W.W.W.W.L.L.L.L.W./.^.(.^.^.~.L.L.L.K.A./ / / / / / / ~ ~ ~ ~ W.Q._.|.|.|.P U.U.U.U.U.U.U.U.U.U.U.U.U.U.@ sXsXsXsXsXsXsXsXsXsXsXsXsXsXsXsXsXsXsX= m m m m m ", +") m m m m m m B oXoX2XOX4X4X[.O % o OX!.O ].].].].].).).).)./././././.!.!.!.!.Q.~.~.~.~.W.W.W.W.~.(.].].^.^.^.^././.^.~.~.L.L.L.K.A./ / / / / / ~ ~ ~ ; U.U.U.U.U.U.U.U.U.U.U.U.U.U.@ sXsXsXsXsXsXsXsXsXsXsXsXsXsXsXsXsXsXsX= m m m m m ", +") m m m m m m C 2XT ~ 2X4X4X^.@ s @ /.!.$ [.[.[.[.[.[.[.[.].].].].].).).).)./././././.!.!.!.!.Q.~.Q./.(.].].].(.(.(.(.^.(.(.(.(.(./.^.~.~.W.L.L.K.A./ % U.U.U.U.U.U.U.U.U.U.U.U.U.U.@ sXsXsXsXsXsXsXsXsXsXsXsXsXsXsXsXsXsXiX= m m m m m ", +") m m m m m v C 5X4X4X4X4X4X5X; @ ; 5X!.O (.[.oXXX X X X[.[.[.[.[.[.[.[.[.].].].].].).).).)././././././././././.(.(.(.(.(.(.^.(.^.^.^.(.(.].].(.(./.^.; U.U.U.U.U.U.U.U.U.U.U.U.U.U.@ sXsXsXsXsXsXsXsXsXsXsXsXsXsXsXsXsXsXaX= m m m m m ", +") m m m m m n z z E `..X4X4X5XyXOXyX6X_.O J.Q T W ~ L.^.].[.XXXX X X X X[.[.[.[.[.[.[.[.[.].].].].].).).).)././././././././././.(.(.(.(./.^./.(.^.^.(.: U.U.U.U.U.U.U.U.U.U.U.U.U.U.@ sXsXsXsXsXsXsXsXsXsXsXsXsXsXsXsXsXsXaX= m m m m m ", +") m m m m m m m m k v j j j * Y ) !.Q : ; @XOXOXOX[./.~.S.W T W S.~.(.].oXXXXXXX X X X X[.[.[.[.[.[.[.[.[.].].].].].).).).)./././././././././.(.(.(.(.: U.U.U.U.U.U.U.U.U.U.U.U.U.U.@ sXsXsXsXsXsXsXsXsXsXsXsXsXsXsXsXsXsXaX= m m m m m ", +") m m m m m m n C z.4X4XOX).W.R G $ % ; G R ( ). XXXoXoXoXoXOXXX[./.J.~ W T Q A./.].[.oXXXXXXXXX X X X X[.[.[.[.[.[.[.[.[.].].].].].).).).)./././././.s U.U.U.U.U.U.U.U.U.U.U.U.U.U.@ sXsXsXsXsXsXsXsXsXsXsXsXsXsXsXsXsXsXaX= m m m m m ", +") m m m m m m B C 4X4X4X4X4X4X4X4X4X@X[.) Q G % @ ; I Y ) ). XoXoXoXoXoXOX@X[.]./.A.Q T W ~ J./.[. XoXXXXXXXXXXX X X X X[.[.[.[.[.[.[.[.[.].].].].].).T U.U.U.U.U.U.U.U.U.U.U.U.U.U.+ sXsXsXsXsXsXsXsXsXsXsXsXsXsXsXsXsXsXaX= m m m m m ", +") m m m m m v P @X4X4X4X4X4X4X4X4X4X4X4X4X4X4X4X4X XW.! P ; O ; P R ) `. XoXoXoXoXoXoXOXOX[.].~.S.W T W S.~./.[.OXoXoXXXXXXXXXXX X X X X[.[.[.[.[.[.[.T U.U.U.U.U.U.U.U.U.U.U.U.U.U.+ sXsXsXsXsXsXsXsXsXsXsXsXsXsXsXsXsXsXaX= m m m m m ", +") m m m m m N ) 4X4X4X4X5X6X6X4X4X4X4X4X4X4X4X4X4X4X4X4X4X4X4X[.Q.! P ; O ; G R ( !.[.oXoXoXoXoXoXOXOXXX[./.L.~ W T W A./.].[.OXoXoXXXXXXXXXXXXX X X XT U.U.U.U.U.U.U.U.U.U.U.U.U.U.+ sXsXsXsXsXsXsXsXsXsXsXsXsXsXsXsXsXsXaX= m m m m m ", +") m m m m v R 4X4X4XJ.~ XXW 6X4X4X4X5X6X5X4X4X4X4X4X4X4X4X4X4X4X4X4X4X4X XQ.Q I ; O ; G R ( !.[. XoXoXoXoXoXoXOXOX{.]./.A.Q T W ~ J./.].XXOXoXoXoXXXT U.U.U.U.U.U.U.U.U.U.U.U.U.U.+ @ sXsXsXsXsXsXsXsXsXsXsXsXsXsXsXsXsXsX0X= m m m m m ", +") m m m m B !.4X4X4X].T @ 2X5XXX/.2XOX uX5X6X4X5X4X4X4X4X4X4X4X4X4X4X4X4X4X4X4X4X#XoX~.Q P - O @ G R ( !.[.|.oXoXoXoXoXoXOXOXOX[.].^.A.W T W ~ ~./.T U.U.U.U.U.U.U.U.U.U.U.U.U.U.+ @ sXsXsXsXsXsXsXsXsXsXsXsXsXsXsXsXsXsX0X= m m m m m ", +") m m m z R 4X4X4X4X4X5X6X6X4X4X[.F o Q T J.L. 6X6X6XL.5X4X4X4X4X4X4X4X4X4X4X4X4X4X4X4X4X4X4X5X@X~.Q G % O O ; Y ( !._.|.@XOXoXoXoXoXoXOXOXXX[./.L.F U.U.U.U.U.U.U.U.U.U.U.U.U.U.+ @ sXsXsXsXsXsXsXsXsXsXsXsXsXsXsXsXsXsX0X= m m m m m ", +") m m m Y !.4X4X4X4X4X4X4X4X4X4X4X5X6X6X5X~.Q ~ - Q 5XyXuXT [.4X4X4X4X4X4X4X4X4X4X4X4X4X4X4X4X4X4X4X5X5X2XQ.Q F @ O O @ G R !._..X4X@XOXoXoXoXoXG U.U.U.U.U.U.U.U.U.U.U.U.U.U.+ sXsXsXsXsXsXsXsXsXsXsXsXsXsXsXsXsXsX0X= m m m m m ", +") m m z R b.4X4X4X4X4X4X4X4X4X4X4X4X4X4X4X4X5X6X6X5X[.T ].o o 5X5X5X6XyX~./.4X4X5X5X4X4X4X4X4X4X4X4X4X4X4X4X4X4X5X5X6X4X~.Q F $ O O O - Y ! '.+X4XI U.U.U.U.U.U.U.U.U.U.U.U.U.U.o sXsXsXsXsXsXsXsXsXsXsXsXsXsXsXsXsXsX0X= m m m m m ", +") m m U !.b.4X4X6X6XyX~ 5X4X4X4X4X4X4X4X4X4X4X4X4X4X4X5X5X6X6X2X{.5X5X : L.2XuX~.o 6X4X5X6X5X4X4X4X4X4X4X4X4X4X4X4X4X4X4X4X5X6X6X5X~.Q T @ O O O # U.U.U.U.U.U.U.U.U.U.U.U.U.U.o sXsXsXsXsXsXsXsXsXsXsXsXsXsXsXsXsXsX0X= m m m m m ", +") m z R b.#X4XXX - T 5X4X5X6X6X[.5X4X4X4X4X4X4X4X4X4X4X4X4X4X4X4X4X5X6X[.~.J. A.J.XX^. uX6X6XXX5X4X4X4X4X4X4X4X4X4X4X4X4X4X4X4X4X4X5X6X6X5X^.F U.U.U.U.U.U.U.U.U.U.U.U.U.U.o sXsXsXsXsXsXsXsXsXsXsXsXsXsXsXsXsXsX0X= m m m m m ", +") m U _.+X4X4X4X5X[.G {.5X5X P A. XXyXuXJ.[.4X4X5X5X4X4X4X4X4X4X4X4X4X4X4X4X5X6X6XuX].Q @ ~ - ~ W 6X4X5X5X6X4X5X4X4X4X4X4X4X4X4X4X4X4X4X4X4X4X4XT U.U.U.U.U.U.U.U.U.U.U.U.U.U.o sXsXsXsXsXsXsXsXsXsXsXsXsXsXsXsXsXsX8X= m m m m m ", +") z R .X4X4X4X4X4X4X5X5X4X5XXX~.P ~ O - L.2XuXJ.: 6X5X5X6X4X4X4X4X4X4X4X4X4X4X4X4X4X5X6X6X5X[.J.o {.5XXX@ J.(. 6X6X6X/.2X4X4X4X4X4X4X4X4X4X4X4X4XT U.U.U.U.U.U.U.U.U.U.U.U.U.U. sXsXsXsXsXsXsXsXsXsXsXsXsXsXsXsXsXsX:X= m m m m m ", +") U X4X4X+X4X4X4X5X6X6X[.5X5X6X6X6X6X6X].(.A. A.J.XX~ 6X4X4X4X5X6X5X4X4X4X4X4X4X4X4X4X4X4X5X5X5X4X2X~.Q ~ - Q (.yXuXJ./.5X4X5X5X4X4X4X4XT U.U.U.U.U.U.U.U.U.U.U.U.U.U. sXsXsXsXsXsXsXsXsXsXsXsXsXsXsXsXsXsX:X= m m m m m ", +") R @X4X4X+X4X4XXX T T 6XyXuXT XX4X5X6X6X6X6XyXuX].T @ {.5XXX/.5XOX uX5X6X4X5X4X4X4X4X4X4X4X4X4X4X4X4X4X5X6X6X6X].Q L.@ o A.[.pX~ o 4X4X4X4XT U.U.U.U.U.U.U.U.U.U.U.U.U.U. sXsXsXsXsXsXsXsXsXsXsXsXsXsXsXsXsXsX:X= m m m m m ", +") oX4X4X4X@X5X6X5XOX~.F {. O ].5XpX- J.6X5X6X6X5X5X6X6X5X4XXX- o Q T J.L. 6X6X6X/.5X4X4X5X4X4X4X4X4X4X4X4X4X4X4X5X5X6X6X2X].L.@ 2X4X4X5X6XG U.U.U.U.U.U.U.U.U.U.U.U.U.U. sXsXsXsXsXsXsXsXsXsXsXsXsXsXsXsXsXsX:X= m m m m m ", +") .X4X4X4X.XJ.L. 5X6X6X6XyX6X].5XT J.L.XXo 5X4X5X4X5X6X5X6X6XyX4X~.T ~ - Q XXyXuXQ [.4X4X4X4X4X4X4X4X4X4X4X4X4X4X4X4X5X6X6X6X4X4X4X~ # U.U.U.U.U.U.U.U.U.U.U.U.U.U. sXsXsXsXsXsXsXsXsXsXsXsXsXsXsXsXsXsXc.* z m m m m ", +") Z .X4X4X.XQ o J.5X4XA.~.2XuXaX~ ~.yXyXuX/.T % 6X5X(./.6XJ. yX6X6X5X5X5X6X6X6X6X].T ^.o o OX5X5X6XyX/./.4X4X4X5X4X4X4X4X4X4X4X4X4X4X4X4X4X5X6XF U.U.U.U.U.U.U.U.U.U.U.U.U.U. o sXsXsXsXsXsXsXsXsXsXsXsXsXsXsXsXsX&XN k m m m m m ", +") B b.4X4X.X6X6X5X4X4XA.G o o OX4X5X6XyXyXuXyX5X5X].: A.I L.~ pX6XyX~.6X4X5X6X6X6X6XOX].5X5Xo F A.2XuX(.o 6X5X5X6X5X4X4X4X4X4X4X4X4X4X4XF U.U.U.U.U.U.U.U.U.U.U.U.U.U. @ sXsXsXsXsXsXsXsXsXsXsXsXsXsXsXsXC * z m m m m m m ", +") U c.'.`.z.6X6X6X4X4X5X6X6X6X2X].5X4X[. @ Q ~.2X6X6X6XyXuXuX4X~.T A. ; : 5XyXuX: XX4X4X4X5X5X5X6X6X{.J.L. ~ J.XX^. uX6X6XXX5X4X4X4X4X4X4XF U.U.U.U.U.U.U.U.U.U.U.U.U.U. @ sXsXsXsXsXsXsXsXsXsXsXsXsXsX@X* M n m m m m m m m ", +") n U U U B G : T ~.6X6X6X6X6X5X5X4X4X4X6X[.L.G o : J.[.6XyXyXuXuXyX5X].T [.o 6X5X6X6XuX~ [.4X5X6X6X6X6XyXuX[.W @ ~ - ~ Q 6X4X4X4X4X5X6XF U.U.U.U.U.U.U.U.U.U.U.U.U.U. # sXsXsXsXsXsXsXsXsXsXsXsXsX! * k m m m m m m m m m ", +") m n z C C P * M N N G s s A.[.6X6X6X6X5X5X5X6X6X6X5X/.~ @ @ Q ~.2XyXuXuXyXyXpXOX5X5X5X - (.5XpXW T 6X5X6X6X5X5X6XyX6X].J.o {.5X4X4X~ [.aX I U.U.U.U.U.U.U.U.U.U.U.U.U.U. W sXsXsXsXsXsXsXsXsXsXsXuXk * z m m m m m m m m m m ", +") m m m m m m m m m n z * = N N T G : T L.6X6X6X6X6X5X5X5X6X6X6X[.L.G o o : J.[.pX J.4X4X6X6X^.{.Q J.L.XXQ uX6X6X[.5X4X5X6X4X4X4X2XG @ !.U.U.U.U.U.U.U.U.U.U.U.U.U.U. W sXsXsXsXsXsXsXsXsXsX5X= = n m m m m m m m m m m m ", +") m m m m m m m m m m m m m m m k & = M M N T F P A.XX6X6X6X6X5X5X5X6X6X6X5X/.~ % yX4X4X5X6XyXyXyXyXuXaX].T % ~ F A.% 6X4X4X4X4X5X6X5X5X6X6X6X) U.U.U.U.U.U.U.U.U.U.U.U.U.U. W sXsXsXsXsXsXsXsXsX).* k m m m m m m m m m m m m m ", +") m m m m m m m m m m m m m m m m m m m m n z & M N M T P F W L.6X6X6X6X6X5X5X5X6X6X6X4X4X4Xo o : J.[.yXJ. yX6X6X5X].J. 6X5X4XOXS.[.yX 4X4X4X4X4X) U.U.U.U.U.U.U.U.U.U.U.U.U.U. D sXsXsXsXsXsXsXsXk * z m m m m m m m m m m m m m m ", +") m m m m m m m m m m m m m m m m m m m m m m m m m n k & * M N F T P P ~ XX6X6X6X6X5X4X4X4X6X6XOX/.~ @ {.4X4X4X5X6XuXyX6X4X5X5XT @ F 6X4X4X4X4X) U.U.U.U.U.U.U.U.U.U.U.U.U.U. # sXsXsXsXsXsXyXM = n m m m m m m m m m m m m m m m ", +") m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m z & & M M s P T F W L.5X6X6X6X6X5X5X5X6X6X6X5X4X4X4X(. : J.].6XaX 6X6X6X5X4X4X4X4X4XR U.U.U.U.U.U.U.U.U.U.U.U.U.U.o # sXsXsXsXsX@X* j n m m m m m m m m m m m m m m m m ", +") m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m n z X * M M F T T T ~ XX6X6X6X6X5X4X4X4X4X5X2X/.~ @ 6X4X4X4X4X4X4X4X@X! U.U.U.U.U.U.U.U.U.U.U.U.U.U.o # sXsXsXsXE * z m m m m m m m m m m m m m m m m m m ", +") m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m n z X & * M s P T P W L.5X6X6X6X5X5X5X5X6X6X6X6X4X4X4X4X4X4X4X5X^.M U.U.U.U.U.U.U.U.U.U.U.U.U.U.o # sXsXaXj * v m m m m m m m m m m m m m m m m m m m ", +") m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m n z & X * M M F T T I ~ [.6X6X6X6X5X4X4X4X4X4X4X4X4X].A.= U.U.U.U.U.U.U.U.U.U.U.U.U.U.o # sX6X* M n m m m m m m m m m m m m m m m m m m m m ", +") m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m n z X X = M > P T P T L.2X6X6X6X5X4X4X5X(.* k U.U.U.U.U.U.U.U.U.U.U.U.U.U. # _.* k m m m m m m m m m m m m m m m m m m m m m m ", +") m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m n z & X = M > F T T T ~ ].5XL.~ v k N z S.I.U.U.U.U.U.U.U.U.U.U. M * v m m m m m m m m m m m m m m m m m m m m m m m ", +") m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m n z & X X = > F P J.v n z j = * * M N ~ U.U.U.U.U.U.U. $ = n m m m m m m m m m m m m m m m m m m m m m m m m ", +") m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m z z X l v m m m m m v k M * * = T ~ U.U.U. o * g m m m m m m m m m m m m m m m m m m m m m m m m m m ", +") m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m n m m m m m m m m m m v k j * * = T O * k m m m m m m m m m m m m m m m m m m m m m m m m m m m ", +") m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m n z j = v m m m m m m m m m m m m m m m m m m m m m m m m m m m m ", +") m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m ", +") m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m ", +") m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m n v c c c v n m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m ", +") m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m c g V c <.z.r.q.e.e.0.a.p.p p k c m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m ", +") m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m n c f k.d.z.9.9.8.6.8.6.6.,.6.7.q.W J p.p.a.g v n m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m ", +") m m m m m m m m m m m m m m m m m m m m a.b.b.b.n.n.%X%X=X.>.;.p p p.J j m m m m m m m m m m m m m m m m m m m m m m m m m m ", +") m m m m m m m m m m m m m m c.;X;XN.N.f.f.f.f.f.j.b.b.n.n.$X=XqXsXsXsXtXtXtXtXiX:Xm.m m m m m m m m m m m m 1.u.T.F.b.9.r.r.r.r.9.9.9.r.e.! j.B u.y ;.Z.V.V.V.B.< 7.3.3.2.2.>.*.-.h *.p.L o.b m m m m m m m m m m m m m m m m m m m m m m m m ", +") m m m m m m m m m m m m m m c.1X1X;X;XN.l.f.f.f.f.j.b.n.n.%X=X.>.>.>.%.&.:.$.#.J #.l m m m m m m m m m m m m m m m m m m m m m m m ", +") m m m m m m m m m m m m m m ,XwX1X1X1X;XN.N.f.f.f.f.j.`.n.n.$X.>.&.%.#.@.@.@.Y S | k m m m m m m m m m m m m m m m m m m m m m m ", +") m m m m m m m m m m m m m n sXeXwXwX1X1X;X;XN.l.f.f.f.j.b.n.%X=XiXsXsXtXtXtXiXeXwX1X;X;XN.N.m m m m m x b.q.2.c.q.v.q.R.k.m.9.w.9.j.k.d.0.c.6.n z ;.V g.U 3.7.3.u.P y 2.2.>.>.&.%.%.@.@.o.o.G S Y k m m m m m m m m m m m m m m m m m m m m m ", +") m m m m m m m m m m m m m X sXiXiXeXwXwX1X1X;X;Xl.f.f.f.b.b.n.$X7XsXsXtXtXtXeXwX1X;X;XN.N.N.l.m m m x r.9.9.r.r.r.j.k.D.C.H.l.k.l.v.a.p.n a.k.j.g.9.q.d.D.:.2.2.2.3.3.>.>.>.>.&.%.%.@.o.o...' V 8 K l m m m m m m m m m m m m m m m m m m m m ", +") m m m m m m m m m m m m m j sXiXiXiXiXeXwXwX1X1X;XN.f.f.f.b.n.%X.*.*.&.&.#.%.%.%.o. .} } _ D L v m m m m m m m m m m m m m m m m m m m ", +") m m m m m m m m m m m m m v sXsXsXsXiXiXiXeXeXwX1X;XN.l.f.a.`.n.=XsXsXtXtXeXwX1X;XN.N.l.l.a.a.a.a.;.9.w.w.r.e.c.T.D.P.P.P.P.Z.k.G.T.E.T.k.d.d.<.r.q.q.F.g.O.G.s 7.=.2.&.&.&.$.#.#.@.@.O. . .} { { | K J m m m m m m m m m m m m m m m m m m m ", +") m m m m m m m m m m m m m v _.sXsXsXsXsXsXiXiXiXeXwX1X;XN.f.f.b.%XqXsXtXtXwX1X;XN.l.l.a.a.a.a.V V V 6.r.w.r.e.v.c.y.u.Z.P.P.Z.G.F.k.G.T.G.k.p.9.8.8.7.a.h.h.g.H.g.g.V 3.>.%.%.@.@.@.@.o.O. .} { { { y J V m m m m m m m m m m m m m m m m m m ", +") m m m m m m m m m m m m m v 0XsXsXsXsXsXsXsXsXsXiXiXeXwX1XN.f.a.'..o.o.o.o.o. . .} { 7 7 { h d f m m m m m m m m m m m m m m m m m ", +") m m m m m m m m m m m m m m g |.eXeXiXiXiXsXsXsXsXsXsXsXsXsXsXsXN.g u.qXN.a.V V V N N N N N N N N N N N ;.r.r.t.t.t.v.v.U.Z.P.E.E.E.E.E.G.G.k.k.d.d.p.:.c.h.F.C.9 E =.:.*.&.:.O.o.o..... . .{ | 7 7 { ..f g.g m m m m m m m m m m m m m m m m ", +") m m m m m m m m m m m m m m v = 7X*X:X:X:X:X:X:X:X7X7X7XqXqXeXiXc.z.z.x X N = = u u u u u u u B u B B B B r.r.t.t.t.t.v.~ E.Y.P.P.E.E.E.h.k.k.G.G.h.p.p.k.h.h.h.W g.h V >.o.@.@.@.o..... . .{ { e 6 7 { h J f m m m m m m m m m m m m m m m m ", +") m m m m m m m m m m m m m m m . P &X'.'.'.'.'.'.'.'.'.'.'.'.'.'.&Xz.z.z.z.* qX'.b.u.E E E B B B B B B B B B t.t.t.t.v.v.m.Z.P.Z.C.E.E.E.E.h.k.T.G.h.g.h.h.h.h.a D.i k ..%.@.@.o.......} . .{ e 7 7 7 { @.d J g m m m m m m m m m m m m m m m ", +") m m m m m m m m m m m m m m m m N `.'.'.'.'.'.'.'.'.'.'.&X&X:X7XiX7Xz.z.z.z.iXsXsXsXsXiX7X,X&X'.n.b.u.u.u.E u.t.t.t.v.v.m.( P.I.Z.E.E.T.E.E.h.G.T.a p.G.g.h.d g.C.7 *.%.o.o.o.o.....} } } | { e 6 7 7 { } y d f n m m m m m m m m m m m m m m ", +") m m m m m m m m m m m m m m m m l $ &X'.'.'.'.'.&X&X&X:X:X7XeXiXsXsX9X.>.z O.;.K A K S 8 } { .h p 6 7 e 6 0 8 q 3 5 3 3 q 8 r q | | | O.O.O.O.X.X. .....*.n m m m m m m m m m m m m ", +") m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m n m u.j.|.`.8XwXwXwXwXwXeXeXiX7XR u.3.3.2.2.2.2.2.2.2.>.>.>.>.>. .&.;.K A + a } | _ p . 7 e 3 5 w 3 3 3 2 2 2 5 q q r r O.| | O.| O.X. . ...o.*.m m m m m m m m m m m m m ", +") m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m.Z -Xu.n.n.u.u.u z q.3.3.3.2.3.*.2.2.*.2.*.>.>.%.%.%.-.o.;.K K H A X y g d . 6 0 e q 3 3 2 2 8 q 8 8 * p j y y V y O.| | X.X.o. .o.&.m m m m m m m m m m m m m ", +") m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m O.2.2.3.3.3.3.3.*.*.*.*.*.*.*.*.&.&.&.%.%.%.O.O.X. .{ , S H # S K S * D.S X 5 2 2 2 5 & J + . i J f d f J d y O.X.O.g y o.o. .m m m m m m m m m m m m m ", +") m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m y *.*.*.*.*.*.*.*.*.*.*.*.*.&.&.&.%.%.%.@.O.O. . .X. .} 7 5 , 6 5 $ + + + . 5 2 2 3 f . U . p.A L + a J J d h g p p.f S +.@.y m m m m m m m m m m m m m ", +") m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m l 3.*.*.*.*.*.*.*.*.*.*.&.$.&.%.%.@.%.@.o.o. .X.{ .| e e e 0 5 3 5 5 3 9 + 1 2 9 j a F . . g.A # a a f J a p p.i f C.& @.$.l m m m m m m m m m m m m m ", +") m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m b 3.*.&.*.*.&.*.*.&.&.$.$.#.%.#.@.@.o.o.o. . . .{ | t e 0 0 5 3 3 3 2 2 3 2 $ % 2 & o A . a . f # a f p f i i f J f L } o.3.v m m m m m m m m m m m m m ", +") m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m %.$.&.&.$.&.$.$.#.#.#.#.#.@.@.@.o.o. . . . .{ { e e 0 q 5 3 3 2 2 2 1 1 1 1 1 1 2 G # a a . a . i a i p f J f J C.a $.@.*.m m m m m m m m m m m m m m ", +") m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m h #.#.%.#.#.#.#.#.#.@.@.o.@.o.o. . . . .{ { e e 0 0 5 5 3 2 2 1 1 1 1 1 1 , 1 , q : a a . a i i i i i p J J f L L & $.@.h m m m m m m m m m m m m m m ", +") m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m v &.@.@.#.#.@.@.@.@.@.o.o.o. . . . . .{ { e e 0 0 q q 3 3 2 1 1 1 1 1 1 , , , 2 E + a . i i i i i i p J J J f K C.j #.*.v m m m m m m m m m m m m m m ", +") m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m m n n m c.c.m.&X0XtX3X3X3X3XX:X:X7X\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: einstall.cpp:39 +#: einstall.cpp:69 +msgid "Please enter the name of the package.\n" +msgstr "Add meg a csomag nevét.\n" + +#: einstaller.cpp:511 +msgid "Packages (*.rpm; *.tgz; *.deb), *.{rpm|tgz|deb}, All files (*.*), *" +msgstr "Csomagok (*.rpm; *.tgz; *.deb), *.{rpm|tgz|deb}, Minden fájl (*.*), *" + +#: einstaller.cpp:512 +msgid "Package selection" +msgstr "Csomag kiválasztása..." + +#: einstaller.cpp:553 +msgid "Install software package" +msgstr "Szoftver csomag telepítése" + +#: einstaller.cpp:564 +msgid "Enter the name of software package you want to install:" +msgstr "Add meg a telepítendő csomag nevét:" + +#: einstaller.cpp:568 +msgid "&Browse..." +msgstr "&Tallóz" + +#: einstaller.cpp:571 +msgid "Welcome. This installation wizard will help you to install new software on your computer." +msgstr "Üdvözöllek. Ez a varázsló segít egy csomag telepítésében." + +#: einstaller.cpp:577 +msgid "Ignore dependencies" +msgstr "Függőségek figyelmenkívül hagyása" + +#: einstaller.cpp:585 +msgid "Installation results:" +msgstr "Telepítés eredménye:" + +#: einstaller.cpp:590 +msgid "Installation status:" +msgstr "Telepítési folyamat:" + +#: einstaller.cpp:598 +msgid "<< &Previous" +msgstr "<< &Előző" + +#: einstaller.cpp:603 +msgid "&Install" +msgstr "Te&lepítés" + +#: einstaller.cpp:607 +msgid "&Close" +msgstr "&Bezárás" + diff --git a/einstaller/locale/messages.pot b/einstaller/locale/messages.pot new file mode 100644 index 0000000..e62dbc6 --- /dev/null +++ b/einstaller/locale/messages.pot @@ -0,0 +1,69 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR Free Software Foundation, Inc. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"POT-Creation-Date: 2002-04-21 14:09+0200\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=CHARSET\n" +"Content-Transfer-Encoding: 8bit\n" + +#: einstall.cpp:39 einstall.cpp:69 +msgid "Please enter the name of the package.\n" +msgstr "" + +#: einstaller.cpp:511 +msgid "Packages (*.rpm; *.tgz; *.deb), *.{rpm|tgz|deb}, All files (*.*), *" +msgstr "" + +#: einstaller.cpp:512 +msgid "Package selection" +msgstr "" + +#: einstaller.cpp:553 +msgid "Install software package" +msgstr "" + +#: einstaller.cpp:564 +msgid "Enter the name of software package you want to install:" +msgstr "" + +#: einstaller.cpp:568 +msgid "&Browse..." +msgstr "" + +#: einstaller.cpp:571 +msgid "" +"Welcome. This installation wizard will help you to install new software on " +"your computer." +msgstr "" + +#: einstaller.cpp:577 +msgid "Ignore dependencies" +msgstr "" + +#: einstaller.cpp:585 +msgid "Installation results:" +msgstr "" + +#: einstaller.cpp:590 +msgid "Installation status:" +msgstr "" + +#: einstaller.cpp:598 +msgid "<< &Previous" +msgstr "" + +#: einstaller.cpp:603 +msgid "&Install" +msgstr "" + +#: einstaller.cpp:607 +msgid "&Close" +msgstr "" diff --git a/einstaller/locale/ru.po b/einstaller/locale/ru.po new file mode 100644 index 0000000..9979f3a --- /dev/null +++ b/einstaller/locale/ru.po @@ -0,0 +1,71 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR Free Software Foundation, Inc. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"POT-Creation-Date: 2002-04-21 14:09+0200\n" +"PO-Revision-Date: 2002-11-28 HO:MI+ZONE\n" +"Last-Translator: aabbvv \n" +"Language-Team: RUSSIAN \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=koi8-r\n" +"Content-Transfer-Encoding: 8bit\n" + +#: einstall.cpp:39 einstall.cpp:69 +msgid "Please enter the name of the package.\n" +msgstr " .\n" + +#: einstaller.cpp:511 +msgid "Packages (*.rpm; *.tgz; *.deb), *.{rpm|tgz|deb}, All files (*.*), *" +msgstr " (*.rpm; *.tgz; *.deb), *.{rpm|tgz|deb}, (*.*), *" + +#: einstaller.cpp:512 +msgid "Package selection" +msgstr " " + +#: einstaller.cpp:553 +msgid "Install software package" +msgstr " " + +#: einstaller.cpp:564 +msgid "Enter the name of software package you want to install:" +msgstr " , :" + +#: einstaller.cpp:568 +msgid "&Browse..." +msgstr "" + +#: einstaller.cpp:571 +msgid "" +"Welcome. This installation wizard will help you to install new software on " +"your computer." +msgstr "" +" . " +" " + +#: einstaller.cpp:577 +msgid "Ignore dependencies" +msgstr " " + +#: einstaller.cpp:585 +msgid "Installation results:" +msgstr " :" + +#: einstaller.cpp:590 +msgid "Installation status:" +msgstr " :" + +#: einstaller.cpp:598 +msgid "<< &Previous" +msgstr "<< " + +#: einstaller.cpp:603 +msgid "&Install" +msgstr "" + +#: einstaller.cpp:607 +msgid "&Close" +msgstr "" diff --git a/einstaller/locale/sk.po b/einstaller/locale/sk.po new file mode 100644 index 0000000..46614b3 --- /dev/null +++ b/einstaller/locale/sk.po @@ -0,0 +1,71 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR Free Software Foundation, Inc. +# FIRST AUTHOR , YEAR. +# +msgid "" +msgstr "" +"Project-Id-Version: einstaller 1.0\n" +"POT-Creation-Date: 2002-04-21 14:09+0200\n" +"PO-Revision-Date: 2002-04-21 14:50+0200\n" +"Last-Translator: Martin Pekar \n" +"Language-Team: Slovak \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: einstall.cpp:41 einstall.cpp:68 +msgid "Please enter the name of the package.\n" +msgstr "Prosím zadajte meno balíka.\n" + +#: einstaller.cpp:511 +msgid "Packages (*.rpm; *.tgz; *.deb), *.{rpm|tgz|deb}, All files (*.*), *" +msgstr "Balíky (*.rpm; *.tgz; *.deb), *.{rpm|tgz|deb}, Všetky súbory (*.*), *" + + +#: einstaller.cpp:509 +msgid "Package selection" +msgstr "Výber balíka" + +#: einstaller.cpp:549 +msgid "Install software package" +msgstr "Inštalácia softvérového balíka" + +#: einstaller.cpp:560 +msgid "Enter the name of software package you want to install:" +msgstr "Vložte meno softvérového balíka, ktorý chcete nainštalovať:" + +#: einstaller.cpp:564 +msgid "&Browse..." +msgstr "&Hľadať..." + +#: einstaller.cpp:568 +msgid "" +"Welcome. This installation wizard will help you to install new software on " +"your computer." +msgstr "" +"Tento sprievodca inštaláciou Vám pomôže nainštalovať nový softvér na Váš " +"počítač." + +#: einstaller.cpp:574 +msgid "Ignore dependencies" +msgstr "Ignorovať závislosti" + +#: einstaller.cpp:582 +msgid "Installation results:" +msgstr "Výsledky inštalácie:" + +#: einstaller.cpp:587 +msgid "Installation status:" +msgstr "Stav inštalácie:" + +#: einstaller.cpp:595 +msgid "<< &Previous" +msgstr "<< &Späť" + +#: einstaller.cpp:600 +msgid "&Install" +msgstr "&Inštalovať" + +#: einstaller.cpp:604 +msgid "&Close" +msgstr "&Zavrieť" diff --git a/ekeyconf/Jamfile b/ekeyconf/Jamfile new file mode 100644 index 0000000..8eda0f0 --- /dev/null +++ b/ekeyconf/Jamfile @@ -0,0 +1,16 @@ +# +# $Id$ +# +# Part of Equinox Desktop Environment (EDE). +# Copyright (c) 2000-2007 EDE Authors. +# +# This program is licenced under terms of the +# GNU General Public Licence version 2 or newer. +# See COPYING for details. + +SubDir TOP ekeyconf ; + +SOURCE = ekeys.cpp ekeyconf.cpp Shortcut_Button.cpp ; + +MakeProgram ekeyconf : $(SOURCE) ; +ExtractStrings locale : $(SOURCE) ; diff --git a/ekeyconf/Makefile b/ekeyconf/Makefile new file mode 100644 index 0000000..d7ef5da --- /dev/null +++ b/ekeyconf/Makefile @@ -0,0 +1,17 @@ + +CPPFILES = ../edelib2/Util.cpp ../edelib2/Config.cpp ekeys.cpp ekeyconf.cpp Shortcut_Button.cpp +TARGET = ekeyconf + +include ../makeinclude + +install: + $(INSTALL_PROGRAM) $(TARGET) $(bindir) + $(INSTALL_LOCALE) + +uninstall: + $(RM) $(bindir)/$(TARGET) + +clean: + $(RM) $(TARGET) + $(RM) *.o + diff --git a/ekeyconf/Shortcut_Button.cpp b/ekeyconf/Shortcut_Button.cpp new file mode 100644 index 0000000..4530e77 --- /dev/null +++ b/ekeyconf/Shortcut_Button.cpp @@ -0,0 +1,54 @@ +// -- copyied over from fluid (Fl_Menu_Type.cpp) +// This program is licenced under terms of the +// GNU General Public Licence version 2 or newer. +// See COPYING for details. + +#include "Shortcut_Button.h" + +#include //#include +#include //#include +//#include +#include + + +void Shortcut_Button::draw() { + label(fltk::key_name(svalue)); + color(value() ? default_style->selection_color() : default_style->color()); + textcolor(value() ? default_style->selection_textcolor() : default_style->textcolor()); +#ifdef _WIN32 + Button::draw(); +#else + fltk::Button::draw(); +#endif +} + + +#include +int Shortcut_Button::handle(int e) { + when(0); type(TOGGLE); + if (e == fltk::KEY) { + if (!value()) return 0; + int v = fltk::event_text()[0]; + if (v > 32 && v < 0x7f || v > 0xa0 && v <= 0xff) { + v = v | fltk::event_state()&(fltk::META|fltk::ALT|fltk::CTRL); + } else { + v = fltk::event_state()&(fltk::META|fltk::ALT|fltk::CTRL|fltk::SHIFT) | fltk::event_key(); + if (v == fltk::BackSpaceKey && svalue) v = 0; + } + if (v != svalue) {svalue = v; do_callback(); redraw();} + return 1; + } else if (e == fltk::UNFOCUS) { + int c = changed(); value(0); if (c) set_changed(); + return 1; + } else if (e == fltk::FOCUS) { + return value(); + } else { +#ifdef _WIN32 + int r = Button::handle(e); +#else + int r = fltk::Button::handle(e); +#endif + if (e == fltk::RELEASE && value() && fltk::focus() != this) take_focus(); + return r; + } +} diff --git a/ekeyconf/Shortcut_Button.h b/ekeyconf/Shortcut_Button.h new file mode 100644 index 0000000..ae2c022 --- /dev/null +++ b/ekeyconf/Shortcut_Button.h @@ -0,0 +1,43 @@ +// +// "$Id$" +// +// Shortcut header file for the Fast Light Tool Kit (FLTK). +// +// Copyright 1998-2006 by Bill Spitzak and others. +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Library General Public +// License as published by the Free Software Foundation; either +// version 2 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 +// Library General Public License for more details. +// +// You should have received a copy of the GNU Library General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 +// USA. +// +// Please report all bugs and problems to "fltk-bugs@fltk.org". +// + +#ifndef Shortcut_Button_H +#define Shortcut_Button_H + +#include + +class Shortcut_Button : public fltk::Button { +public: + int svalue; + int handle(int); + void draw(); + Shortcut_Button(int x, int y, int w, int h, const char* l = 0) : + fltk::Button(x,y,w,h,l) {svalue = 0;} +}; + +// +// End of "$Id$". +// +#endif diff --git a/ekeyconf/ekeyconf.cpp b/ekeyconf/ekeyconf.cpp new file mode 100644 index 0000000..226a5b5 --- /dev/null +++ b/ekeyconf/ekeyconf.cpp @@ -0,0 +1,154 @@ +// generated by Fast Light User Interface Designer (fluid) version 2.0100 + +#include "ekeyconf.h" +/* + * $Id$ + * + * Keyboard shortcuts applet + * Part of Equinox Desktop Environment (EDE). + * Copyright (c) 2005-2006 EDE Authors. + * + * This program is licenced under terms of the + * GNU General Public Licence version 2 or newer. + * See COPYING for details. + */ +#include "../edelib2/NLS.h" +#include "../edeconf.h" +#include "ekeys.h" + +fltk::Window *iconsConfWindow=(fltk::Window *)0; + +static void cb_OK(fltk::Button*, void*) { + writeKeysConfiguration(); + sendUpdateInfo(); + exit(0); +} + +static void cb_Cancel(fltk::Button*, void*) { + exit(0); +} + +static void cb_Apply(fltk::Button*, void*) { + writeKeysConfiguration(); + sendUpdateInfo(); +} + +Shortcut_Button *shortcut=(Shortcut_Button *)0; + +static void cb_shortcut(Shortcut_Button*, void*) { + setshortcutfor(action->text(),shortcut->svalue); +} + +fltk::InputBrowser *action=(fltk::InputBrowser *)0; + +static void cb_action(fltk::InputBrowser*, void*) { + shortcut->svalue = getshortcutfor(action->text()); + shortcut->redraw(); +} + +static void cb_New(fltk::Button*, void*) { + newShortcutWindow->show(); +} + +static void cb_Remove(fltk::Button*, void*) { + removeShortcut(action->text()); + populatelist(action); + action->text(action->child(0)->label()); + action->do_callback(); +} + +fltk::Window *newShortcutWindow=(fltk::Window *)0; + +fltk::Input *shortcutName=(fltk::Input *)0; + +fltk::Input *shortcutCommand=(fltk::Input *)0; + +static void cb_Ok(fltk::Button*, void*) { + addShortcut(shortcutName->value(),shortcutCommand->value()); + populatelist(action); + action->text(shortcutName->value()); + action->do_callback(); + newShortcutWindow->hide(); +} + +static void cb_Cancel1(fltk::Button*, void*) { + newShortcutWindow->hide(); +} + +#include + +int main (int argc, char **argv) { + + fltk::Window* w; + //fl_init_locale_support("ekeyconf", PREFIX"/share/locale"); + readKeysConfiguration(); + {fltk::Window* o = iconsConfWindow = new fltk::Window(275, 265, "Keyboard settings"); + o->begin(); + {fltk::Button* o = new fltk::Button(20, 237, 80, 25, "&OK"); + o->callback((fltk::Callback*)cb_OK); + } + {fltk::Button* o = new fltk::Button(190, 237, 80, 24, "&Cancel"); + o->callback((fltk::Callback*)cb_Cancel); + } + {fltk::Button* o = new fltk::Button(105, 237, 80, 24, "&Apply"); + o->callback((fltk::Callback*)cb_Apply); + } + {fltk::TabGroup* o = new fltk::TabGroup(1, 5, 267, 226); + o->color((fltk::Color)0xfffffffe); + o->begin(); + {fltk::Group* o = new fltk::Group(0, 23, 263, 200, "Shortcuts"); + o->align(fltk::ALIGN_TOP|fltk::ALIGN_LEFT); + o->begin(); + {fltk::InvisibleBox* o = new fltk::InvisibleBox(20, 52, 140, 20, "Keyboard shortcut:"); + o->align(fltk::ALIGN_LEFT|fltk::ALIGN_INSIDE); + } + {Shortcut_Button* o = shortcut = new Shortcut_Button(20, 72, 140, 20, "Keyboard shortcut:"); + o->color((fltk::Color)7); + o->callback((fltk::Callback*)cb_shortcut); + o->align(fltk::ALIGN_LEFT|fltk::ALIGN_INSIDE); + o->tooltip("To set a shortcut:\n Click here, then type the key combination you want.\nT\ +o delete the shortcut:\n Click here, then type backspace.\nTo get out of sho\ +rtcut-setting mode:\n Click the mouse on this again, or on some other field."); + } + {fltk::InputBrowser* o = action = new fltk::InputBrowser(20, 26, 165, 21, "Action:"); + o->callback((fltk::Callback*)cb_action); + o->align(fltk::ALIGN_TOP|fltk::ALIGN_LEFT); + action->text("Next window"); + } + {fltk::Button* o = new fltk::Button(20, 127, 110, 25, "&New shortcut..."); + o->callback((fltk::Callback*)cb_New); + } + {fltk::Button* o = new fltk::Button(140, 127, 110, 25, "&Remove shortcut"); + o->callback((fltk::Callback*)cb_Remove); + } + o->end(); + } + o->end(); + } + o->end(); + o->resizable(o); + } + {fltk::Window* o = newShortcutWindow = new fltk::Window(285, 114, "Define new shortcut"); + w = o; + o->begin(); + shortcutName = new fltk::Input(104, 15, 170, 24, "&Shortcut name:"); + shortcutCommand = new fltk::Input(104, 49, 170, 24, "C&ommand"); + {fltk::Button* o = new fltk::Button(49, 83, 88, 24, "&Ok"); + o->callback((fltk::Callback*)cb_Ok); + } + {fltk::Button* o = new fltk::Button(158, 83, 88, 24, "&Cancel"); + o->callback((fltk::Callback*)cb_Cancel1); + } + o->end(); + o->set_modal(); + o->resizable(o); + } + populatelist(action); + shortcut->svalue = getshortcutfor("Next window"); + shortcut->redraw(); + + // Grab all keyboard events from window manager + iconsConfWindow->show(argc, argv); + XGrabKey(fltk::xdisplay, AnyKey, AnyModifier, fltk::xid(iconsConfWindow), true, GrabModeAsync, GrabModeAsync); + return fltk::run(); +} diff --git a/ekeyconf/ekeyconf.fl b/ekeyconf/ekeyconf.fl new file mode 100644 index 0000000..b65d58f --- /dev/null +++ b/ekeyconf/ekeyconf.fl @@ -0,0 +1,135 @@ +# data file for the FLTK User Interface Designer (FLUID) +version 2.0100 +images_dir ./ +header_name {.h} +code_name {.cpp} +gridx 5 +gridy 5 +snap 3 +decl {/* + * $Id$ + * + * Keyboard shortcuts applet + * Part of Equinox Desktop Environment (EDE). + * Copyright (c) 2005-2006 EDE Authors. + * + * This program is licenced under terms of the + * GNU General Public Licence version 2 or newer. + * See COPYING for details. + */} {} + +decl {\#include "../edelib2/NLS.h"} {} + +decl {\#include "../edeconf.h"} {} + +decl {\#include "Shortcut_Button.h"} {public +} + +decl {\#include "ekeys.h"} {} + +Function {} {open +} { + code {//fl_init_locale_support("ekeyconf", PREFIX"/share/locale"); +readKeysConfiguration();} {} + {fltk::Window} iconsConfWindow { + label {Keyboard settings} open + xywh {471 199 275 265} resizable visible + } { + {fltk::Button} {} { + label {&OK} + callback {writeKeysConfiguration(); +sendUpdateInfo(); +exit(0);} + xywh {20 237 80 25} + } + {fltk::Button} {} { + label {&Cancel} + callback {exit(0);} + xywh {190 237 80 24} + } + {fltk::Button} {} { + label {&Apply} + callback {writeKeysConfiguration(); +sendUpdateInfo();} + xywh {105 237 80 24} + } + {fltk::TabGroup} {} {open + xywh {1 5 267 226} color 0xfffffffe + } { + {fltk::Group} {} { + label Shortcuts open + xywh {0 23 263 200} align 5 + } { + {fltk::InvisibleBox} {} { + label {Keyboard shortcut:} + xywh {20 52 140 20} align 36 + } + {fltk::Button} shortcut { + label {Keyboard shortcut:} + callback {setshortcutfor(action->text(),shortcut->svalue);} selected + tooltip {To set a shortcut: + Click here, then type the key combination you want. +To delete the shortcut: + Click here, then type backspace. +To get out of shortcut-setting mode: + Click the mouse on this again, or on some other field.} + xywh {20 72 140 20} align 36 color 7 + class Shortcut_Button + } + {fltk::InputBrowser} action { + label {Action:} + callback {shortcut->svalue = getshortcutfor(action->text()); +shortcut->redraw();} + xywh {20 26 165 21} align 5 + extra_code {action->text("Next window");} + } {} + {fltk::Button} {} { + label {&New shortcut...} + callback {newShortcutWindow->show();} + xywh {20 127 110 25} + } + {fltk::Button} {} { + label {&Remove shortcut} + callback {removeShortcut(action->text()); +populatelist(action); +action->text(action->child(0)->label()); +action->do_callback();} + xywh {140 127 110 25} + } + } + } + } + {fltk::Window} newShortcutWindow { + label {Define new shortcut} open + xywh {601 395 285 114} hide resizable modal + } { + {fltk::Input} shortcutName { + label {&Shortcut name:} + xywh {104 15 170 24} + } + {fltk::Input} shortcutCommand { + label {C&ommand} + xywh {104 49 170 24} + } + {fltk::Button} {} { + label {&Ok} + callback {addShortcut(shortcutName->value(),shortcutCommand->value()); +populatelist(action); +action->text(shortcutName->value()); +action->do_callback(); +newShortcutWindow->hide();} + xywh {49 83 88 24} + } + {fltk::Button} {} { + label {&Cancel} + callback {newShortcutWindow->hide();} + xywh {158 83 88 24} + } + } + code {populatelist(action); +shortcut->svalue = getshortcutfor("Next window"); +shortcut->redraw(); + +// Grab all keyboard events from window manager +XGrabKey(fltk::xdisplay, AnyKey, AnyModifier, fltk::xid(w), true, GrabModeAsync, GrabModeAsync);} {} +} diff --git a/ekeyconf/ekeyconf.h b/ekeyconf/ekeyconf.h new file mode 100644 index 0000000..2a24c4e --- /dev/null +++ b/ekeyconf/ekeyconf.h @@ -0,0 +1,19 @@ +// generated by Fast Light User Interface Designer (fluid) version 2.0100 + +#ifndef ekeyconf_h +#define ekeyconf_h +#include "Shortcut_Button.h" +#include +extern fltk::Window* iconsConfWindow; +#include +#include +#include +#include +extern Shortcut_Button* shortcut; +#include +extern fltk::InputBrowser* action; +extern fltk::Window* newShortcutWindow; +#include +extern fltk::Input* shortcutName; +extern fltk::Input* shortcutCommand; +#endif diff --git a/ekeyconf/ekeys.cpp b/ekeyconf/ekeys.cpp new file mode 100644 index 0000000..059baca --- /dev/null +++ b/ekeyconf/ekeys.cpp @@ -0,0 +1,285 @@ +/* + * $Id$ + * + * Keyboard shortcuts applet + * Part of Equinox Desktop Environment (EDE). + * Copyright (c) 2005-2006 EDE Authors. + * + * This program is licenced under terms of the + * GNU General Public Licence version 2 or newer. + * See COPYING for details. + */ + +#include "ekeys.h" + + +using namespace fltk; +using namespace edelib; + + +#define NR_HOTKEYS 30 + + +static struct { + char systemname[20]; + char uiname[50]; + char command[50]; +} hotkeys[] = { + {"NextWindow", "Next window", ""}, + {"PreviousWindow", "Previous window", ""}, + {"NextDesktop", "Next workspace", ""}, + {"PreviousDesktop", "Previous workspace", ""}, + {"FastRun", "Run program", ""}, + {"FindUtil", "Find file", ""}, + {"CloseWindow", "Close window", ""}, + {"MinimizeWindow", "Minimize window", ""}, + {"MaximizeWindow", "Maximize window", ""}, + {"Desktop1", "Workspace 1", ""}, + {"Desktop2", "Workspace 2", ""}, + {"Desktop3", "Workspace 3", ""}, + {"Desktop4", "Workspace 4", ""}, + {"Desktop5", "Workspace 5", ""}, + {"Desktop6", "Workspace 6", ""}, + {"Desktop7", "Workspace 7", ""}, + {"Desktop8", "Workspace 8", ""}, + {"App1", "", ""}, + {"App2", "", ""}, + {"App3", "", ""}, + {"App4", "", ""}, + {"App5", "", ""}, + {"App6", "", ""}, + {"App7", "", ""}, + {"App8", "", ""}, + {"App9", "", ""}, + {"App10", "", ""}, + {"App11", "", ""}, + {"App12", "", ""}, + +}; + + + +int keycodes[NR_HOTKEYS]; + + + + +static void sendClientMessage(XWindow w, Atom a, long x) +{ + XEvent ev; + long mask; + + memset(&ev, 0, sizeof(ev)); + ev.xclient.type = ClientMessage; + ev.xclient.window = w; + ev.xclient.message_type = a; + ev.xclient.format = 32; + ev.xclient.data.l[0] = x; + ev.xclient.data.l[1] = CurrentTime; + mask = 0L; + if (w == RootWindow(xdisplay, xscreen)) + mask = SubstructureRedirectMask; + XSendEvent(xdisplay, w, False, mask, &ev); +} + +void sendUpdateInfo() +{ +// No worky +/* unsigned int i, nrootwins; + XWindow dw1, dw2, *rootwins = 0; + int screen_count = ScreenCount(fltk::xdisplay); + extern Atom FLTKChangeSettings; + for (int s = 0; s < screen_count; s++) { + XWindow root = RootWindow(fltk::xdisplay, s); + XQueryTree(fltk::xdisplay, root, &dw1, &dw2, &rootwins, &nrootwins); + for (i = 0; i < nrootwins; i++) { + if (rootwins[i]!=RootWindow(fltk::xdisplay, fltk::xscreen)) { + sendClientMessage(rootwins[i], FLTKChangeSettings, 0); + } + } + } + XFlush(fltk::xdisplay);*/ +} + +int getshortcutfor(const char* action) +{ + for (int i=0; i= 'a') && (key[0] <= 'z')) { + parsed += key[0]; + } else if ((key[0] >= 'A') && (key[0] <= 'Z')) { + parsed += (key[0] - 'A' + 'a'); + } + } + } + + return parsed; +} + +void readKeysConfiguration() +{ + Config globalConfig(Config::find_file("wmanager.conf", 0), true, false); + globalConfig.set_section("Hotkeys"); + + for (int i=0; i0 && tmp != "") strncpy(hotkeys[i].uiname, hotkeys[i].systemname, 20); + } + } + + globalConfig.set_section("ApplicationNames"); + for (int i=0; iclear(); // Rewrite? + for (int i=0; iadd ( hotkeys[i].uiname); +} + +void addShortcut(const char *name, const char *cmd) +{ + if ((strcmp(name,"") !=0) && (strcmp(cmd,"") != 0)) { + for (int i=0; i +#include //#include +#include //#include +//#include +#include //#include +#include "../edelib2/Config.h" //#include +#include "../edelib2/NLS.h" //#include +#include //#include + + +int getshortcutfor(const char*); +void setshortcutfor(const char*, int); +void readKeysConfiguration(); +void writeKeysConfiguration(); +void sendUpdateInfo(); +void populatelist(fltk::InputBrowser *); +void addShortcut(const char*,const char*); +void removeShortcut(const char*); + +#endif + diff --git a/ekeyconf/locale/messages.pot b/ekeyconf/locale/messages.pot new file mode 100644 index 0000000..131dfcc --- /dev/null +++ b/ekeyconf/locale/messages.pot @@ -0,0 +1,55 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2005-04-03 13:14+0200\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=CHARSET\n" +"Content-Transfer-Encoding: 8bit\n" + +#: ekeyconf.cpp:47 +msgid "Keyboard settings" +msgstr "" + +#: ekeyconf.cpp:50 +msgid "&OK" +msgstr "" + +#: ekeyconf.cpp:53 +msgid "&Cancel" +msgstr "" + +#: ekeyconf.cpp:56 +msgid "&Apply" +msgstr "" + +#: ekeyconf.cpp:61 +msgid "Shortcuts" +msgstr "" + +#: ekeyconf.cpp:63 +msgid "Keyboard shortcut:" +msgstr "" + +#: ekeyconf.cpp:68 +msgid "" +"To set a shortcut:\n" +" Click here, then type the key combination you want.\n" +"To delete the shortcut:\n" +" Click here, then type backspace.\n" +"To get out of shortcut-setting mode:\n" +" Click the mouse on this again, or on some other field." +msgstr "" + +#: ekeyconf.cpp:72 +msgid "Action:" +msgstr "" diff --git a/elauncher/Jamfile b/elauncher/Jamfile new file mode 100644 index 0000000..a57ad50 --- /dev/null +++ b/elauncher/Jamfile @@ -0,0 +1,19 @@ +# +# $Id$ +# +# Part of Equinox Desktop Environment (EDE). +# Copyright (c) 2000-2007 EDE Authors. +# +# This program is licenced under terms of the +# GNU General Public Licence version 2 or newer. +# See COPYING for details. + +SubDir TOP elauncher ; + +LIBMAGIC = -lmagic ; + +MakeProgram elauncher : elauncher.cpp + : + : $(LIBMAGIC) ; + +ExtractStrings locale : elauncher.cpp ; diff --git a/elauncher/Makefile b/elauncher/Makefile new file mode 100644 index 0000000..955af7b --- /dev/null +++ b/elauncher/Makefile @@ -0,0 +1,22 @@ + +CPPFILES = elauncher.cpp ../edelib2/Util.cpp ../edelib2/Config.cpp ../edelib2/process.cpp ../edelib2/pty.cpp +TARGET = elauncher + +POFILES = locale/ru.po\ + locale/sr.po\ + locale/sk.po\ + locale/hu.po\ + +include ../makeinclude + +install: + $(INSTALL_PROGRAM) $(TARGET) $(bindir) + $(INSTALL_LOCALE) + +uninstall: + $(RM) $(bindir)/$(TARGET) + +clean: + $(RM) $(TARGET) + $(RM) *.o + diff --git a/elauncher/elauncher.cpp b/elauncher/elauncher.cpp new file mode 100644 index 0000000..bdaceeb --- /dev/null +++ b/elauncher/elauncher.cpp @@ -0,0 +1,756 @@ +/* + * $Id$ + * + * Program and URL opener + * Provides startup notification, crash handler and other features + * Part of Equinox Desktop Environment (EDE). + * Copyright (c) 2000-2006 EDE Authors. + * + * This program is licenced under terms of the + * GNU General Public Licence version 2 or newer. + * See COPYING for details. + */ + +#include "elauncher.h" +#include "../edeconf.h" +#include "../edelib2/process.h" +#include "../edelib2/MimeType.h" + +using namespace fltk; +using namespace edelib; + + + +// TODO: find where to replace magic constants with fltk::PATH_MAX + + + + + +// globals used in forking +int fds_[3]; +char *cmd_; +int pid_; + +// command-line parameters +bool param_root = false; +bool param_secure = false; +bool param_term = false; + +// from configuration file +bool use_sudo = false; + +char *output; + + + + +/*char * +itoa(int value, char *string, int radix) +{ + char tmp[33]; + char *tp = tmp; + int i; + unsigned v; + int sign; + char *sp; + + if (radix > 36 || radix <= 1) + { + return 0; + } + + sign = (radix == 10 && value < 0); + if (sign) + v = -value; + else + v = (unsigned)value; + while (v || tp == tmp) + { + i = v % radix; + v = v / radix; + if (i < 10) + *tp++ = i+'0'; + else + *tp++ = i + 'a' - 10; + } + + if (string == 0) + string = (char *)malloc((tp-tmp)+sign+1); + sp = string; + + if (sign) + *sp++ = '-'; + while (tp > tmp) + *sp++ = *--tp; + *sp = 0; + return string; +}*/ + + + +// -------------------------------------------- +// Show busy cursor - not working +// -------------------------------------------- +void show_busy_screen(bool busy) +{ + // We can't use fltk::Cursor cause it can be set only per widget... + // and only if you overload that widget! + // I hate OOP :) + ::Cursor xcursor; + if (busy) + xcursor = XCreateFontCursor(xdisplay, XC_watch); + else + xcursor = XCreateFontCursor(xdisplay, XC_arrow); + // Hopefully this is desktop? + XDefineCursor(xdisplay, CreatedWindow::first->xid, xcursor); + sleep (3); +} + + + +// -------------------------------------------- +// Show a generic window for displaying output stream +// -------------------------------------------- + +void output_window_close(Widget *w) +{ + w->window()->hide(); +} + +void output_window(char *title, char *content) +{ + int height=0; + TextBuffer buffer; + buffer.text(content); + + for (unsigned i=0;i550) height=550; + if (height<100) height=100; + + Window window(500, height); + window.label(title); + window.begin(); + + TextDisplay message(0, 0, 500, height-23, content); + window.resizable(message); + message.color(WHITE); + message.textcolor(BLACK); + message.buffer(buffer); + + Button* button; + button = new ReturnButton(410, height-23, 80, 23, _("&Ok")); + button->callback(output_window_close); + window.hotspot(button); + // window.focus(button); + window.end(); + window.exec(); +} + + +// -------------------------------------------- +// Crash window - with details +// -------------------------------------------- +#define GDBPATH "/usr/bin/gdb" + +static xpmImage crash_pix((const char **)crash_xpm); +Window *crashWindow; +Button *crashDetailsButton, *crashCloseButton; +TextDisplay *backTraceTD; +TextBuffer *gdbbuffer; + +void cb_crashDetails(Widget *w) { + if (backTraceTD->visible()) { + backTraceTD->hide(); + crashWindow->resize(450,110); + } else { + crashWindow->resize(450,395); + backTraceTD->show(); + } +} + +void cb_crashOk(Widget *w) { + w->window()->hide(); +} + +// Execute gdb and place output into gdbbuffer +bool get_me_gdb_output(int crashpid) +{ + int pid, status; + extern char **environ; + + status=0; + pid = fork (); + if (pid == -1) + return false; + if (pid == 0) + { + // child + char *argv[4]; + char tmp[1000]; + argv[0] = "sh"; + argv[1] = "-c"; + argv[2] = tmp; + snprintf (argv[2], 999, "echo bt>/tmp/gdbbatch; echo q>>/tmp/gdbbatch; "GDBPATH" %s --core core.%d --command /tmp/gdbbatch --quiet > /tmp/gdboutput", cmd_, crashpid); + argv[3] = NULL; + + if (execve ("/bin/sh", argv, environ) == -1) + perror ("/bin/sh"); + return false; // Error + } + do + { + if (waitpid (pid, &status, 0) == -1) + { + if (errno != EINTR) + return false; // Error + } + else { + gdbbuffer->loadfile("/tmp/gdboutput"); + // Take out the garbage + char *corefile = (char*)malloc(20); + snprintf (corefile, sizeof(corefile)-1, "./core.%d", crashpid); + unlink(corefile); + free(corefile); + return true; + } + } + while (1); +} + +void crashmessage(char *command, int pid) +{ + gdbbuffer = new TextBuffer; + Window* w; + { + Window* o = crashWindow = new Window(450, 110, _("The program has crashed")); + w = o; + o->shortcut(0xff1b); + o->begin(); + { + Button* o = crashDetailsButton = new Button(250, 75, 90, 25, _("&Details...")); + o->callback((Callback*)cb_crashDetails); + o->type(Button::TOGGLE); + } + { + Button* o = crashCloseButton = new Button(350, 75, 90, 25, _("&Close")); + o->callback((Callback*)cb_crashOk); + } + { + InvisibleBox* o = new InvisibleBox(60, 5, 380, 16, _("An error occured in program:")); + o->align(ALIGN_LEFT|ALIGN_INSIDE); + } + { + InvisibleBox* o = new InvisibleBox(90, 20, 380, 16, command); + o->labelfont(o->labelfont()->bold()); + o->align(ALIGN_LEFT|ALIGN_INSIDE); + } + { + InvisibleBox* o = new InvisibleBox(60, 35, 380, 30, _("Please inform the authors of this program and provide the details below.")); + o->align(ALIGN_LEFT|ALIGN_INSIDE|ALIGN_WRAP); + } + { + InvisibleBox* o = new InvisibleBox(15, 15, 35, 35, ""); + o->image(crash_pix); + } + { + TextDisplay* o = backTraceTD = new TextDisplay(10, 110, 430, 275, ""); + o->hide(); + o->color(WHITE); + o->textcolor(BLACK); + o->buffer(gdbbuffer); + } + o->end(); + } + w->show(); + flush(); + + // Is there gdb on the system? + struct stat *buf = (struct stat*)malloc(sizeof(struct stat)); + if (stat (GDBPATH, buf) != 0 || !get_me_gdb_output(pid)) + crashDetailsButton->deactivate(); + w->exec(); + + return; +} + + +// -------------------------------------------- +// Error message window +// -------------------------------------------- + +// This should be replaced with one of redesigned standard dialogs... + +static xpmImage error_pix((const char **)error_xpm); + +void cb_errOk(Widget *w) { + w->window()->hide(); +} + +void errormessage(char *part1, char *part2, char *part3) +{ + Window* w; + { + Window* o = new Window(350, 100, _("Error")); + w = o; + o->shortcut(0xff1b); + o->begin(); + { + ReturnButton* o = new ReturnButton(250, 65, 90, 25, _("&OK")); + o->callback((Callback*)cb_errOk); + } + { + InvisibleBox* o = new InvisibleBox(60, 5, 280, 16, part1); + o->align(ALIGN_LEFT|ALIGN_INSIDE); + } + { + InvisibleBox* o = new InvisibleBox(90, 20, 280, 16, part2); + o->labelfont(o->labelfont()->bold()); + o->align(ALIGN_LEFT|ALIGN_INSIDE); + } + { + InvisibleBox* o = new InvisibleBox(60, 35, 280, 30, part3); + o->align(ALIGN_LEFT|ALIGN_INSIDE|ALIGN_WRAP); + } + { + InvisibleBox* o = new InvisibleBox(15, 15, 35, 35, ""); + o->image(error_pix); + } + o->end(); + } + w->exec(); + return; +} + + +// -------------------------------------------- +// Depending on exit status, show some nice dialogs +// -------------------------------------------- + +void process_output_status(int exit_status, PtyProcess* child) +{ + char *messages1[257], *messages2[257]; + + // FIXME: do we still need this init? + for (int i=0;i<256;i++) { messages1[i] = ""; messages2[i] = ""; } + + if (exit_status == PtyProcess::Killed) exit_status = 256; + + messages1[127] = _("Program not found:"); + messages2[127] = _("Perhaps it is not installed properly. Check your $PATH value."); +// messages1[14] = _("Segmentation fault in child process:"); +// messages2[14] = _(""); + messages1[126] = _("File is not executable:"); + messages2[126] = _("Is this really a program? If it is, you should check its permissions."); + messages1[256] = _("Program was terminated:"); + messages2[256] = _(""); + + if (exit_status == PtyProcess::Crashed) { + // Nice bomb window + crashmessage(cmd_,child->pid()); + } else if (!(messages1[exit_status] == "")) { + // we have special message for this status + errormessage(messages1[exit_status],cmd_,messages2[exit_status]); + } else { + fprintf(stderr, _("Elauncher: child's exited normally with status %d\n"), exit_status); + + if (exit_status>0) { + // unknown status, display stdout & stderr + char *buffer; + char output[65535]; + + bool changed=false; + strcpy(output,""); + while (buffer = child->readLine()) { + strcat(output, buffer); + changed=true; + } + if (changed) output_window(_("Program output"),output); + } + } +} + + +// -------------------------------------------- +// Core function that handles su/sudo, waits for program to +// finish and then calls the output handler +// -------------------------------------------- + +// this is our internal message: +#define CONTMSG "elauncher_ok_to_continue" +// these are part of sudo/su chat: +#define PWDQ "Password:" +#define BADPWD "/bin/su: incorrect password" +#define SUDOBADPWD "Sorry, try again." + +// We can't use const char* because of strtok later +int start_child_process(char *cmd) +{ + + if (strlen(cmd)<1) return 0; +// show_busy_screen(true); +// return 0; + + // This is so that we can get a backtrace in case of crash + struct rlimit *rlim = (struct rlimit*)malloc(sizeof(struct rlimit)); + getrlimit (RLIMIT_CORE, rlim); + rlim_t old_rlimit = rlim->rlim_cur; // keep previous rlimit + rlim->rlim_cur = RLIM_INFINITY; + setrlimit (RLIMIT_CORE, rlim); + + // Prepare array as needed by exec() + char *parts[4]; + if (param_root) { + if (use_sudo) { + parts[0] = "/bin/sudo"; + parts[1] = ""; + } else { + parts[0] = "/bin/su"; + parts[1] = "-c"; + } + // This "continue message" prevents accidentally exposing password + int length = strlen("echo "CONTMSG)+strlen("; ")+strlen(cmd); + parts[2] = (char*)malloc(length); + snprintf(parts[2],length,"echo %s; %s",CONTMSG,cmd); + parts[3] = NULL; + } else { + parts[0] = "/bin/sh"; + parts[1] = "-c"; + parts[2] = strdup(cmd); + parts[3] = NULL; + } + // the actual command is this: + cmd_ = strtok(cmd," "); + +tryagain: + PtyProcess *child = new PtyProcess(); + child->setEnvironment((const char**)environ); + if (child->exec(parts[0], (const char**)parts) < 0) { + if (ask(_("Error starting program. Try again?"))) + goto tryagain; + else + return 0; + } + + // Wait for process to actually start. Shouldn't last long + while (1) { + int p = child->pid(); + if (p != 0 && child->checkPid(p)) + break; + int exit = child->checkPidExited(p); + if (exit != -2) { + // Process is DOA + fprintf (stderr, "Elauncher: Process has died unexpectedly! Exit status: %d\n",exit); + delete child; + goto tryagain; + } + fprintf (stderr, "Elauncher: Not started yet...\n"); + } + + // Run program as root using su or sudo + if (param_root) { + char *line; + + const char *pwd = password(_("This program requires administrator privileges.\nPlease enter your password below:")); + if (pwd == 0) { fprintf(stderr,"Canceled\n"); exit(1); } + + // Chat routine + while (1) { + line = child->readLine(); + + // This covers other cases of failed process startup + // Our su command should at least produce CONTMSG + if (line == 0 && child->checkPidExited(child->pid()) != PtyProcess::NotExited) { + // TODO: capture stdout? as in sudo error? + fprintf (stderr, "Elauncher: su process has died unexpectedly in chat stage!\n"); + delete child; + + if (choice_alert (_("Failed to start authentication. Try again"), 0, _("Yes"), _("No")) == 2) return 0; + goto tryagain; + } + + if (strncasecmp(line,PWDQ,strlen(PWDQ))== 0) + child->writeLine(pwd,true); + + if (strncasecmp(line,CONTMSG,strlen(CONTMSG)) == 0) + break; // program starts... + + if ((strncasecmp(line,BADPWD,strlen(BADPWD)) == 0) || (strncasecmp(line,SUDOBADPWD,strlen(SUDOBADPWD)) == 0)) { + // end process + child->waitForChild(); + delete child; + + if (choice_alert (_("The password is wrong. Try again?"), 0, _("Yes"), _("No")) == 2) return 0; + + goto tryagain; + } + } + } + + // Wait for program to end, but don't lose the output +// show_busy_screen(false); +// cursor(CURSOR_ARROW); + int child_val = child->runChild(); + process_output_status(child_val,child); + + // deallocate one string we mallocated + free(parts[2]); + delete child; + + // Revert old rlimit + rlim->rlim_cur = old_rlimit; + setrlimit (RLIMIT_CORE, rlim); + + return 0; +} + + +// -------------------------------------------- +// Analyze command and, if it's URL, call appropriate application +// Otherwise assume that it's executable and run it +// (Code mostly copied over from former eRun) +// -------------------------------------------- + + +void run_resource(const char *cmd) { + char pRun[256]; + char browser[256]; + + // look up default browser in config + Config pGlobalConfig(Config::find_file("ede.conf", 0)); + pGlobalConfig.get("Web", "Browser", browser, 0, sizeof(browser)); + if(pGlobalConfig.error() && !browser) { + strncpy(browser, "mozilla", sizeof(browser)); + } + + // We might need this later, so try to optimize file reads + pGlobalConfig.get("System","UseSudo", use_sudo, false); + + // split cmd to protocol and location + char *protocol = strdup(cmd); + char *location = strchr(protocol, ':'); + if (location) *(location++) = '\0'; // cut off at ':' + + // is cmd a proper URL? + if((location) && (strchr(protocol, ' ') == NULL)) + { + if (strcasecmp(protocol,"file") == 0) + // use mimetypes + { + MimeType m(location); + + if (m.command()) + strncpy(pRun, m.command(), sizeof(pRun)-1); + else + { // unknown extension + char m_printout[256]; + snprintf(m_printout, sizeof(m_printout)-1, _("Unknown file type:\n\t%s\nTo open this file in 'appname' please use\n 'appname %s'"), location, location); + alert(m_printout); + return; + } + } + + // TODO: split protocols into own file + else if (strcasecmp(protocol, "http")==0 || strcasecmp(protocol, "ftp")==0) + { + snprintf(pRun, sizeof(pRun)-1, "%s %s", browser, cmd); + } + + // search engine urls + else if (strcasecmp(protocol, "gg")==0) + { + snprintf(pRun, sizeof(pRun)-1, "%s http://www.google.com/search?q=\"%s\"", browser, location); + } + + else if (strcasecmp(protocol, "leo")==0) + { + snprintf(pRun, sizeof(pRun)-1, "%s http://dict.leo.org/?search=\"%s\"", browser, location); + } + + else if (strcasecmp(protocol, "av")==0) + { + snprintf(pRun, sizeof(pRun)-1, "%s http://www.altavista.com/sites/search/web?q=\"%s\"", browser, location); + } + + else // Unkown URL type - let browser deal with it + { + snprintf(pRun, sizeof(pRun)-1, "%s %s", browser, cmd); + } + } + else + // local executable + // TODO: parse the standard parameters to the executable if any exists in the *.desktop file. + { + if (param_secure) { + char message[256]; + snprintf (message, sizeof(message)-1, _("You have requested to execute program %s via Elauncher. However, secure mode was enabled. Execution has been prevented."), cmd); + alert (message); + exit(1); + } else { + snprintf(pRun, sizeof(pRun)-1, "%s", cmd); + } + } + delete [] protocol; + + // Additional parameters + if (param_term) { + char termapp[256]; + pGlobalConfig.get("Terminal", "Terminal", termapp, 0, sizeof(termapp)); + char tmp[256]; + snprintf (tmp, sizeof(pRun)-1, "%s -e %s",termapp,pRun); + strcpy (pRun, tmp); + } + if (param_root) { + // nothing special to do here + } + + // continue with execution + start_child_process(pRun); +} + + +// -------------------------------------------- +// Draw GUI run dialog. This is shown when no parameters are given +// (Code mostly copied over from former eRun) +// -------------------------------------------- + +static xpmImage run_pix((const char **)run_xpm); +Window* windowRunDialog; +Input* inputRunDialog; +CheckButton* runAsRoot; + +static void cb_OK(Button*, void*) { + param_root = runAsRoot->value(); + windowRunDialog->hide(); + flush(); // Window will not hide without this... + run_resource(inputRunDialog->value()); +} + +static void cb_Cancel(Button*, void*) { + windowRunDialog->hide(); +} + +static void cb_Browse(Button*, void*) { + const char *file_types = _("Executables (*.*), *, All files (*.*), *"); + const char *fileName = file_chooser(_("File selection..."), "*.*", inputRunDialog->value()); // TODO: fix file filter when we get a new dialog + if (fileName) + { + inputRunDialog->value(fileName); + } +} + +void run_dialog() { + Window* w = windowRunDialog = new Window(350, 175, _("Open...")); + w->when(WHEN_ENTER_KEY); + w->begin(); + + { InvisibleBox* o = new InvisibleBox(5, 5, 55, 70); + o->image(run_pix); + o->align(ALIGN_CENTER|ALIGN_INSIDE); } + + { InvisibleBox* o = new InvisibleBox(60, 5, 285, 70, _("Type the location you want to open or the name of the program you want to run\ +. (Possible prefixes are: http:, ftp:, gg:, av:, leo:)")); + o->align(132|ALIGN_INSIDE); } + + { Input* o = inputRunDialog = new Input(60, 80, 180, 25, _("Open:")); + o->align(132); + //o->when(WHEN_ENTER_KEY); + } + + { Button* o = new Button(250, 80, 90, 25, _("&Browse...")); + o->callback((Callback*)cb_Browse); } + + { CheckButton* o = runAsRoot = new CheckButton(60, 110, 90, 25, _("Run as &root")); + } + + { ReturnButton* o = new ReturnButton(150, 140, 90, 25, _("&OK")); + o->callback((Callback*)cb_OK); + o->shortcut(ReturnKey); // ENTER + } + + { Button* o = new Button(250, 140, 90, 25, _("&Cancel")); + o->callback((Callback*)cb_Cancel); } + +// -- window manager should do this +// w->x(fltk::xvisual->w / 2 - (w->w()/2)); +// w->y( (fltk::xvisual->h / 2) - (w->h()/2)); + w->end(); + + w->show(); + run(); +} + + +// Show console help on parameters + +void showHelp() { + printf ("ELauncher - "); + printf (_("program and URL opener for EDE.\n")); + printf ("Copyright (c) 2004,2005 EDE Authors\n"); + printf (_("Licenced under terms of GNU General Public Licence v2.0 or newer.\n\n")); + printf (_("Usage:\n")); + printf ("\telauncher [OPTIONS] [URL]\n"); + printf ("\telauncher [OPTIONS] [PROGRAM]\n\n"); + printf ("elauncher URL -\n"); + printf (_("\tParse URL in form protocol:address and open in appropriate program.\n\tURLs with protocol 'file' are opened based on their MIME type.\n")); + printf ("elauncher PROGRAM -\n"); + printf (_("\tRun the program. If no path is given, look in $PATH. To give parameters\n\tto program, use quotes e.g.:\n")); + printf ("\t\telauncher --term \"rm -rf /\"\n\n"); + printf (_("Options:\n")); + printf (" -h, --help\t- "); + printf (_("This help screen.\n")); + printf (" --root\t- "); + printf (_("Run as root. Dialog is opened to enter password.\n")); + printf (" --secure\t- "); + printf (_("Prevent running programs. Only URLs are allowed.\n")); + printf (" --term\t- "); + printf (_("Open in default terminal app.\n\n")); +} + + +// parse command line parameters + +int main (int argc, char **argv) { + char url[255]; + url[0] = '\0'; + +// fl_init_locale_support("elauncher", PREFIX"/share/locale"); + + for (int i=1; i +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +// for cursors: +//#include +//#include +// run dialog +#include +#include +#include +#include +#include +#include +#include +#include +#include +// other stuff +#include +#include +//#include +#include + +// This need to be last for Xlib.h errors +#include "../edelib2/NLS.h" +#include "../edelib2/Config.h" + + +// TODO: replace with edelib::Icon +#include "icons/run.xpm" +#include "icons/error.xpm" +#include "icons/crash.xpm" + + +#endif diff --git a/elauncher/icons/crash.xpm b/elauncher/icons/crash.xpm new file mode 100644 index 0000000..f857be8 --- /dev/null +++ b/elauncher/icons/crash.xpm @@ -0,0 +1,295 @@ +/* XPM */ +static char * crash_xpm[] = { +"48 48 244 2", +" c #FFFFFF", +". c #FEFEFE", +"+ c #FDFDFD", +"@ c #FCFCFC", +"# c #FAFAFA", +"$ c #F9F9F9", +"% c #F8F8F8", +"& c #FBFBFB", +"* c #F4F4F4", +"= c #F0F0F0", +"- c #EDEDED", +"; c #ECECEC", +"> c #EEEEEE", +", c #F3F3F3", +"' c #DEDEDE", +") c #C8C8C8", +"! c #B6B6B6", +"~ c #ACACAC", +"{ c #B2B2B2", +"] c #C2C2C2", +"^ c #D7D7D7", +"/ c #F1F1F1", +"( c #F6F6F6", +"_ c #F7F7F7", +": c #DBDBDB", +"< c #BBBBBB", +"[ c #999999", +"} c #7D7D7D", +"| c #686868", +"1 c #5D5D5D", +"2 c #646464", +"3 c #777777", +"4 c #949494", +"5 c #D8D8D8", +"6 c #A6A6A6", +"7 c #6B6B6B", +"8 c #373737", +"9 c #1F1F1F", +"0 c #0D0D0D", +"a c #030303", +"b c #040404", +"c c #090909", +"d c #1A1A1A", +"e c #363636", +"f c #5A5A5A", +"g c #A8A8A8", +"h c #DFDFDF", +"i c #595959", +"j c #2C2C2C", +"k c #151515", +"l c #0C0C0C", +"m c #050505", +"n c #010101", +"o c #0A0A0A", +"p c #242424", +"q c #929292", +"r c #D3D3D3", +"s c #E8E8E8", +"t c #AEAEAE", +"u c #636363", +"v c #222222", +"w c #000000", +"x c #020202", +"y c #535353", +"z c #D0D0D0", +"A c #7B7B7B", +"B c #262626", +"C c #070707", +"D c #272727", +"E c #6E6E6E", +"F c #E9E9E9", +"G c #E6E6E6", +"H c #ADADAD", +"I c #101010", +"J c #161616", +"K c #484848", +"L c #989898", +"M c #E0E0E0", +"N c #E4E4E4", +"O c #EBEBEB", +"P c #F2F2F2", +"Q c #DDDDDD", +"R c #8D8D8D", +"S c #424242", +"T c #060606", +"U c #838383", +"V c #D6D6D6", +"W c #EFEFEF", +"X c #DADADA", +"Y c #828282", +"Z c #3D3D3D", +"` c #1D1D1D", +" . c #202020", +".. c #171717", +"+. c #1C1C1C", +"@. c #7A7A7A", +"#. c #D1D1D1", +"$. c #7F7F7F", +"%. c #585858", +"&. c #4B4B4B", +"*. c #787878", +"=. c #696969", +"-. c #525252", +";. c #2D2D2D", +">. c #313131", +",. c #5E5E5E", +"'. c #707070", +"). c #727272", +"!. c #4A4A4A", +"~. c #898989", +"{. c #8A8A8A", +"]. c #AFAFAF", +"^. c #CDCDCD", +"/. c #767676", +"(. c #AAAAAA", +"_. c #8E8E8E", +":. c #A7A7A7", +"<. c #909090", +"[. c #9F9F9F", +"}. c #C6C6C6", +"|. c #D9D9D9", +"1. c #878787", +"2. c #C1C1C1", +"3. c #EAEAEA", +"4. c #DCDCDC", +"5. c #A0A0A0", +"6. c #D2D2D2", +"7. c #E5E5E5", +"8. c #E2E2E2", +"9. c #A1A1A1", +"0. c #A5A5A5", +"a. c #BFBFBF", +"b. c #F5F5F5", +"c. c #BABABA", +"d. c #B9B9B9", +"e. c #E3E3E3", +"f. c #B7B7B7", +"g. c #969696", +"h. c #8B8B8B", +"i. c #C7C7C7", +"j. c #CFCFCF", +"k. c #9E9E9E", +"l. c #888888", +"m. c #858585", +"n. c #7C7C7C", +"o. c #9B9B9B", +"p. c #B0B0B0", +"q. c #303030", +"r. c #3E3E3E", +"s. c #717171", +"t. c #494949", +"u. c #292929", +"v. c #323232", +"w. c #5C5C5C", +"x. c #ABABAB", +"y. c #CCCCCC", +"z. c #404040", +"A. c #121212", +"B. c #434343", +"C. c #8F8F8F", +"D. c #474747", +"E. c #454545", +"F. c #848484", +"G. c #181818", +"H. c #676767", +"I. c #3C3C3C", +"J. c #0B0B0B", +"K. c #2E2E2E", +"L. c #3A3A3A", +"M. c #333333", +"N. c #343434", +"O. c #353535", +"P. c #212121", +"Q. c #141414", +"R. c #6C6C6C", +"S. c #B1B1B1", +"T. c #E1E1E1", +"U. c #414141", +"V. c #4F4F4F", +"W. c #555555", +"X. c #B8B8B8", +"Y. c #7E7E7E", +"Z. c #4D4D4D", +"`. c #545454", +" + c #464646", +".+ c #2B2B2B", +"++ c #C4C4C4", +"@+ c #BDBDBD", +"#+ c #C3C3C3", +"$+ c #E7E7E7", +"%+ c #131313", +"&+ c #1B1B1B", +"*+ c #D5D5D5", +"=+ c #666666", +"-+ c #6A6A6A", +";+ c #4E4E4E", +">+ c #393939", +",+ c #CBCBCB", +"'+ c #818181", +")+ c #080808", +"!+ c #868686", +"~+ c #959595", +"{+ c #D4D4D4", +"]+ c #A2A2A2", +"^+ c #565656", +"/+ c #BEBEBE", +"(+ c #797979", +"_+ c #2A2A2A", +":+ c #0E0E0E", +"<+ c #1E1E1E", +"[+ c #979797", +"}+ c #505050", +"|+ c #3B3B3B", +"1+ c #4C4C4C", +"2+ c #A9A9A9", +"3+ c #5B5B5B", +"4+ c #6D6D6D", +"5+ c #A4A4A4", +"6+ c #232323", +"7+ c #0F0F0F", +"8+ c #191919", +"9+ c #111111", +"0+ c #656565", +"a+ c #575757", +"b+ c #606060", +"c+ c #444444", +"d+ c #515151", +"e+ c #3F3F3F", +"f+ c #747474", +"g+ c #757575", +"h+ c #C9C9C9", +"i+ c #B4B4B4", +"j+ c #2F2F2F", +"k+ c #A3A3A3", +"l+ c #9A9A9A", +"m+ c #383838", +"n+ c #252525", +"o+ c #282828", +"p+ c #CACACA", +"q+ c #C0C0C0", +"r+ c #9C9C9C", +"s+ c #CECECE", +"t+ c #626262", +"u+ c #737373", +" . + @ # $ $ % % # & + ", +" . @ $ * = - ; - > , % # @ . ", +" . @ = ' ) ! ~ ~ { ] ^ / ( # @ + . ", +" . _ : < [ } | 1 1 2 3 4 ! 5 = % # & + ", +" . @ - 6 7 8 9 0 a b c d e f g h , ( ( @ . ", +" . @ 5 6 i j k l m n n a o k p i q r s / % @ . ", +" . $ > t u v m w w w w w w w n x 9 y g r - , _ & + ", +" . = z A B l n w w w w w w w w w C D E { F ; / _ & . ", +" . G H f I m w w w w w w w w w w n J K L M N O P $ . ", +" . Q R S C T T m a n w w w x b T m I j U V ' G W _ + ", +" . X Y Z 0 ` v .I T n w x l ..v ` +.p @.#.Q G > _ + ", +" . X $.%.&.E @.*.=.-.;.>.S ,.'.@.).u !.~.z Q G - ( + ", +" . X Y {.].N # # * ^./.Y (.h ( # / z _.:.z Q G - ( + ", +" . ' <.[.}.- + + & |.1.L 2.3.@ + _ 4.5.{ 6.4.7.- ( + ", +" + 8.9.0.a.G % . b.z U q c.7.$ . W r 0.d.^ 4.e.- ( + ", +" . @ s f.g.h.}.s # : (.,.2 1.i.3.# j.~ g.d.M Q e.- ( + ", +" . @ = 5 k.7 /.Y _.~.l._.{.m.m.~._.A n.o.2.M ' e.> _ + ", +" . @ $ * p.u q.` 9 r.s.] ! R t.u.9 v.w.x.y.' ' N W _ + ", +" + # _ |.g z.A.c B.} ! ].C.D.9 l E.F.^.X X M F P $ + ", +" . @ % W ^.-.G.c Z H.Y $.E I.` J.%.[.: h |.7.> ( & . ", +" + $ % ' 2 u.G.K.L.M.N.O.j P.Q.R.S.: Q X O b.& . ", +" + & $ T.s.U.I.V.f %.%.i W.B.B *.X.4.h ' > _ @ . ", +" . _ > ; - * _ N Y.Z.U.Z.`.`.`.`.W. +.+U ++T.e.T.3./ ( # + . . ", +" . # 7.++@+#+M W $+h.t.G.J Q.%+%+Q.G.&+9 h.*+O 3.e.4.' $+P $ # @ . ", +" & s { =+,.-+g.) G t n.;+S >+e e 8 U.;+,.t 8.; ,+9.$.Y k.j.> b.$ + . ", +" . _ 6.'+I )+..!.k.e.#.! g.!+A 3 /.*.m.~+g {+O 7.]+^+P.D ^+~ 7.= ( & . ", +" & > /+'.0 m 0 j 1.Q M X j.^.y.y.,+y.j.6.V $+G ) (+_+:+<+!.6 e.= b.% @ ", +" . + G ++l.t.)+a C G.R.] M F G G $+F 3.F 3.3.3.G ^.[+}+I m A.q.Y./+s P b.# + ", +" + $ ++U |+Q.x n a J.1+L V O G 8.M 8.e.e.7.F - V 2+3+D a n m 0 z.'+|.- = _ @ . ", +" + _ @+3 ;.o n w n b ` r.4+L 2.V 7.O ; F ' }.5+'.B.6+7+n w x m d W.,+$+- , _ @ . ", +" + % }.1.U.P.8++.d 9+c )+6+-._./+M ; e.6.! R w.B T T 7+..7+o C Q.Z.i.N s > * # + ", +" . + 7.2.!+0+a+b+f I.` T )+9 c+~+^.T.a._.w.N.%+)+T A.e d+e p G.e+@.*+N 8.3./ $ + ", +" . P T.2.H ]+(.6 _.| c+O.!./.[.t [ s.D.D A.b G.O.1 !+9.{.A s.<.{ 4.T.T.O , # + ", +" + # b.W s M G N |.f.<.f+Y ~ 9.U !.B l )+l J B.g+].z N 5 j.h+5 T.M M 8.> ( & . ", +" . & _ * ; e.8.T.8.4.#.i+~+).;+j+G.7+0 +.S /.k+}.X Q 4.4.: X 4.' ' 8.s , # + . ", +" . & b.3.M *+4.M M *+2.g.| >++.l I v >+%.(+l+x./+r X ' 8.e.8.8.8.8.$+- _ @ . ", +" . $ W 5 ) @+*+M ^ p.} m+A.w w o n+-.Y t p.g.3 (+(.y.G 3.F N s O 3.- P $ + ", +" . @ T.< !+=.w.*.m.n.i M.J J.J.o+Z.Y.]+X.[./.S >.M.}+3 [+l+[+<.H p+$+> = % @ . ", +" + $ h+R +p 8+q.I.N.` )+J.` >+2 <.q+5 4.:.7 u.A.c k M.V.}+Z. +R.r+' ; > _ @ . ", +" @ * i+| 6+T b c J.o C c P.`.l+@+V ' N 7.6.0.| j+J.T J.I I 7+l P.f ,+G O b.& . ", +" + _ 2.Y.N.:+n n a c o+V.n.0.p+V ' M 8.N h s+i+!+a+D I x x b )+9 f ,+7.3.* & . ", +" . @ 5 0.a+p a n C 8+%.k.*+s N 4.|.' M e.G ; * X 2+`.v w n c ..|+g+6.7.s , # . ", +" . + P 5 _.t.T x %+S R z |.4.: 4.M 3.> = = = W ; p+A e w n ..|+'+c.h 7.G , # . ", +" . + @ > p.t+o o B 4+p.8.X 5 X M s P ( % _ * = * 4.o.1+)+b P.`.6 X T.e.G * & . ", +" . + & = ] u+:+J e+[ }.M ^ 5 h G W % @ + @ $ b.b.e.f.2 J )+o+=+! e.4.M s b.@ . ", +" . @ _ N ] g.[ g ,+5 Q 4.8.; / _ @ . . . + & $ = Q { F.| n.S.#.e.M $+= $ + ", +" . + & % / s G 7.7.T.Q 8.O b.$ @ . . & % , N z i+@+' M 8.N ; ( @ ", +" . @ % P 3.N h : Q 8.3.P $ @ . + $ P - s T.h M ' M $+= % + "}; diff --git a/elauncher/icons/error.xpm b/elauncher/icons/error.xpm new file mode 100644 index 0000000..cb5bf8c --- /dev/null +++ b/elauncher/icons/error.xpm @@ -0,0 +1,315 @@ +/* XPM */ +static char * error_xpm[] = { +"32 32 280 2", +" c None", +". c #CA8383", +"+ c #C98484", +"@ c #C97070", +"# c #C76262", +"$ c #C76868", +"% c #C66A6A", +"& c #C78383", +"* c #C67979", +"= c #C78B8B", +"- c #C68B8B", +"; c #CB7D7D", +"> c #C94242", +", c #C72020", +"' c #C63030", +") c #C73D3D", +"! c #CD3A3A", +"~ c #CD4444", +"{ c #CC5A5A", +"] c #CB5B5B", +"^ c #C45151", +"/ c #C15151", +"( c #BE4141", +"_ c #BF5858", +": c #C27474", +"< c #CB8A8A", +"[ c #CB6262", +"} c #C84343", +"| c #CC1313", +"1 c #DC0000", +"2 c #EB1F1F", +"3 c #F75C5C", +"4 c #F97B7B", +"5 c #F86B6B", +"6 c #EA2E2E", +"7 c #D50000", +"8 c #BE1818", +"9 c #B92929", +"0 c #BC5454", +"a c #C48B8B", +"b c #CB7A7A", +"c c #CB4444", +"d c #DC1B1B", +"e c #F75656", +"f c #FCAFAF", +"g c #FFEBEB", +"h c #FDCDCD", +"i c #F97474", +"j c #D70E0E", +"k c #B71818", +"l c #B52929", +"m c #B95757", +"n c #CB6161", +"o c #CA2929", +"p c #CF0C0C", +"q c #EC3232", +"r c #FAA4A4", +"s c #FFDCDC", +"t c #FECDCD", +"u c #EE4343", +"v c #BA0000", +"w c #AF1818", +"x c #CB6565", +"y c #CA2020", +"z c #D80000", +"A c #F33E3E", +"B c #FEBFBF", +"C c #FFCCCC", +"D c #F57171", +"E c #C50000", +"F c #A90000", +"G c #BA6868", +"H c #CB8E8E", +"I c #CB4949", +"J c #CF2020", +"K c #F33A3A", +"L c #FFBCBC", +"M c #FFCACA", +"N c #F67474", +"O c #B50000", +"P c #B03636", +"Q c #C19595", +"R c #CA4E4E", +"S c #CB2020", +"T c #EC1F1F", +"U c #FEA0A0", +"V c #FFABAB", +"W c #FFFFFF", +"X c #FFE1E1", +"Y c #ED3F3F", +"Z c #AA0909", +"` c #AD3434", +" . c #CB7171", +".. c #C93434", +"+. c #DF0000", +"@. c #FC7373", +"#. c #FF9A9A", +"$. c #FFC1C1", +"%. c #FFDBDB", +"&. c #FE9090", +"*. c #D00909", +"=. c #A61B1B", +"-. c #B97474", +";. c #C93A3A", +">. c #F52222", +",. c #FF8A8A", +"'. c #FFA0A0", +"). c #FFD4D4", +"!. c #FA5555", +"~. c #AA0404", +"{. c #AD4343", +"]. c #CB8888", +"^. c #C73434", +"/. c #DE0000", +"(. c #FB5353", +"_. c #FF7979", +":. c #FFCECE", +"<. c #FE7272", +"[. c #FB5555", +"}. c #F72F2F", +"|. c #F41818", +"1. c #C80000", +"2. c #A83434", +"3. c #BC8888", +"4. c #C97171", +"5. c #EA0606", +"6. c #FF6767", +"7. c #FFC5C5", +"8. c #FFC7C7", +"9. c #FCACAC", +"0. c #F72929", +"a. c #F20000", +"b. c #E20000", +"c. c #9F1313", +"d. c #C77878", +"e. c #C62424", +"f. c #F51616", +"g. c #FF5656", +"h. c #FFBEBE", +"i. c #FA9F9F", +"j. c #A10909", +"k. c #B26C6C", +"l. c #C86D6D", +"m. c #CD2E2E", +"n. c #F92222", +"o. c #FF4545", +"p. c #FFB8B8", +"q. c #B01010", +"r. c #AE5C5C", +"s. c #C77474", +"t. c #CC3636", +"u. c #F91A1A", +"v. c #FF3333", +"w. c #FFB1B1", +"x. c #AE0D0D", +"y. c #CB3636", +"z. c #F91111", +"A. c #FF2222", +"B. c #FFADAD", +"C. c #AE0C0C", +"D. c #C56F6F", +"E. c #CA3232", +"F. c #F90808", +"G. c #FF1010", +"H. c #FFA7A7", +"I. c #F40000", +"J. c #AE1515", +"K. c #B27373", +"L. c #C01818", +"M. c #F90101", +"N. c #FF0202", +"O. c #FC9F9F", +"P. c #F70000", +"Q. c #9C1414", +"R. c #B17070", +"S. c #BA1313", +"T. c #EE0000", +"U. c #FD0101", +"V. c #FD9F9F", +"W. c #FA0000", +"X. c #E60000", +"Y. c #910909", +"Z. c #BC2F2F", +"`. c #D90404", +" + c #FE0000", +".+ c #FE9F9F", +"++ c #FF9F9F", +"@+ c #C61818", +"#+ c #A24141", +"$+ c #C05D5D", +"%+ c #C01B1B", +"&+ c #FF0707", +"*+ c #FF3535", +"=+ c #FFA3A3", +"-+ c #A52929", +";+ c #A85858", +">+ c #C59191", +",+ c #BC4F4F", +"'+ c #DB1B1B", +")+ c #FF1212", +"!+ c #FF6C6C", +"~+ c #CD1B1B", +"{+ c #9D3838", +"]+ c #B07676", +"^+ c #BD5D5D", +"/+ c #B92727", +"(+ c #F51919", +"_+ c #FF1D1D", +":+ c #FF7272", +"<+ c #F11919", +"[+ c #A13535", +"}+ c #A45252", +"|+ c #C6A2A2", +"1+ c #BA5353", +"2+ c #BE1E1E", +"3+ c #FA2626", +"4+ c #FF2828", +"5+ c #FF5151", +"6+ c #F62929", +"7+ c #A62121", +"8+ c #A44F4F", +"9+ c #B99393", +"0+ c #C08080", +"a+ c #B64747", +"b+ c #CA2323", +"c+ c #FA3030", +"d+ c #FF3434", +"e+ c #F83030", +"f+ c #B81D1D", +"g+ c #A04444", +"h+ c #B07878", +"i+ c #BF8181", +"j+ c #B65252", +"k+ c #B92121", +"l+ c #F43636", +"m+ c #FF3F3F", +"n+ c #F13636", +"o+ c #A31616", +"p+ c #972A2A", +"q+ c #AE7171", +"r+ c #C08C8C", +"s+ c #B14141", +"t+ c #A90404", +"u+ c #D62929", +"v+ c #FF4A4A", +"w+ c #CD2929", +"x+ c #930404", +"y+ c #942020", +"z+ c #AB6868", +"A+ c #C29B9B", +"B+ c #B15151", +"C+ c #AC3C3C", +"D+ c #B02D2D", +"E+ c #CD3838", +"F+ c #EC4545", +"G+ c #EA4545", +"H+ c #C73030", +"I+ c #9F1919", +"J+ c #962020", +"K+ c #B88F8F", +"L+ c #BF9090", +"M+ c #B15555", +"N+ c #AB4646", +"O+ c #A42929", +"P+ c #AB3E3E", +"Q+ c #BA5151", +"R+ c #B64646", +"S+ c #B33838", +"T+ c #B23838", +"U+ c #A02828", +"V+ c #982020", +"W+ c #A13F3F", +"X+ c #B07777", +"Y+ c #C2A2A2", +"Z+ c #B67474", +"`+ c #B98282", +" @ c #AD6464", +".@ c #AC5F5F", +"+@ c #AF6B6B", +"@@ c #BB9696", +" ", +" . + @ # $ % & * = - ", +" ; > , ' ) ! ~ { ] ^ / ( _ : ", +" < [ } | 1 2 3 4 4 4 4 5 6 7 8 9 0 a ", +" b c c d e f g g g g g g g g h i j k l m ", +" n o p q r s s s s s s s s s s s s t u v w m ", +" x y z A B C C C C C C C C C C C C C C C D E F G ", +" H I J K L L L M L L L L L L L L L L M L L L N O P Q ", +" R S T U V V C W X V V V V V V V V X W C V V V Y Z ` ", +" ...+.@.#.#.$.W W W %.#.#.#.#.#.#.%.W W W $.#.#.&.*.=.-. ", +" ;.| >.,.,.'.W W W W W ).,.,.,.,.).W W W W W '.,.,.!.~.{. ", +" ].^./.(._._._.C W W W W W :._._.:.W W W W W C <.[.}.|.1.2.3. ", +" 4.^.5.6.6.6.6.6.7.W W W W W 8.8.W W W W W 9.0.a.a.a.a.b.c.d. ", +" d.e.f.g.g.g.g.g.g.h.W W W W W W W W W W i.a.a.a.a.a.a.a.j.k. ", +" l.m.n.o.o.o.o.o.o.o.p.W W W W W W W W i.a.a.a.a.a.a.a.a.q.r. ", +" s.t.u.v.v.v.v.v.v.v.v.w.W W W W W W i.a.a.a.a.a.a.a.a.a.x.k. ", +" d.y.z.A.A.A.A.A.A.A.A.B.W W W W W W i.a.a.a.a.a.a.a.a.a.C.k. ", +" D.E.F.G.G.G.G.G.G.G.H.W W W W W W W W i.I.I.I.I.I.I.I.I.J.K. ", +" d.L.M.N.N.N.N.N.N.'.W W W W W W W W W W O.P.P.P.P.P.P.P.Q.R. ", +" d.S.T.U.U.U.U.U.U W W W W W V.V.W W W W W V.W.W.W.W.W.X.Y.d. ", +" Z.`. + + + +.+W W W W W ++ + +++W W W W W .+ + + + +@+#+ ", +" $+%+&+&+&+*+W W W W W =+&+&+&+&+=+W W W W W *+&+&+&+-+;+ ", +" >+,+'+)+)+)+!+W W W H.)+)+)+)+)+)+H.W W W !+)+)+)+~+{+]+ ", +" ^+/+(+_+_+_+:+W V _+_+_+_+_+_+_+_+V W :+_+_+_+<+[+}+ ", +" |+1+2+3+4+4+4+5+4+4+4+4+4+4+4+4+4+4+5+4+4+4+6+7+8+9+ ", +" 0+a+b+c+d+d+d+d+d+d+d+d+d+d+d+d+d+d+d+d+e+f+g+h+ ", +" i+j+k+l+m+m+m+m+m+m+m+m+m+m+m+m+m+m+n+o+p+q+ ", +" r+s+t+u+v+v+v+v+v+v+v+v+v+v+v+v+w+x+y+z+ ", +" A+B+C+D+E+F+g.g.g.g.g.g.G+H+I+J+g+K+ ", +" L+M+N+O+P+Q+R+S+T+U+V+W+;+X+ ", +" Y+Z+`+k.k.k. @.@+@@@ ", +" "}; diff --git a/elauncher/icons/run.xpm b/elauncher/icons/run.xpm new file mode 100644 index 0000000..97a959f --- /dev/null +++ b/elauncher/icons/run.xpm @@ -0,0 +1,551 @@ +/* XPM */ +static char * run_xpm[] = { +"32 32 516 2", +" c None", +". c #C9EFF9", +"+ c #BFDCE4", +"@ c #C7ECF6", +"# c #CAEBF4", +"$ c #BAE6F3", +"% c #97A9AE", +"& c #ADE7F3", +"* c #B9EFF7", +"= c #B8F7FB", +"- c #C3EFF7", +"; c #B7EDFC", +"> c #9AC8D8", +", c #A6E1F0", +"' c #9FEFF7", +") c #8BEFF7", +"! c #85EDF6", +"~ c #93EBF5", +"{ c #A4ECFA", +"] c #8CD4E9", +"^ c #8DD2E6", +"/ c #9FC2CC", +"( c #D0F3FA", +"_ c #AEECF5", +": c #81E5F2", +"< c #70E5F2", +"[ c #62E3F1", +"} c #5AE1EF", +"| c #70E1F1", +"1 c #78D8ED", +"2 c #76DAF7", +"3 c #72AFC2", +"4 c #ADDBE8", +"5 c #EDFCFE", +"6 c #EEFBFE", +"7 c #C7F0F7", +"8 c #89DFEE", +"9 c #59DAEB", +"0 c #49D9EB", +"a c #3CD6EA", +"b c #3AD4E9", +"c c #4BD1E7", +"d c #5DD6F1", +"e c #55C0DD", +"f c #6CBFD7", +"g c #9BD6E6", +"h c #C7EDF8", +"i c #F2FEFE", +"j c #E7FBFE", +"k c #E5FBFE", +"l c #DDF8FC", +"m c #ADE8F2", +"n c #66D4E7", +"o c #35CAE2", +"p c #2ACBE4", +"q c #22C8E3", +"r c #1FC6E1", +"s c #34C8E3", +"t c #3FC2E0", +"u c #47C0E2", +"v c #5FA0B4", +"w c #A1DEEF", +"x c #E5F9FC", +"y c #E7FBFD", +"z c #E0F9FC", +"A c #DAF7FC", +"B c #D4F7FB", +"C c #D4F8FC", +"D c #C6F2F9", +"E c #95DFEE", +"F c #4BC8DE", +"G c #1CBEDB", +"H c #16BCDC", +"I c #11BBDC", +"J c #11B8DB", +"K c #1EB7D9", +"L c #32C2E8", +"M c #3CB2D5", +"N c #5FB0C9", +"O c #95D0DB", +"P c #BAE9F6", +"Q c #ECFCFE", +"R c #DAF8FC", +"S c #D5F8FB", +"T c #CEF6FB", +"U c #C8F4FA", +"V c #C2F2F9", +"W c #BEF2FA", +"X c #B2EEF6", +"Y c #79D5E6", +"Z c #33BAD6", +"` c #0DAED0", +" . c #0AAFD5", +".. c #06ACD3", +"+. c #07ABD3", +"@. c #13ADD4", +"#. c #1EADD4", +"$. c #2FB1D7", +"%. c #5895A8", +"&. c #8FD3E5", +"*. c #D7F6FB", +"=. c #E4FBFE", +"-. c #CFF5FA", +";. c #C0F2F9", +">. c #B8F0F8", +",. c #B0EEF7", +"'. c #A9EDF5", +"). c #A9EDF7", +"!. c #97E5F0", +"~. c #65CDE0", +"{. c #23ADCC", +"]. c #05A2C9", +"^. c #03A2CD", +"/. c #02A1CC", +"(. c #019EC9", +"_. c #15A6CD", +":. c #25B9E1", +"<. c #2FA2C5", +"[. c #5FC4E0", +"}. c #A1DFF0", +"|. c #E8FDFE", +"1. c #DCF9FC", +"2. c #D5F7FB", +"3. c #C8F3FA", +"4. c #BFF0F8", +"5. c #AFEEF6", +"6. c #A7EBF4", +"7. c #A1E9F3", +"8. c #98E6F1", +"9. c #93E5F1", +"0. c #8FE5F0", +"a. c #83DEEB", +"b. c #51C1D6", +"c. c #1AA5C4", +"d. c #0194BF", +"e. c #0095C2", +"f. c #3DBFDA", +"g. c #4CC5D9", +"h. c #0291BF", +"i. c #0C9BC8", +"j. c #7FC3D6", +"k. c #D4F9FD", +"l. c #DEF8FC", +"m. c #D6F7FC", +"n. c #D0F6FA", +"o. c #C7F2F9", +"p. c #B8F0F6", +"q. c #B0EEF6", +"r. c #A8EBF4", +"s. c #9FE8F1", +"t. c #93E3EE", +"u. c #82DDE8", +"v. c #72D5E2", +"w. c #6DD4E3", +"x. c #6DD7E6", +"y. c #73DAE8", +"z. c #65D1E1", +"A. c #3EB7CD", +"B. c #0F95B9", +"C. c #0A8DB1", +"D. c #1A96B7", +"E. c #007FAF", +"F. c #1D94BB", +"G. c #B4CDF6", +"H. c #B7CFF7", +"I. c #AEC9F6", +"J. c #A9C5F5", +"K. c #A3C1F5", +"L. c #9DBEF4", +"M. c #95B9F3", +"N. c #8FB4F2", +"O. c #87B0F2", +"P. c #81ACF1", +"Q. c #7AA7F0", +"R. c #73A2EF", +"S. c #6E9FED", +"T. c #689AE9", +"U. c #6497E6", +"V. c #6092E3", +"W. c #5C8FE0", +"X. c #5A8DDE", +"Y. c #5B8EE0", +"Z. c #346CBC", +"`. c #4BC1D0", +" + c #54CADB", +".+ c #57CDDE", +"++ c #59D0E0", +"@+ c #52C8D9", +"#+ c #2DA8C1", +"$+ c #0885AA", +"%+ c #0078A5", +"&+ c #3A90AA", +"*+ c #AECBF6", +"=+ c #A4D3FA", +"-+ c #9CD0FA", +";+ c #96CBF9", +">+ c #8EC7F7", +",+ c #87C2F7", +"'+ c #7EBCF6", +")+ c #75B7F5", +"!+ c #6CB1F4", +"~+ c #61A9F3", +"{+ c #58A2ED", +"]+ c #529CE8", +"^+ c #4B95E2", +"/+ c #448EDC", +"(+ c #3D86D6", +"_+ c #3881D2", +":+ c #3179CC", +"<+ c #2D74C7", +"[+ c #EDF5FD", +"}+ c #7EAFF1", +"|+ c #1758AB", +"1+ c #34A3B1", +"2+ c #48BCCC", +"3+ c #4CC4D7", +"4+ c #4BC5D8", +"5+ c #4AC5D7", +"6+ c #4FCADA", +"7+ c #34AFC6", +"8+ c #1E8FB5", +"9+ c #A8C7F6", +"0+ c #96CEFA", +"a+ c #8EC9F9", +"b+ c #87C5F8", +"c+ c #7FC0F7", +"d+ c #77BAF6", +"e+ c #6DB4F5", +"f+ c #63ADF4", +"g+ c #5AA7F0", +"h+ c #529FEA", +"i+ c #4B98E4", +"j+ c #4591DE", +"k+ c #3F8BD9", +"l+ c #3783D3", +"m+ c #327DCE", +"n+ c #2C76C8", +"o+ c #2771C4", +"p+ c #7CADF0", +"q+ c #5189D5", +"r+ c #1558AB", +"s+ c #1E808C", +"t+ c #39ACBB", +"u+ c #45BCCD", +"v+ c #45BFD1", +"w+ c #42BED0", +"x+ c #41BDCE", +"y+ c #2CABC3", +"z+ c #4E95AA", +"A+ c #A4C2F5", +"B+ c #A7C7F5", +"C+ c #A1C4F4", +"D+ c #9CC0F3", +"E+ c #95BBF2", +"F+ c #8BB5F1", +"G+ c #82AFEF", +"H+ c #77A8EE", +"I+ c #6EA2EC", +"J+ c #679BE6", +"K+ c #5F95DF", +"L+ c #558CD7", +"M+ c #4F86D2", +"N+ c #4880CC", +"O+ c #4078C5", +"P+ c #3972BE", +"Q+ c #316BB8", +"R+ c #2C65B3", +"S+ c #255FAD", +"T+ c #205BA9", +"U+ c #154F9D", +"V+ c #136B75", +"W+ c #2E9EAD", +"X+ c #3BB4C4", +"Y+ c #3CB9CB", +"Z+ c #38B6C9", +"`+ c #2692AD", +" @ c #C1D8FD", +".@ c #F4F9FF", +"+@ c #F1F7FF", +"@@ c #EEF5FE", +"#@ c #EAF3FE", +"$@ c #E7F1FE", +"%@ c #E4F0FE", +"&@ c #E0EDFE", +"*@ c #DBEBFD", +"=@ c #D5E7FD", +"-@ c #CFE3FD", +";@ c #CCE1FC", +">@ c #C5DEFC", +",@ c #BFDAFB", +"'@ c #B9D6FB", +")@ c #AED0FA", +"!@ c #A6CBF9", +"~@ c #A1C8F9", +"{@ c #9AC3F7", +"]@ c #98C3F8", +"^@ c #588BDD", +"/@ c #0F626C", +"(@ c #2694A3", +"_@ c #33ACBD", +":@ c #33B0C3", +"<@ c #32B0C0", +"[@ c #1D9AB6", +"}@ c #3D8D9D", +"|@ c #BCD5FD", +"1@ c #F3F8FF", +"2@ c #F0F6FE", +"3@ c #ECF4FE", +"4@ c #EAF2FE", +"5@ c #E6F0FE", +"6@ c #E1EEFE", +"7@ c #DDEBFD", +"8@ c #D7E8FD", +"9@ c #D2E5FD", +"0@ c #C8E0FC", +"a@ c #C2DCFB", +"b@ c #B3D3FA", +"c@ c #A5CAF8", +"d@ c #9FC6F8", +"e@ c #9DC5F7", +"f@ c #97C2F7", +"g@ c #91BEF6", +"h@ c #5689DB", +"i@ c #0E6069", +"j@ c #218E9D", +"k@ c #2CA4B5", +"l@ c #2CA8BA", +"m@ c #26A2B7", +"n@ c #1D90AD", +"o@ c #B8D2FC", +"p@ c #EBF3FE", +"q@ c #E8F1FE", +"r@ c #DBEAFD", +"s@ c #D4E6FD", +"t@ c #CBE1FC", +"u@ c #C4DDFB", +"v@ c #AACDF9", +"w@ c #9FC6F7", +"x@ c #99C3F6", +"y@ c #95C0F6", +"z@ c #91BDF6", +"A@ c #8DBBF5", +"B@ c #5286D7", +"C@ c #0C5C65", +"D@ c #1B8897", +"E@ c #249BAD", +"F@ c #249EB0", +"G@ c #1A97B1", +"H@ c #3F90A6", +"I@ c #B2CFFC", +"J@ c #EDF4FE", +"K@ c #E7F0FE", +"L@ c #E3EFFD", +"M@ c #DEECFD", +"N@ c #DAE9FD", +"O@ c #CEE2FC", +"P@ c #C5DDFB", +"Q@ c #A9CDF8", +"R@ c #9EC5F7", +"S@ c #9CC4F7", +"T@ c #9BC3F7", +"U@ c #92BEF5", +"V@ c #8CBAF5", +"W@ c #86B6F4", +"X@ c #4E83D4", +"Y@ c #0A5761", +"Z@ c #177F90", +"`@ c #1C91A3", +" # c #1D96A8", +".# c #1A88A7", +"+# c #AFCDFC", +"@# c #E9F2FE", +"## c #E0EDFD", +"$# c #DBE9FD", +"%# c #D1E4FC", +"&# c #AFCFF9", +"*# c #9DC4F7", +"=# c #98C2F6", +"-# c #95C0F5", +";# c #91BDF5", +"># c #8BB9F4", +",# c #85B5F3", +"'# c #7EB1F2", +")# c #4B80D1", +"!# c #08525D", +"~# c #127789", +"{# c #168798", +"]# c #0F86A1", +"^# c #3C8FA5", +"/# c #AACAFC", +"(# c #E2EEFD", +"_# c #D8E9FD", +":# c #D3E5FC", +"<# c #CFE3FC", +"[# c #C0DAFB", +"}# c #A3C8F7", +"|# c #9EC5F6", +"1# c #9DC4F6", +"2# c #99C2F6", +"3# c #97C1F5", +"4# c #8AB8F4", +"5# c #84B4F3", +"6# c #76ABF1", +"7# c #467CCD", +"8# c #07535E", +"9# c #0F7281", +"0# c #0F7B90", +"a# c #0F85A4", +"b# c #A6C7FC", +"c# c #E2EEFE", +"d# c #D6E6FC", +"e# c #CCE1FB", +"f# c #A0C6F6", +"g# c #9AC3F6", +"h# c #96C0F5", +"i# c #92BDF4", +"j# c #8AB8F3", +"k# c #84B3F2", +"l# c #7DB0F1", +"m# c #75AAF0", +"n# c #6DA4EF", +"o# c #4177C8", +"p# c #075765", +"q# c #0B6A7B", +"r# c #09758E", +"s# c #3893AD", +"t# c #A2C4FC", +"u# c #E4EFFE", +"v# c #D5E5FC", +"w# c #CEE2FB", +"x# c #BCD7FA", +"y# c #98C0F5", +"z# c #93BDF4", +"A# c #8EBAF3", +"B# c #85B4F2", +"C# c #7DAFF1", +"D# c #76ABF0", +"E# c #6DA4EE", +"F# c #659EE8", +"G# c #3C72C3", +"H# c #044F61", +"I# c #076376", +"J# c #0D7998", +"K# c #9DC1FB", +"L# c #DEEBFD", +"M# c #D8E7FC", +"N# c #D3E4FC", +"O# c #BFD9FA", +"P# c #A7CAF7", +"Q# c #9FC5F6", +"R# c #9CC3F5", +"S# c #94BDF4", +"T# c #8EB9F3", +"U# c #7FAFF1", +"V# c #74A9EF", +"W# c #6BA2ED", +"X# c #659DE8", +"Y# c #5C96E1", +"Z# c #376DBE", +"`# c #335F69", +" $ c #0F5F77", +".$ c #388DA1", +"+$ c #9AC0FB", +"@$ c #D5E6FC", +"#$ c #CAE0FB", +"$$ c #BAD5F9", +"%$ c #AACCF7", +"&$ c #A6C9F7", +"*$ c #A4C8F6", +"=$ c #99C1F5", +"-$ c #92BCF3", +";$ c #88B6F2", +">$ c #80B0F1", +",$ c #77AAEF", +"'$ c #659CE7", +")$ c #5C95E0", +"!$ c #548DD9", +"~$ c #3068B8", +"{$ c #89B6F9", +"]$ c #C5DDFA", +"^$ c #BDD8F9", +"/$ c #B4D2F9", +"($ c #AFCFF8", +"_$ c #ACCDF7", +":$ c #A9CBF7", +"<$ c #A4C7F6", +"[$ c #9EC3F5", +"}$ c #8DB8F2", +"|$ c #85B2F1", +"1$ c #7AABF0", +"2$ c #6EA3EE", +"3$ c #5B93DF", +"4$ c #538CD7", +"5$ c #4B84D0", +"6$ c #2B63B3", +"7$ c #6095E6", +"8$ c #6095E5", +"9$ c #5E93E4", +"0$ c #5C92E3", +"a$ c #5C91E2", +"b$ c #5A8FE0", +"c$ c #598EDF", +"d$ c #578CDD", +"e$ c #558ADB", +"f$ c #5388D9", +"g$ c #4F84D5", +"h$ c #4D82D3", +"i$ c #4A7FD0", +"j$ c #467CCC", +"k$ c #4076C7", +"l$ c #3D73C4", +"m$ c #386EBF", +"n$ c #3369BA", +"o$ c #2D65B5", +"p$ c #2961B1", +"q$ c #225AA7", +" ", +" . + ", +" @ # $ % ", +" & * = - ; > ", +" , ' ) ! ~ { ] ^ ", +" / ( _ : < [ } | 1 2 3 ", +" 4 5 6 7 8 9 0 a b c d e f ", +" g h i j k l m n o p q r s t u v ", +" w x y z A B C D E F G H I J K L M N ", +" O P Q z R S T U V W X Y Z ` ...+.@.#.$.%. ", +" &.*.=.R B -.U ;.>.,.'.).!.~.{.].^./.(._.:.<.[. ", +" }.|.1.2.-.3.4.>.5.6.7.8.9.0.a.b.c.d.e.f.g.h.i. ", +" j.k.l.m.n.o.4.p.q.r.s.t.u.v.w.x.y.z.A.B.C.D.E.F. ", +" G.H.G.I.J.K.L.M.N.O.P.Q.R.S.T.U.V.W.X.Y.Z.`. +.+++@+#+$+%+&+ ", +" *+=+-+;+>+,+'+)+!+~+{+]+^+/+(+_+:+<+[+}+|+1+2+3+4+5+6+7+8+ ", +" 9+-+0+a+b+c+d+e+f+g+h+i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+y+z+ ", +" A+B+C+D+E+F+G+H+I+J+K+L+M+N+O+P+Q+R+S+T+U+V+W+X+Y+Z+Z+`+ ", +" @.@+@@@#@$@%@&@*@=@-@;@>@,@'@)@!@~@{@]@^@/@(@_@:@<@[@}@ ", +" |@1@2@3@4@5@6@7@8@9@-@0@a@b@c@d@e@{@f@g@h@i@j@k@l@m@n@ ", +" o@1@@@p@q@%@6@r@s@9@t@u@v@w@w@e@x@y@z@A@B@C@D@E@F@G@H@ ", +" I@2@J@p@K@L@M@N@s@O@P@Q@R@R@S@T@y@U@V@W@X@Y@Z@`@ #.# ", +" +#+@J@@#5@##$#=@%#t@&#S@R@*#=#-#;#>#,#'#)#!#~#{#]#^# ", +" /#2@p@K@(#M@_#:#<#[#}#|#1#2#3#;#4#5#'#6#7#8#9#0#a# ", +" b#@@p@K@c#7@d#%#e#&#f#1#g#h#i#j#k#l#m#n#o#p#q#r#s# ", +" t#J@@#u###N@v#w#x#}#f#1#y#z#A#B#C#D#E#F#G#H#I#J# ", +" K#J@q@(#L#M#N#O#P#}#Q#R#S#T#B#U#V#W#X#Y#Z#`# $.$ ", +" +$p@5@M@@$#$$$%$&$*$Q#=$-$;$>$,$W#'$)$!$~$ ", +" {$%#e#]$^$/$($_$:$<$[$S#}$|$1$2$'$3$4$5$6$ ", +" 7$8$9$0$a$b$c$d$e$f$g$h$i$j$k$l$m$n$o$p$q$ ", +" ", +" ", +" "}; diff --git a/elauncher/locale/Makefile b/elauncher/locale/Makefile new file mode 100644 index 0000000..0edd810 --- /dev/null +++ b/elauncher/locale/Makefile @@ -0,0 +1,208 @@ +# Makefile.in generated automatically by automake 1.4-p6 from Makefile.am + +# Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +# Set emacs mode -*- Makefile -*- + + +SHELL = /bin/sh + +srcdir = . +top_srcdir = ../.. + +prefix = /usr +exec_prefix = ${prefix} + +bindir = ${exec_prefix}/bin +sbindir = ${exec_prefix}/sbin +libexecdir = ${exec_prefix}/libexec +datadir = ${prefix}/share +sysconfdir = ${prefix}/etc +sharedstatedir = ${prefix}/com +localstatedir = ${prefix}/var +libdir = ${exec_prefix}/lib +infodir = ${prefix}/info +mandir = ${prefix}/man +includedir = ${prefix}/include +oldincludedir = /usr/include + +DESTDIR = + +pkgdatadir = $(datadir)/ede +pkglibdir = $(libdir)/ede +pkgincludedir = $(includedir)/ede + +top_builddir = ../.. + +ACLOCAL = aclocal-1.4 +AUTOCONF = autoconf +AUTOMAKE = automake-1.4 +AUTOHEADER = autoheader + +INSTALL = /usr/bin/install -c +INSTALL_PROGRAM = ${INSTALL} $(AM_INSTALL_PROGRAM_FLAGS) +INSTALL_DATA = ${INSTALL} -m 644 +INSTALL_SCRIPT = ${INSTALL} +transform = s,x,x, + +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +host_alias = +host_triplet = @host@ +CC = gcc +CPP = gcc -E +CXX = gcc +EDE_BUILD = 20050111 +FLTK_CONFIG = /usr/bin/efltk-config +HAVE_LIB = @HAVE_LIB@ +KSTAT_LIB = +LIB = @LIB@ +LTLIB = @LTLIB@ +MAKEINFO = makeinfo +PACKAGE = ede +USE_NLS = yes +VERSION = 1.0.1.1 + +PROG = erun +CWD = locale +MSGFMT = msgfmt +SUB_DIRS = +FILES_PO := $(wildcard *.po) +FILES_MO := $(FILES_PO:.po=.mo) + +LOCALEDIR = $(prefix)/share/locale +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = ../../config.h +CONFIG_CLEAN_FILES = +DIST_COMMON = Makefile.am Makefile.in + + +DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) + +TAR = gtar +GZIP_ENV = --best +all: all-redirect +.SUFFIXES: +$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) + cd $(top_srcdir) && $(AUTOMAKE) --gnu elauncher/locale/Makefile + +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES) + cd $(top_builddir) \ + && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status + +tags: TAGS +TAGS: + + +distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) + +subdir = elauncher/locale + +distdir: $(DISTFILES) + here=`cd $(top_builddir) && pwd`; \ + top_distdir=`cd $(top_distdir) && pwd`; \ + distdir=`cd $(distdir) && pwd`; \ + cd $(top_srcdir) \ + && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu elauncher/locale/Makefile + @for file in $(DISTFILES); do \ + d=$(srcdir); \ + if test -d $$d/$$file; then \ + cp -pr $$d/$$file $(distdir)/$$file; \ + else \ + test -f $(distdir)/$$file \ + || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ + || cp -p $$d/$$file $(distdir)/$$file || :; \ + fi; \ + done +info-am: +info: info-am +dvi-am: +dvi: dvi-am +check-am: all-am +check: check-am +installcheck-am: +installcheck: installcheck-am +install-exec-am: +install-exec: install-exec-am + +install-data-am: +install-data: install-data-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am +install: install-am +uninstall-am: +uninstall: uninstall-am +all-am: Makefile +all-redirect: all-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install +installdirs: + + +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -rm -f Makefile $(CONFIG_CLEAN_FILES) + -rm -f config.cache config.log stamp-h stamp-h[0-9]* + +maintainer-clean-generic: +mostlyclean-am: mostlyclean-generic + +mostlyclean: mostlyclean-am + +clean-am: clean-generic mostlyclean-am + +clean: clean-am + +distclean-am: distclean-generic clean-am + +distclean: distclean-am + +maintainer-clean-am: maintainer-clean-generic distclean-am + @echo "This command is intended for maintainers to use;" + @echo "it deletes files that may require special tools to rebuild." + +maintainer-clean: maintainer-clean-am + +.PHONY: tags distdir info-am info dvi-am dvi check check-am \ +installcheck-am installcheck install-exec-am install-exec \ +install-data-am install-data install-am install uninstall-am uninstall \ +all-redirect all-am all installdirs mostlyclean-generic \ +distclean-generic clean-generic maintainer-clean-generic clean \ +mostlyclean distclean maintainer-clean + + +all: mo-files + +mo-files: $(FILES_MO) + +install: + $(MAKE) all + for f in *.mo ; do mkdir -p \ + $(INSTALL_PREFIX)$(LOCALEDIR)/`basename $$f .mo`/LC_MESSAGES ; \ + cp $$f $(INSTALL_PREFIX)$(LOCALEDIR)/`basename $$f .mo`/LC_MESSAGES/$(PROG).mo ; done + +%.mo: %.po + $(MSGFMT) -f -o $@ $< + +clean: + $(RM) $(FILES_MO) + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/elauncher/locale/hu.po b/elauncher/locale/hu.po new file mode 100644 index 0000000..9171026 --- /dev/null +++ b/elauncher/locale/hu.po @@ -0,0 +1,177 @@ +msgid "" +msgstr "" +"Project-Id-Version: \n" +"POT-Creation-Date: \n" +"PO-Revision-Date: 2005-02-10 15:13+0100\n" +"Last-Translator: Nemeth Otto \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: elauncher.cpp:46 +msgid "&Ok" +msgstr "&Ok" + +#: elauncher.cpp:65 +msgid "Error" +msgstr "Hiba" + +#: elauncher.cpp:69 +#: elauncher.cpp:411 +msgid "&OK" +msgstr "&OK" + +#: elauncher.cpp:104 +msgid "Program not found:" +msgstr "Nem található:" + +#: elauncher.cpp:105 +msgid "Perhaps it is not installed properly. Check your $PATH value." +msgstr "Talán nincs telepítve megfelelően. Ellenőrizd a $PATH változót." + +#: elauncher.cpp:108 +msgid "File is not executable:" +msgstr "A fájl nem futtatható:" + +#: elauncher.cpp:115 +#, c-format +msgid "Elauncher: child's exited normally with status %d\n" +msgstr "Elauncher: a gyerek folyamat sikeresen végrehajtódott %d kóddal\n" + +#: elauncher.cpp:130 +msgid "Standard output" +msgstr "Sztandard kimenet" + +#: elauncher.cpp:139 +msgid "Standard error output" +msgstr "Sztandard hiba kimenet" + +#: elauncher.cpp:203 +#, c-format +msgid "Elauncher: fork() failed!" +msgstr "Elauncher: fork() sikertelen!" + +#: elauncher.cpp:235 +#, c-format +msgid "Elauncher: waitpid failed\n" +msgstr "Elauncher: waitpid sikertelen\n" + +#: elauncher.cpp:245 +#, c-format +msgid "Elauncher: %s: child died unexpectedly!\n" +msgstr "Elauncher: %s: gyerek folyamat váratlanul leállt!\n" + +#: elauncher.cpp:296 +#, c-format +msgid "" +"Unknown file type:\n" +"\t%s\n" +"To open this file in 'appname' please use\n" +" 'appname %s'" +msgstr "" +"Ismeretlen fájl típus:\n" +"\t%s\n" +"A megnyitáshoz ezt használd:\n" +" 'appname %s'" + +#: elauncher.cpp:334 +#, c-format +msgid "You have requested to execute program %s via Elauncher. However, secure mode was enabled. Execution has been prevented." +msgstr "%s program futását kezdeményezted az Elauncher segítségével. A biztonsági mód engedélyezve van, igy a folyamat futtatására nem került sor." + +#: elauncher.cpp:386 +msgid "Executables (*.*), *, All files (*.*), *" +msgstr "Futtatható fájlok (*.*), *, Összes fájl (*.*), *" + +#: elauncher.cpp:387 +msgid "File selection..." +msgstr "Fájl kiválasztása..." + +#: elauncher.cpp:395 +msgid "Open..." +msgstr "Megnyitás..." + +#: elauncher.cpp:398 +msgid "Open:" +msgstr "Cél:" + +#: elauncher.cpp:407 +msgid "Type the location you want to open or the name of the program you want to run. (Possible prefixes are: http:, ftp:, gg:, av:, leo:)" +msgstr "Írd be a megnyitni kívánt URL-t vagy programnevet. (Lehetőségek: http:, ftp:, gg:, av:, leo:)" + +#: elauncher.cpp:414 +msgid "&Cancel" +msgstr "Mégs&em" + +#: elauncher.cpp:417 +msgid "&Browse..." +msgstr "&Tallóz" + +#: elauncher.cpp:432 +#, c-format +msgid "program and URL opener for EDE.\n" +msgstr "EDE program és URL megnyitó.\n" + +#: elauncher.cpp:434 +#, c-format +msgid "" +"Licenced under terms of GNU General Public Licence v2.0 or newer.\n" +"\n" +msgstr "" +"Kibocsátva a GNU General Public Licence v2.0 vagy újabb szerint.\n" +"\n" + +#: elauncher.cpp:435 +#, c-format +msgid "Usage:\n" +msgstr "Használat:\n" + +#: elauncher.cpp:439 +#, c-format +msgid "" +"\tParse URL in form protocol:address and open in appropriate program.\n" +"\tURLs with protocol 'file' are opened based on their MIME type.\n" +msgstr "" + +#: elauncher.cpp:441 +#, c-format +msgid "" +"\tRun the program. If no path is given, look in $PATH. To give parameters\n" +"\tto program, use quotes e.g.:\n" +msgstr "" + +#: elauncher.cpp:443 +#, c-format +msgid "Options:\n" +msgstr "Opciók:\n" + +#: elauncher.cpp:445 +#, c-format +msgid "This help screen.\n" +msgstr "" + +#: elauncher.cpp:447 +#, c-format +msgid "Run as root. Dialog is opened to enter password.\n" +msgstr "Futtatás root -ként. Írd be a jelszót a dialógus ablakban.\n" + +#: elauncher.cpp:449 +#, c-format +msgid "Prevent running programs. Only URLs are allowed.\n" +msgstr "" + +#: elauncher.cpp:451 +#, c-format +msgid "" +"Open in default terminal app.\n" +"\n" +msgstr "" +"Megnyitás az alapértelmezett terminállal.\n" +"\n" + +#: elauncher.cpp:482 +#, c-format +msgid "Elauncher: Wrong number of parameters...\n" +msgstr "Elauncher: Nem megfelelő számú paraméter...\n" + diff --git a/elauncher/locale/id.po b/elauncher/locale/id.po new file mode 100644 index 0000000..caf6533 --- /dev/null +++ b/elauncher/locale/id.po @@ -0,0 +1,179 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR Free Software Foundation, Inc. +# FIRST AUTHOR , YEAR. +# +msgid "" +msgstr "" +"Project-Id-Version: erun\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2005-02-04 12:22+0100\n" +"PO-Revision-Date: 2002-11-29 15:39+0700\n" +"Last-Translator: Bambang Purnomosidi D. P. \n" +"Language-Team: id \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=iso-8859-2\n" +"Content-Transfer-Encoding: 8bit\n" + +#: elauncher.cpp:46 +#, fuzzy +msgid "&Ok" +msgstr "&OK" + +#: elauncher.cpp:65 +msgid "Error" +msgstr "" + +#: elauncher.cpp:69 elauncher.cpp:411 +msgid "&OK" +msgstr "&OK" + +#: elauncher.cpp:104 +msgid "Program not found:" +msgstr "" + +#: elauncher.cpp:105 +msgid "Perhaps it is not installed properly. Check your $PATH value." +msgstr "" + +#: elauncher.cpp:108 +msgid "File is not executable:" +msgstr "" + +#: elauncher.cpp:115 +#, c-format +msgid "Elauncher: child's exited normally with status %d\n" +msgstr "" + +#: elauncher.cpp:130 +msgid "Standard output" +msgstr "" + +#: elauncher.cpp:139 +msgid "Standard error output" +msgstr "" + +#: elauncher.cpp:203 +#, c-format +msgid "Elauncher: fork() failed!" +msgstr "" + +#: elauncher.cpp:235 +#, c-format +msgid "Elauncher: waitpid failed\n" +msgstr "" + +#: elauncher.cpp:245 +#, c-format +msgid "Elauncher: %s: child died unexpectedly!\n" +msgstr "" + +#: elauncher.cpp:296 +#, c-format +msgid "" +"Unknown file type:\n" +"\t%s\n" +"To open this file in 'appname' please use\n" +" 'appname %s'" +msgstr "" + +#: elauncher.cpp:334 +#, c-format +msgid "" +"You have requested to execute program %s via Elauncher. However, secure mode " +"was enabled. Execution has been prevented." +msgstr "" + +#: elauncher.cpp:386 +msgid "Executables (*.*), *, All files (*.*), *" +msgstr "Dapat dieksekusi (*.*), *, Semua file (*.*), *" + +#: elauncher.cpp:387 +msgid "File selection..." +msgstr "Pemilihan file..." + +#: elauncher.cpp:395 +msgid "Open..." +msgstr "Buka..." + +#: elauncher.cpp:398 +msgid "Open:" +msgstr "Buka:" + +#: elauncher.cpp:407 +msgid "" +"Type the location you want to open or the name of the program you want to " +"run. (Possible prefixes are: http:, ftp:, gg:, av:, leo:)" +msgstr "" +"Ketikkan lokasi yang ingin anda buka atau nama dari program yang ingin anda " +"jalankan. (Prefiks yang diijinkan adalah: http:, ftp:, gg:, av:, leo:)" + +#: elauncher.cpp:414 +msgid "&Cancel" +msgstr "&Batal" + +#: elauncher.cpp:417 +msgid "&Browse..." +msgstr "&Browse..." + +#: elauncher.cpp:432 +#, c-format +msgid "program and URL opener for EDE.\n" +msgstr "" + +#: elauncher.cpp:434 +#, c-format +msgid "" +"Licenced under terms of GNU General Public Licence v2.0 or newer.\n" +"\n" +msgstr "" + +#: elauncher.cpp:435 +#, c-format +msgid "Usage:\n" +msgstr "" + +#: elauncher.cpp:439 +#, c-format +msgid "" +"\tParse URL in form protocol:address and open in appropriate program.\n" +"\tURLs with protocol 'file' are opened based on their MIME type.\n" +msgstr "" + +#: elauncher.cpp:441 +#, c-format +msgid "" +"\tRun the program. If no path is given, look in $PATH. To give parameters\n" +"\tto program, use quotes e.g.:\n" +msgstr "" + +#: elauncher.cpp:443 +#, c-format +msgid "Options:\n" +msgstr "" + +#: elauncher.cpp:445 +#, c-format +msgid "This help screen.\n" +msgstr "" + +#: elauncher.cpp:447 +#, c-format +msgid "Run as root. Dialog is opened to enter password.\n" +msgstr "" + +#: elauncher.cpp:449 +#, c-format +msgid "Prevent running programs. Only URLs are allowed.\n" +msgstr "" + +#: elauncher.cpp:451 +#, c-format +msgid "" +"Open in default terminal app.\n" +"\n" +msgstr "" + +#: elauncher.cpp:482 +#, c-format +msgid "Elauncher: Wrong number of parameters...\n" +msgstr "" diff --git a/elauncher/locale/messages.pot b/elauncher/locale/messages.pot new file mode 100644 index 0000000..7264bdd --- /dev/null +++ b/elauncher/locale/messages.pot @@ -0,0 +1,178 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2005-02-04 12:22+0100\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=CHARSET\n" +"Content-Transfer-Encoding: 8bit\n" + +#: elauncher.cpp:46 +msgid "&Ok" +msgstr "" + +#: elauncher.cpp:65 +msgid "Error" +msgstr "" + +#: elauncher.cpp:69 elauncher.cpp:411 +msgid "&OK" +msgstr "" + +#: elauncher.cpp:104 +msgid "Program not found:" +msgstr "" + +#: elauncher.cpp:105 +msgid "Perhaps it is not installed properly. Check your $PATH value." +msgstr "" + +#: elauncher.cpp:108 +msgid "File is not executable:" +msgstr "" + +#: elauncher.cpp:115 +#, c-format +msgid "Elauncher: child's exited normally with status %d\n" +msgstr "" + +#: elauncher.cpp:130 +msgid "Standard output" +msgstr "" + +#: elauncher.cpp:139 +msgid "Standard error output" +msgstr "" + +#: elauncher.cpp:203 +#, c-format +msgid "Elauncher: fork() failed!" +msgstr "" + +#: elauncher.cpp:235 +#, c-format +msgid "Elauncher: waitpid failed\n" +msgstr "" + +#: elauncher.cpp:245 +#, c-format +msgid "Elauncher: %s: child died unexpectedly!\n" +msgstr "" + +#: elauncher.cpp:296 +#, c-format +msgid "" +"Unknown file type:\n" +"\t%s\n" +"To open this file in 'appname' please use\n" +" 'appname %s'" +msgstr "" + +#: elauncher.cpp:334 +#, c-format +msgid "" +"You have requested to execute program %s via Elauncher. However, secure mode " +"was enabled. Execution has been prevented." +msgstr "" + +#: elauncher.cpp:386 +msgid "Executables (*.*), *, All files (*.*), *" +msgstr "" + +#: elauncher.cpp:387 +msgid "File selection..." +msgstr "" + +#: elauncher.cpp:395 +msgid "Open..." +msgstr "" + +#: elauncher.cpp:398 +msgid "Open:" +msgstr "" + +#: elauncher.cpp:407 +msgid "" +"Type the location you want to open or the name of the program you want to " +"run. (Possible prefixes are: http:, ftp:, gg:, av:, leo:)" +msgstr "" + +#: elauncher.cpp:414 +msgid "&Cancel" +msgstr "" + +#: elauncher.cpp:417 +msgid "&Browse..." +msgstr "" + +#: elauncher.cpp:432 +#, c-format +msgid "program and URL opener for EDE.\n" +msgstr "" + +#: elauncher.cpp:434 +#, c-format +msgid "" +"Licenced under terms of GNU General Public Licence v2.0 or newer.\n" +"\n" +msgstr "" + +#: elauncher.cpp:435 +#, c-format +msgid "Usage:\n" +msgstr "" + +#: elauncher.cpp:439 +#, c-format +msgid "" +"\tParse URL in form protocol:address and open in appropriate program.\n" +"\tURLs with protocol 'file' are opened based on their MIME type.\n" +msgstr "" + +#: elauncher.cpp:441 +#, c-format +msgid "" +"\tRun the program. If no path is given, look in $PATH. To give parameters\n" +"\tto program, use quotes e.g.:\n" +msgstr "" + +#: elauncher.cpp:443 +#, c-format +msgid "Options:\n" +msgstr "" + +#: elauncher.cpp:445 +#, c-format +msgid "This help screen.\n" +msgstr "" + +#: elauncher.cpp:447 +#, c-format +msgid "Run as root. Dialog is opened to enter password.\n" +msgstr "" + +#: elauncher.cpp:449 +#, c-format +msgid "Prevent running programs. Only URLs are allowed.\n" +msgstr "" + +#: elauncher.cpp:451 +#, c-format +msgid "" +"Open in default terminal app.\n" +"\n" +msgstr "" + +#: elauncher.cpp:482 +#, c-format +msgid "Elauncher: Wrong number of parameters...\n" +msgstr "" diff --git a/elauncher/locale/ru.po b/elauncher/locale/ru.po new file mode 100644 index 0000000..5be1f02 --- /dev/null +++ b/elauncher/locale/ru.po @@ -0,0 +1,180 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR Free Software Foundation, Inc. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2005-02-04 12:22+0100\n" +"PO-Revision-Date: 2002-11-28 HO:MI+ZONE\n" +"Last-Translator: aabbvv \n" +"Language-Team: RUSSIAN \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=koi8-r\n" +"Content-Transfer-Encoding: 8bit\n" + +#: elauncher.cpp:46 +#, fuzzy +msgid "&Ok" +msgstr "&OK" + +#: elauncher.cpp:65 +msgid "Error" +msgstr "" + +#: elauncher.cpp:69 elauncher.cpp:411 +msgid "&OK" +msgstr "&OK" + +#: elauncher.cpp:104 +msgid "Program not found:" +msgstr "" + +#: elauncher.cpp:105 +msgid "Perhaps it is not installed properly. Check your $PATH value." +msgstr "" + +#: elauncher.cpp:108 +msgid "File is not executable:" +msgstr "" + +#: elauncher.cpp:115 +#, c-format +msgid "Elauncher: child's exited normally with status %d\n" +msgstr "" + +#: elauncher.cpp:130 +msgid "Standard output" +msgstr "" + +#: elauncher.cpp:139 +msgid "Standard error output" +msgstr "" + +#: elauncher.cpp:203 +#, c-format +msgid "Elauncher: fork() failed!" +msgstr "" + +#: elauncher.cpp:235 +#, c-format +msgid "Elauncher: waitpid failed\n" +msgstr "" + +#: elauncher.cpp:245 +#, c-format +msgid "Elauncher: %s: child died unexpectedly!\n" +msgstr "" + +#: elauncher.cpp:296 +#, c-format +msgid "" +"Unknown file type:\n" +"\t%s\n" +"To open this file in 'appname' please use\n" +" 'appname %s'" +msgstr "" + +#: elauncher.cpp:334 +#, c-format +msgid "" +"You have requested to execute program %s via Elauncher. However, secure mode " +"was enabled. Execution has been prevented." +msgstr "" + +#: elauncher.cpp:386 +msgid "Executables (*.*), *, All files (*.*), *" +msgstr " (*.*), *, (*.*), *" + +#: elauncher.cpp:387 +msgid "File selection..." +msgstr " ..." + +#: elauncher.cpp:395 +msgid "Open..." +msgstr "..." + +#: elauncher.cpp:398 +msgid "Open:" +msgstr ":" + +#: elauncher.cpp:407 +msgid "" +"Type the location you want to open or the name of the program you want to " +"run. (Possible prefixes are: http:, ftp:, gg:, av:, leo:)" +msgstr "" +" .( : " +"http:, ftp:, gg:, av:, leo:)" + +#: elauncher.cpp:414 +msgid "&Cancel" +msgstr "" + +#: elauncher.cpp:417 +msgid "&Browse..." +msgstr "..." + +#: elauncher.cpp:432 +#, c-format +msgid "program and URL opener for EDE.\n" +msgstr "" + +#: elauncher.cpp:434 +#, c-format +msgid "" +"Licenced under terms of GNU General Public Licence v2.0 or newer.\n" +"\n" +msgstr "" + +#: elauncher.cpp:435 +#, c-format +msgid "Usage:\n" +msgstr "" + +#: elauncher.cpp:439 +#, c-format +msgid "" +"\tParse URL in form protocol:address and open in appropriate program.\n" +"\tURLs with protocol 'file' are opened based on their MIME type.\n" +msgstr "" + +#: elauncher.cpp:441 +#, c-format +msgid "" +"\tRun the program. If no path is given, look in $PATH. To give parameters\n" +"\tto program, use quotes e.g.:\n" +msgstr "" + +#: elauncher.cpp:443 +#, c-format +msgid "Options:\n" +msgstr "" + +#: elauncher.cpp:445 +#, c-format +msgid "This help screen.\n" +msgstr "" + +#: elauncher.cpp:447 +#, c-format +msgid "Run as root. Dialog is opened to enter password.\n" +msgstr "" + +#: elauncher.cpp:449 +#, c-format +msgid "Prevent running programs. Only URLs are allowed.\n" +msgstr "" + +#: elauncher.cpp:451 +#, c-format +msgid "" +"Open in default terminal app.\n" +"\n" +msgstr "" + +#: elauncher.cpp:482 +#, c-format +msgid "Elauncher: Wrong number of parameters...\n" +msgstr "" diff --git a/elauncher/locale/sk.po b/elauncher/locale/sk.po new file mode 100644 index 0000000..3e9659c --- /dev/null +++ b/elauncher/locale/sk.po @@ -0,0 +1,179 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR Free Software Foundation, Inc. +# FIRST AUTHOR , YEAR. +# +msgid "" +msgstr "" +"Project-Id-Version: erun 1.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2005-02-04 12:22+0100\n" +"PO-Revision-Date: 2002-04-21 14:50+0200\n" +"Last-Translator: Martin Pekar \n" +"Language-Team: Slovak \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: elauncher.cpp:46 +#, fuzzy +msgid "&Ok" +msgstr "&OK" + +#: elauncher.cpp:65 +msgid "Error" +msgstr "" + +#: elauncher.cpp:69 elauncher.cpp:411 +msgid "&OK" +msgstr "&OK" + +#: elauncher.cpp:104 +msgid "Program not found:" +msgstr "" + +#: elauncher.cpp:105 +msgid "Perhaps it is not installed properly. Check your $PATH value." +msgstr "" + +#: elauncher.cpp:108 +msgid "File is not executable:" +msgstr "" + +#: elauncher.cpp:115 +#, c-format +msgid "Elauncher: child's exited normally with status %d\n" +msgstr "" + +#: elauncher.cpp:130 +msgid "Standard output" +msgstr "" + +#: elauncher.cpp:139 +msgid "Standard error output" +msgstr "" + +#: elauncher.cpp:203 +#, c-format +msgid "Elauncher: fork() failed!" +msgstr "" + +#: elauncher.cpp:235 +#, c-format +msgid "Elauncher: waitpid failed\n" +msgstr "" + +#: elauncher.cpp:245 +#, c-format +msgid "Elauncher: %s: child died unexpectedly!\n" +msgstr "" + +#: elauncher.cpp:296 +#, c-format +msgid "" +"Unknown file type:\n" +"\t%s\n" +"To open this file in 'appname' please use\n" +" 'appname %s'" +msgstr "" + +#: elauncher.cpp:334 +#, c-format +msgid "" +"You have requested to execute program %s via Elauncher. However, secure mode " +"was enabled. Execution has been prevented." +msgstr "" + +#: elauncher.cpp:386 +msgid "Executables (*.*), *, All files (*.*), *" +msgstr "Spustiteľné (*.*), *, Všetky súbory (*.*), *" + +#: elauncher.cpp:387 +msgid "File selection..." +msgstr "Výber súboru..." + +#: elauncher.cpp:395 +msgid "Open..." +msgstr "Otvoriť..." + +#: elauncher.cpp:398 +msgid "Open:" +msgstr "Otvoriť:" + +#: elauncher.cpp:407 +msgid "" +"Type the location you want to open or the name of the program you want to " +"run. (Possible prefixes are: http:, ftp:, gg:, av:, leo:)" +msgstr "" +"Napíšte umiestnenie, ktoré chcete otvoriť alebo názov programu, ktorý chcete " +"spustiť. (Možné predpony sú: http:, ftp:, gg:, av:, leo:)" + +#: elauncher.cpp:414 +msgid "&Cancel" +msgstr "&Zrušiť" + +#: elauncher.cpp:417 +msgid "&Browse..." +msgstr "&Zvoliť..." + +#: elauncher.cpp:432 +#, c-format +msgid "program and URL opener for EDE.\n" +msgstr "" + +#: elauncher.cpp:434 +#, c-format +msgid "" +"Licenced under terms of GNU General Public Licence v2.0 or newer.\n" +"\n" +msgstr "" + +#: elauncher.cpp:435 +#, c-format +msgid "Usage:\n" +msgstr "" + +#: elauncher.cpp:439 +#, c-format +msgid "" +"\tParse URL in form protocol:address and open in appropriate program.\n" +"\tURLs with protocol 'file' are opened based on their MIME type.\n" +msgstr "" + +#: elauncher.cpp:441 +#, c-format +msgid "" +"\tRun the program. If no path is given, look in $PATH. To give parameters\n" +"\tto program, use quotes e.g.:\n" +msgstr "" + +#: elauncher.cpp:443 +#, c-format +msgid "Options:\n" +msgstr "" + +#: elauncher.cpp:445 +#, c-format +msgid "This help screen.\n" +msgstr "" + +#: elauncher.cpp:447 +#, c-format +msgid "Run as root. Dialog is opened to enter password.\n" +msgstr "" + +#: elauncher.cpp:449 +#, c-format +msgid "Prevent running programs. Only URLs are allowed.\n" +msgstr "" + +#: elauncher.cpp:451 +#, c-format +msgid "" +"Open in default terminal app.\n" +"\n" +msgstr "" + +#: elauncher.cpp:482 +#, c-format +msgid "Elauncher: Wrong number of parameters...\n" +msgstr "" diff --git a/elauncher/locale/sr.po b/elauncher/locale/sr.po new file mode 100644 index 0000000..6f9aa5b --- /dev/null +++ b/elauncher/locale/sr.po @@ -0,0 +1,179 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR Free Software Foundation, Inc. +# FIRST AUTHOR , YEAR. +# +msgid "" +msgstr "" +"Project-Id-Version: erun 1.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2005-02-04 12:22+0100\n" +"PO-Revision-Date: 2002-11-30 02:06+0100\n" +"Last-Translator: Dejan Lekic \n" +"Language-Team: LINUKS.org T.T. \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: elauncher.cpp:46 +#, fuzzy +msgid "&Ok" +msgstr "&ОК" + +#: elauncher.cpp:65 +msgid "Error" +msgstr "" + +#: elauncher.cpp:69 elauncher.cpp:411 +msgid "&OK" +msgstr "&ОК" + +#: elauncher.cpp:104 +msgid "Program not found:" +msgstr "" + +#: elauncher.cpp:105 +msgid "Perhaps it is not installed properly. Check your $PATH value." +msgstr "" + +#: elauncher.cpp:108 +msgid "File is not executable:" +msgstr "" + +#: elauncher.cpp:115 +#, c-format +msgid "Elauncher: child's exited normally with status %d\n" +msgstr "" + +#: elauncher.cpp:130 +msgid "Standard output" +msgstr "" + +#: elauncher.cpp:139 +msgid "Standard error output" +msgstr "" + +#: elauncher.cpp:203 +#, c-format +msgid "Elauncher: fork() failed!" +msgstr "" + +#: elauncher.cpp:235 +#, c-format +msgid "Elauncher: waitpid failed\n" +msgstr "" + +#: elauncher.cpp:245 +#, c-format +msgid "Elauncher: %s: child died unexpectedly!\n" +msgstr "" + +#: elauncher.cpp:296 +#, c-format +msgid "" +"Unknown file type:\n" +"\t%s\n" +"To open this file in 'appname' please use\n" +" 'appname %s'" +msgstr "" + +#: elauncher.cpp:334 +#, c-format +msgid "" +"You have requested to execute program %s via Elauncher. However, secure mode " +"was enabled. Execution has been prevented." +msgstr "" + +#: elauncher.cpp:386 +msgid "Executables (*.*), *, All files (*.*), *" +msgstr "Извршни фајлови (*.*), *, Сви фајлови (*.*), *" + +#: elauncher.cpp:387 +msgid "File selection..." +msgstr "Селектовање фајла..." + +#: elauncher.cpp:395 +msgid "Open..." +msgstr "Отвори..." + +#: elauncher.cpp:398 +msgid "Open:" +msgstr "Отвори:" + +#: elauncher.cpp:407 +msgid "" +"Type the location you want to open or the name of the program you want to " +"run. (Possible prefixes are: http:, ftp:, gg:, av:, leo:)" +msgstr "" +"Унесите локацију коју желите да отворите или име програма који желите да " +"стартујете. (Могући префикси су: http:, ftp:, gg:, av:, leo: )" + +#: elauncher.cpp:414 +msgid "&Cancel" +msgstr "&Одустани" + +#: elauncher.cpp:417 +msgid "&Browse..." +msgstr "&Нађи..." + +#: elauncher.cpp:432 +#, c-format +msgid "program and URL opener for EDE.\n" +msgstr "" + +#: elauncher.cpp:434 +#, c-format +msgid "" +"Licenced under terms of GNU General Public Licence v2.0 or newer.\n" +"\n" +msgstr "" + +#: elauncher.cpp:435 +#, c-format +msgid "Usage:\n" +msgstr "" + +#: elauncher.cpp:439 +#, c-format +msgid "" +"\tParse URL in form protocol:address and open in appropriate program.\n" +"\tURLs with protocol 'file' are opened based on their MIME type.\n" +msgstr "" + +#: elauncher.cpp:441 +#, c-format +msgid "" +"\tRun the program. If no path is given, look in $PATH. To give parameters\n" +"\tto program, use quotes e.g.:\n" +msgstr "" + +#: elauncher.cpp:443 +#, c-format +msgid "Options:\n" +msgstr "" + +#: elauncher.cpp:445 +#, c-format +msgid "This help screen.\n" +msgstr "" + +#: elauncher.cpp:447 +#, c-format +msgid "Run as root. Dialog is opened to enter password.\n" +msgstr "" + +#: elauncher.cpp:449 +#, c-format +msgid "Prevent running programs. Only URLs are allowed.\n" +msgstr "" + +#: elauncher.cpp:451 +#, c-format +msgid "" +"Open in default terminal app.\n" +"\n" +msgstr "" + +#: elauncher.cpp:482 +#, c-format +msgid "Elauncher: Wrong number of parameters...\n" +msgstr "" diff --git a/emenueditor/Jamfile b/emenueditor/Jamfile new file mode 100644 index 0000000..f63fd6a --- /dev/null +++ b/emenueditor/Jamfile @@ -0,0 +1,14 @@ +# +# $Id$ +# +# Part of Equinox Desktop Environment (EDE). +# Copyright (c) 2000-2007 EDE Authors. +# +# This program is licenced under terms of the +# GNU General Public Licence version 2 or newer. +# See COPYING for details. + +SubDir TOP emenueditor ; + +MakeEfltkProgram emenueditor : emenueditor.cpp ; +ExtractStrings locale : emenueditor.cpp ; diff --git a/emenueditor/Makefile b/emenueditor/Makefile new file mode 100644 index 0000000..f831b78 --- /dev/null +++ b/emenueditor/Makefile @@ -0,0 +1,22 @@ + +CPPFILES = emenueditor.cpp +TARGET = emenueditor + +POFILES = locale/ru.po\ + locale/sr.po\ + locale/sk.po\ + locale/hu.po\ + +include ../makeinclude + +install: + $(INSTALL_PROGRAM) $(TARGET) $(bindir) + $(INSTALL_LOCALE) + +uninstall: + $(RM) $(bindir)/$(TARGET) + +clean: + $(RM) $(TARGET) + $(RM) *.o + diff --git a/emenueditor/emenueditor.cpp b/emenueditor/emenueditor.cpp new file mode 100644 index 0000000..eff8143 --- /dev/null +++ b/emenueditor/emenueditor.cpp @@ -0,0 +1,395 @@ +// Copyright (c) 2000. - 2005. EDE Authors +// This program is licenced under terms of the +// GNU General Public Licence version 2 or newer. +// See COPYING for details. + +#include +#include +#include +#include + +#include "icons/up.xpm" +#include "icons/folder.xpm" +#include "icons/item.xpm" + +#include "emenueditor.h" + +static Fl_Image item_pix = *Fl_Image::read_xpm(0, (const char**)item_xpm); +static Fl_Image folder_pix = *Fl_Image::read_xpm(0, (const char**)folder_xpm); + +Fl_Window *edit_window = 0; +Fl_FileBrowser *programs_browser; +Fl_Input *filename_field, *name_field, *command_field, *icon_field; +int selected, submenu_selected = 0; +Fl_Input *filename_field_e, *name_field_e, *command_field_e,*icon_field_e; + +void cb_change_dir(Fl_Widget *, void*); +void cb_directory_up(Fl_Button *, void*); +void cb_new_submenu(Fl_Button *, void*); +void cb_delete_submenu(Fl_Button *, void*); +void cb_new_item(Fl_Button *, void*); +void cb_delete_item(Fl_Button *, void*); +void cb_edit_item(Fl_Button *, void*); +void cb_about_menu_editor(Fl_Widget*, void*); +void cbCloseWindow(Fl_Widget*, Fl_Window*); +void Exit_Editor(Fl_Widget*, void*); +int SomethingInDir(char *); + +void cb_browse(Fl_Widget *, Fl_Input *input) +{ + char *file_types = _("Executables (*.*), *, All files (*.*), *"); + const char *f = fl_select_file(input->value(), file_types, _("File selection ...")); + if (f) input->value(f); +} + + +int main(int argc, char **argv) +{ + Fl_String m_programsdir = fl_homedir() + "/.ede/programs"; + fl_init_locale_support("emenueditor", PREFIX"/share/locale"); + fl_init_images_lib(); + + Fl_Main_Window *menu_edit_window = new Fl_Main_Window(480, 370, _("Menu editor")); + + Fl_Menu_Bar *menubar = new Fl_Menu_Bar(0, 0, 480, 25); + menubar->begin(); + Fl_Item_Group *file = new Fl_Item_Group(_("&File")); + Fl_Item *quit_item = new Fl_Item(_("&Quit")); + quit_item->shortcut(0x40071); + quit_item->x_offset(18); + quit_item->callback(Exit_Editor, menu_edit_window); + + file->end(); + menubar->end(); + + programs_browser = new Fl_FileBrowser(5, 40, 275, 313, _("Programs:")); + programs_browser->align(FL_ALIGN_TOP | FL_ALIGN_LEFT); + programs_browser->tooltip(_("Click on the submenu or on the item you want")); + programs_browser->callback(cb_change_dir); + programs_browser->end(); + programs_browser->directory(m_programsdir); + + Fl_Button *new_submenu = new Fl_Button(315, 50, 125, 23, _("New submenu")); + new_submenu->callback( (Fl_Callback*) cb_new_submenu ); + + Fl_Button *del_submenu = new Fl_Button(315, 80, 125, 23, _("Delete submenu")); + del_submenu->callback( (Fl_Callback*) cb_delete_submenu ); + + Fl_Button *new_item = new Fl_Button(315, 125, 125, 23, _("New item")); + new_item->callback( (Fl_Callback*) cb_new_item ); + + Fl_Button *del_item = new Fl_Button(315, 185, 125, 23, _("Delete item")); + del_item->callback( (Fl_Callback*) cb_delete_item ); + + Fl_Button *edit_item = new Fl_Button(315, 155, 125, 23, _("Edit Item")); + edit_item->callback( (Fl_Callback*) cb_edit_item ); + + menu_edit_window->menu(menubar); + menu_edit_window->resizable(menu_edit_window); + menu_edit_window->end(); + menu_edit_window->show(); + + Fl::run(); + + if(edit_window) + delete edit_window; + + return 0; +} + + +char* get_localized_name(char *cfg) +{ + char *icon_name = 0; + Fl_Config iconConfig(cfg); + iconConfig.set_section("Desktop Entry"); + + char *alocale = strdup(setlocale(LC_ALL, NULL)); + char *tmp = strrchr(alocale, '_'); + if(tmp) + { + *tmp = '\0'; + } + char localName[1024]; + snprintf(localName, sizeof(localName)-1, "Name[%s]", alocale); + iconConfig.read((const char *)localName, icon_name); + delete [] alocale; + + if (!icon_name) + { + iconConfig.read("Name", icon_name, "None"); + } + + return icon_name; + +} + +char* get_localized_string() +{ + char *localname = 0; + char *alocale = strdup(setlocale(LC_MESSAGES, NULL)); +// -- language_country is perfectly valid according to FD.o +/* char *tmp = strrchr(alocale, '_'); + if(tmp) + { + *tmp = '\0'; + } */ + localname = fl_strdup_printf("Name[%s]", alocale); + delete [] alocale; + + if (!localname) localname = strdup("Name"); + return localname; +} + + +void cb_save_item_e(Fl_Widget *, Fl_Window *w) +{ + Fl_String item; + Fl_String dir = programs_browser->directory(); + + Fl_String name = name_field_e->value(); + if (name.empty()) + { + fl_alert(_("Please, enter the name of the menu item.")); + return; + } + + Fl_String filename = filename_field_e->value(); + if (!filename.empty()) + item = filename; + else + item = name + ".desktop"; + + Fl_String path_and_item = dir + slash + item; + char *lname = get_localized_string(); + + Fl_Config flconfig(path_and_item); + flconfig.set_section("Desktop Entry"); + flconfig.write(lname, name_field_e->value()); + flconfig.write("Name", name_field_e->value()); // fallback + flconfig.write("Exec", command_field_e->value()); + flconfig.write("Icon", fl_file_filename(icon_field_e->value())); + + delete [] lname; + + programs_browser->directory(dir); + programs_browser->relayout(); + w->hide(); +} + + +void cb_browse_icon(Fl_Widget *, Fl_Input *input) +{ + char *file_types = _("Icons (*.png), *.png, All files (*.*), *"); + const char *f = fl_select_file(PREFIX"/share/ede/icons/16x16", file_types, _("Choose icon file...")); + if (f) + { + input->value(f); + } +} + + +void Menu_Edit_Dialog(int edit) +{ + if(!edit_window) + { + edit_window = new Fl_Window(370, 250, _("Edit item")); + + filename_field_e = new Fl_Output(5, 25, 195, 23, _("Filename:")); + filename_field_e->align(FL_ALIGN_TOP | FL_ALIGN_LEFT); + + name_field_e = new Fl_Input(5, 80, 195, 23, _("Name in the menu:")); + name_field_e->align(FL_ALIGN_TOP | FL_ALIGN_LEFT); + + command_field_e = new Fl_Input(5, 125, 195, 23, _("Command to execute:")); + command_field_e->align(FL_ALIGN_TOP | FL_ALIGN_LEFT); + + { + Fl_Button *browse_button_c = new Fl_Button(210, 125, 80, 23, _("Bro&wse...")); + browse_button_c->callback( (Fl_Callback*) cb_browse, command_field_e ); + } + + icon_field_e = new Fl_Input(5, 215, 195, 23, _("Icon filename:")); + icon_field_e->align(FL_ALIGN_TOP | FL_ALIGN_LEFT); + + { + Fl_Button *save_button = new Fl_Button(285, 25, 80, 23, _("&Save")); + save_button->callback( (Fl_Callback*) cb_save_item_e, edit_window ); + } + { + Fl_Button *cancel_button = new Fl_Button(285, 60, 80, 23, _("&Cancel")); + cancel_button->callback( (Fl_Callback*) cbCloseWindow, edit_window ); + } + { + Fl_Button *browse_button_i = new Fl_Button(210, 215, 80, 23, _("&Browse...")); + browse_button_i->callback( (Fl_Callback*) cb_browse_icon, icon_field_e ); + } + } + + filename_field_e->value(""); + command_field_e->value("xterm"); + name_field_e->value(_("New folder")); + icon_field_e->value("item.png"); + + if (edit) + { + Fl_String c_file = programs_browser->filename_full(); + Fl_String name = programs_browser->filename(); + + if (!name.empty()) + { + char *this_value = 0; + filename_field_e->value(name); + + const char *tfield = filename_field_e->value(); + + Fl_Config flconfig(c_file); + flconfig.set_section("Desktop Entry"); + + this_value = get_localized_name(c_file); + if(!flconfig.error() && this_value) + { + name_field_e->value(this_value); + delete [] this_value; + } + flconfig.read("Exec", this_value); + if(!flconfig.error() && this_value) + { + command_field_e->value(this_value); + delete [] this_value; + } + flconfig.read("Icon", this_value); + if (!flconfig.error() && this_value) + { + icon_field_e->value(this_value); + delete [] this_value; + } + } + } + + edit_window->end(); + edit_window->exec(); +} + +void cb_new_submenu(Fl_Button *, void *) +{ + Fl_String m_progdir = programs_browser->directory(); + Fl_String m_submenu = fl_input(_("Please enter name of the new submenu:")); + + if (!m_submenu.empty()) + { + Fl_String path = m_progdir + slash + m_submenu; + if (mkdir(path, S_IRUSR | S_IWUSR | S_IXUSR)) + { + fl_alert(_("Cannot create submenu!")); + return; + } + } + programs_browser->directory(m_progdir); + programs_browser->relayout(); + programs_browser->redraw(); +} + +void cb_change_dir(Fl_Widget *w, void *) +{ + if(Fl::event_clicks() || Fl::event_key() == FL_Enter) { + Fl_String path_name(programs_browser->filename_full()); + + if(path_name.empty()) { + programs_browser->up(); + return; + } + + if(fl_is_dir(path_name)) { + + programs_browser->load(path_name); + programs_browser->redraw(); + + } else { + + Menu_Edit_Dialog(1); + + } + } +} + +void cb_directory_up(Fl_Button *, void *) +{ + programs_browser->up(); +} + +int SomethingInDir(char *path) +{ + dirent **files; + int numberOfFiles = 0; + + numberOfFiles = fl_filename_list(path, &files); + + if (numberOfFiles > 2) // . | .. | + + { + for (int i = 0; i < numberOfFiles; i ++) + { + free(files[i]); + } + free(files); + return numberOfFiles; + } + else + { + return 0; + } +} + +void cb_delete_submenu(Fl_Button *, void*) +{ + Fl_String submenu_path(programs_browser->filename_full()); + if (fl_file_exists(submenu_path) && fl_is_dir(submenu_path)) + { + if (SomethingInDir(submenu_path)) + { + fl_alert(_("You should delete all the items from the submenu, before you can delete it!")); + return; + } + rmdir(submenu_path); + programs_browser->directory(programs_browser->directory()); + programs_browser->redraw(); + } +} + +void cb_delete_item(Fl_Button *, void *) +{ + Fl_String submenu_path(programs_browser->filename_full()); + if(fl_file_exists(submenu_path) && !fl_is_dir(submenu_path)) + { + unlink(submenu_path); + programs_browser->directory(programs_browser->directory()); + programs_browser->redraw(); + } +} + +void cb_new_item(Fl_Button *, void *) +{ + Menu_Edit_Dialog(0); + programs_browser->redraw(); +} + +void cb_edit_item(Fl_Button *, void *) +{ + Fl_String submenu_path(programs_browser->filename_full()); + if(!fl_is_dir(submenu_path)) + { + Menu_Edit_Dialog(1); + programs_browser->redraw(); + } +} + +void cbCloseWindow(Fl_Widget *, Fl_Window *windowToClose) +{ + windowToClose->hide(); +} + +void Exit_Editor(Fl_Widget *w, void *d) +{ + Fl_Window *t = (Fl_Window*) d; + t->hide(); +} diff --git a/emenueditor/emenueditor.h b/emenueditor/emenueditor.h new file mode 100644 index 0000000..5a5bee6 --- /dev/null +++ b/emenueditor/emenueditor.h @@ -0,0 +1,46 @@ +// Copyright (c) 2000. - 2005. EDE Authors +// This program is licenced under terms of the +// GNU General Public Licence version 2 or newer. +// See COPYING for details. + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + diff --git a/emenueditor/icons/folder.xpm b/emenueditor/icons/folder.xpm new file mode 100644 index 0000000..b327440 --- /dev/null +++ b/emenueditor/icons/folder.xpm @@ -0,0 +1,155 @@ +/* XPM */ +static char * folder_xpm[] = { +"16 16 136 2", +" c None", +". c #469FFF", +"+ c #4193FF", +"@ c #4499FF", +"# c #2C63AC", +"$ c #4DA0FF", +"% c #B5D9FB", +"& c #AAD3FB", +"* c #ADD3FB", +"= c #89C4FF", +"- c #184888", +"; c #4495FF", +"> c #AED5FB", +", c #6DB3F9", +"' c #6FB2F9", +") c #6BAEF8", +"! c #67ABF6", +"~ c #549FF9", +"{ c #3E91FF", +"] c #ACD4FB", +"^ c #6BAEF9", +"/ c #6CAFF8", +"( c #66AAF7", +"_ c #5DA3F6", +": c #74AEF7", +"< c #9EC4F8", +"[ c #92BCF7", +"} c #8DB5F5", +"| c #88B1F3", +"1 c #83ABF2", +"2 c #80A8F0", +"3 c #87AEF5", +"4 c #0940B7", +"5 c #AAD2FB", +"6 c #67ACF8", +"7 c #68ABF8", +"8 c #61A4F7", +"9 c #5B9FF5", +"0 c #5399F3", +"a c #498FF1", +"b c #3F85EF", +"c c #367CEB", +"d c #2E73E8", +"e c #286BE6", +"f c #2164E2", +"g c #2163E5", +"h c #023AB6", +"i c #4394FF", +"j c #A7D0FA", +"k c #63A9F7", +"l c #61A7F7", +"m c #5BA0F6", +"n c #5499F4", +"o c #4B90F2", +"p c #4186EF", +"q c #377DEB", +"r c #2E73E7", +"s c #266AE5", +"t c #2062E2", +"u c #1C5DDF", +"v c #1A5CE2", +"w c #A4CEF9", +"x c #5DA5F7", +"y c #5DA1F6", +"z c #559AF4", +"A c #4C91F3", +"B c #4489F1", +"C c #3A7FED", +"D c #3075E9", +"E c #276BE5", +"F c #2062E1", +"G c #1B5CDE", +"H c #1758DB", +"I c #1857DE", +"J c #0239B6", +"K c #A1CBF9", +"L c #589FF6", +"M c #559BF5", +"N c #4F96F3", +"O c #478CF2", +"P c #3D84F0", +"Q c #3378EB", +"R c #2B6EE7", +"S c #2265E3", +"T c #1C5DDE", +"U c #1757DB", +"V c #1554DA", +"W c #1555DD", +"X c #0139B5", +"Y c #4696FF", +"Z c #FFFFFF", +"` c #FBFBFB", +" . c #F2F2F2", +".. c #E9E9E9", +"+. c #E0E0E0", +"@. c #D7D7D7", +"#. c #D4D4D4", +"$. c #A9A9A9", +"%. c #BABABA", +"&. c #9E9990", +"*. c #0A3DAF", +"=. c #FEFEFE", +"-. c #F8F8F8", +";. c #F1F1F1", +">. c #E8E8E8", +",. c #DCDCDC", +"'. c #D6D6D6", +"). c #D2D2D2", +"!. c #A7A7A7", +"~. c #B7B7B7", +"{. c #929292", +"]. c #BAB6AC", +"^. c #0E41B3", +"/. c #F0F0F0", +"(. c #E5E5E5", +"_. c #DDDDDD", +":. c #D3D3D3", +"<. c #D0D0D0", +"[. c #ABABAB", +"}. c #B5B5B5", +"|. c #939393", +"1. c #ADADAD", +"2. c #938E85", +"3. c #0A3DAE", +"4. c #FFFFFE", +"5. c #F4F4F4", +"6. c #EDEDED", +"7. c #DBDBDB", +"8. c #AEAEAE", +"9. c #969696", +"0. c #878787", +"a. c #AFABA1", +"b. c #0D40B2", +"c. c #0037B2", +"d. c #0034A8", +"e. c #0038B6", +" ", +" . + @ # ", +" $ % & * = - ", +"; > , ' ) ! ~ { + + + + + . ", +"; ] ^ / ( _ : < [ } | 1 2 3 4 ", +"; 5 6 7 8 9 0 a b c d e f g h ", +"i j k l m n o p q r s t u v h ", +"i w x y z A B C D E F G H I J ", +"i K L M N O P Q R S T U V W X ", +"Y Z Z Z Z ` ...+.@.#.$.%.&.*. ", +"Y Z Z =.-.;.>.,.'.).!.~.{.].^. ", +"Y Z =.-./.(._.:.<.[.}.|.1.2.3. ", +"Y 4.5.6.(.7.#.<.1.8.9.!.0.a.b. ", +" c.d.d.d.d.d.d.d.d.d.d.d.e. ", +" ", +" "}; diff --git a/emenueditor/icons/item.xpm b/emenueditor/icons/item.xpm new file mode 100644 index 0000000..6ea12eb --- /dev/null +++ b/emenueditor/icons/item.xpm @@ -0,0 +1,88 @@ +/* XPM */ +static char * item_xpm[] = { +"16 16 69 1", +" c None", +". c #C6C6D5", +"+ c #9494AD", +"@ c #FBFBFC", +"# c #F8F8FA", +"$ c #F4F4F7", +"% c #EEEEF2", +"& c #EAEAF0", +"* c #DEDEE7", +"= c #E0E0E9", +"- c #C1C8D5", +"; c #BEC5D3", +"> c #BBC1CF", +", c #B8BFCE", +"' c #AFB5C7", +") c #C9C9D7", +"! c #F5F5F8", +"~ c #F0F0F4", +"{ c #E4E4EB", +"] c #C0C7D4", +"^ c #BBC2D0", +"/ c #B9C0CE", +"( c #B3B9CA", +"_ c #DBDBE5", +": c #CDCDDA", +"< c #BFBFD0", +"[ c #F7F7F9", +"} c #F2F2F6", +"| c #E7E7EE", +"1 c #E3E3EA", +"2 c #D0D0DC", +"3 c #C4C4D3", +"4 c #C2C2D1", +"5 c #FAFAFB", +"6 c #BDC3D1", +"7 c #B4BACB", +"8 c #AEB4C7", +"9 c #9EA3B9", +"0 c #9BA1B6", +"a c #F9F9FA", +"b c #DCDCE5", +"c c #D6D6E1", +"d c #D2D2DE", +"e c #D1D1DD", +"f c #CECEDB", +"g c #BCC3D1", +"h c #B6BDCD", +"i c #B0B7C7", +"j c #AAB0C3", +"k c #AAAFC2", +"l c #A6ACBF", +"m c #A5ABBF", +"n c #E5E5EC", +"o c #DFDFE8", +"p c #DDDDE6", +"q c #DADAE4", +"r c #D7D7E2", +"s c #B5BBCB", +"t c #B1B8C8", +"u c #ADB3C6", +"v c #A9AFC1", +"w c #EFEFF3", +"x c #E8E8EE", +"y c #E6E6ED", +"z c #B6BCCC", +"A c #B2B8C9", +"B c #ABB1C3", +"C c #F3F3F6", +"D c #E1E1E9", +" ........+ ", +" .@#$%&*=.+ ", +" .@-;>,'=.)+ ", +" .@#!~%{=++++ ", +" .@];^/(=_:<+ ", +" .@[!}~|1234+ ", +" .5];6>7890.+ ", +" .a$}%&bcdef+ ", +" .!g^hijklmd+ ", +" .!$%n1opqrc+ ", +" .[^s(t8ujvc+ ", +" .[wxy{=obqr+ ", +" .$z7(AiuBkr+ ", +" .Cx|n{Do_qr+ ", +" .~xxyt8obqr+ ", +" ++++++++++++ "}; diff --git a/emenueditor/icons/up.xpm b/emenueditor/icons/up.xpm new file mode 100644 index 0000000..d0d2de0 --- /dev/null +++ b/emenueditor/icons/up.xpm @@ -0,0 +1,155 @@ +/* XPM */ +static char * up_xpm[] = { +"24 24 128 2", +" c None", +". c #68A9FF", +"+ c #2E59B8", +"@ c #69AAFF", +"# c #88BFF9", +"$ c #699EE5", +"% c #2551B5", +"& c #6AAAFF", +"* c #8ABFF9", +"= c #86BEF9", +"- c #83BCF9", +"; c #6399E3", +"> c #1D4BB2", +", c #6BABFF", +"' c #87BEF9", +") c #7FB9F8", +"! c #79B4F7", +"~ c #5A91E1", +"{ c #1646B0", +"] c #83BBF9", +"^ c #7EB8F7", +"/ c #79B3F7", +"( c #74AFF6", +"_ c #6DAAF5", +": c #4F88DF", +"< c #1142AE", +"[ c #85BDF9", +"} c #81B9F8", +"| c #7CB6F7", +"1 c #77B2F6", +"2 c #72AEF5", +"3 c #6CA9F4", +"4 c #67A4F3", +"5 c #619EF2", +"6 c #457EDC", +"7 c #0C3EAC", +"8 c #65A7FF", +"9 c #87BDF9", +"0 c #7FB8F7", +"a c #7BB5F7", +"b c #76B0F6", +"c c #71ABF5", +"d c #6AA7F3", +"e c #65A1F2", +"f c #5F9CF0", +"g c #5998EF", +"h c #5493EE", +"i c #3A75D9", +"j c #093BAB", +"k c #62A6FF", +"l c #B5D6FB", +"m c #B4D5FB", +"n c #B1D3FB", +"o c #79B2F6", +"p c #73ADF5", +"q c #6EA9F4", +"r c #69A4F2", +"s c #63A0F1", +"t c #5D9AEF", +"u c #4982DD", +"v c #98BDF5", +"w c #94B9F4", +"x c #91B8F2", +"y c #326DD6", +"z c #0639AA", +"A c #5FA4FF", +"B c #5DA3FF", +"C c #5CA2FF", +"D c #5AA1FF", +"E c #58A0FF", +"F c #569FFF", +"G c #A6CAF8", +"H c #66A1F1", +"I c #609DF0", +"J c #5A98EE", +"K c #5693EE", +"L c #447CDB", +"M c #0B3DAC", +"N c #0A3CAC", +"O c #083BAB", +"P c #073AAB", +"Q c #0437A9", +"R c #539DFF", +"S c #A1C5F7", +"T c #5E9BF0", +"U c #5896EE", +"V c #5391ED", +"W c #4F8DEB", +"X c #3E77DA", +"Y c #509BFF", +"Z c #9CC1F5", +"` c #5694ED", +" . c #518EEC", +".. c #4C89EA", +"+. c #4785EA", +"@. c #3972D8", +"#. c #083AAB", +"$. c #4E9AFF", +"%. c #97BCF5", +"&. c #4D8CEB", +"*. c #4988EA", +"=. c #4584E9", +"-. c #4180E8", +";. c #366FD7", +">. c #4B99FF", +",. c #93B8F3", +"'. c #4785E9", +"). c #4281E9", +"!. c #3F7FE8", +"~. c #3C7BE7", +"{. c #316CD6", +"]. c #0538AA", +"^. c #4998FF", +"/. c #90B4F2", +"(. c #4080E8", +"_. c #3D7CE7", +":. c #3A7AE6", +"<. c #3978E6", +"[. c #306BD6", +"}. c #4897FF", +"|. c #8BB2F0", +"1. c #89AFEF", +"2. c #88AEEF", +"3. c #87AEEF", +"4. c #6790DD", +"5. c #0336A9", +"6. c #093CAB", +"7. c #0236A9", +" ", +" ", +" ", +" ", +" . + ", +" @ # $ % ", +" & * = - ; > ", +" , * ' - ) ! ~ { ", +" @ * ' ] ^ / ( _ : < ", +" . # [ } | 1 2 3 4 5 6 7 ", +" 8 9 ] 0 a b c d e f g h i j ", +" k l m n o p q r s t u v w x y z ", +" A B C D E F G H I J K L 7 M N O P Q ", +" R S T U V W X j ", +" Y Z ` ...+.@.#. ", +" $.%.&.*.=.-.;.z ", +" >.,.'.).!.~.{.]. ", +" ^./.(._.:.<.[.Q ", +" }.|.1.2.2.3.4.5. ", +" 6.O P P z z ].7. ", +" ", +" ", +" ", +" "}; diff --git a/emenueditor/locale/hu.po b/emenueditor/locale/hu.po new file mode 100644 index 0000000..ce348c5 --- /dev/null +++ b/emenueditor/locale/hu.po @@ -0,0 +1,123 @@ +msgid "" +msgstr "" +"Project-Id-Version: \n" +"POT-Creation-Date: \n" +"PO-Revision-Date: 2005-02-09 11:22+0100\n" +"Last-Translator: Nemeth Otto \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: emenueditor.cpp:40 +msgid "Executables (*.*), *, All files (*.*), *" +msgstr "Futtatható fájlok (*.*), *, Minden fájl (*.*), *" + +#: emenueditor.cpp:41 +msgid "File selection ..." +msgstr "Fájl kiválasztása..." + +#: emenueditor.cpp:52 +msgid "Menu editor" +msgstr "Menü szerkesztő" + +#: emenueditor.cpp:56 +msgid "&File" +msgstr "&Fájl" + +#: emenueditor.cpp:57 +msgid "&Quit" +msgstr "&Kilépés" + +#: emenueditor.cpp:65 +msgid "Programs:" +msgstr "Programok:" + +#: emenueditor.cpp:67 +msgid "Click on the submenu or on the item you want" +msgstr "Válaszd ki a módosítandó menüt" + +#: emenueditor.cpp:72 +msgid "New submenu" +msgstr "Új könyvtár" + +#: emenueditor.cpp:75 +msgid "Delete submenu" +msgstr "Könyvtár törlése" + +#: emenueditor.cpp:78 +msgid "New item" +msgstr "Új menüfájl" + +#: emenueditor.cpp:81 +msgid "Delete item" +msgstr "Menüfájl törlés" + +#: emenueditor.cpp:84 +msgid "Edit Item" +msgstr "Menüfájl szerkesztés" + +#: emenueditor.cpp:153 +msgid "Please, enter the name of the menu item." +msgstr "Add meg a menü nevét." + +#: emenueditor.cpp:183 +msgid "Icons (*.png), *.png, All files (*.*), *" +msgstr "Ikonok (*.png), *.png, Minden fájl (*.*), *" + +#: emenueditor.cpp:184 +msgid "Choose icon file..." +msgstr "Ikonfájl kiválasztása..." + +#: emenueditor.cpp:196 +msgid "Edit item" +msgstr "Szerkesztés" + +#: emenueditor.cpp:198 +msgid "Filename:" +msgstr "Fájlnév:" + +#: emenueditor.cpp:201 +msgid "Name in the menu:" +msgstr "A menü neve:" + +#: emenueditor.cpp:204 +msgid "Command to execute:" +msgstr "Futtatandó parancs:" + +#: emenueditor.cpp:208 +msgid "Bro&wse..." +msgstr "&Tallóz..." + +#: emenueditor.cpp:212 +msgid "Icon filename:" +msgstr "Ikonfájl:" + +#: emenueditor.cpp:216 +msgid "&Save" +msgstr "Menté&s" + +#: emenueditor.cpp:220 +msgid "&Cancel" +msgstr "Mégs&em" + +#: emenueditor.cpp:224 +msgid "&Browse..." +msgstr "T&allóz..." + +#: emenueditor.cpp:231 +msgid "New folder" +msgstr "Új menüfájl" + +#: emenueditor.cpp:277 +msgid "Please enter name of the new submenu:" +msgstr "Mi legyen az új könyvtár neve?" + +#: emenueditor.cpp:284 +msgid "Cannot create submenu!" +msgstr "Az almenü létrehozása sikertelen!" + +#: emenueditor.cpp:350 +msgid "You should delete all the items from the submenu, before you can delete it!" +msgstr "Mielőtt törlöd ezt a könyvtárat távolítsd el a tartalmát!" + diff --git a/emenueditor/locale/id.po b/emenueditor/locale/id.po new file mode 100644 index 0000000..c4fed1a --- /dev/null +++ b/emenueditor/locale/id.po @@ -0,0 +1,136 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR Free Software Foundation, Inc. +# FIRST AUTHOR , YEAR. +# +msgid "" +msgstr "" +"Project-Id-Version: emenueditor\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2005-02-04 12:17+0100\n" +"PO-Revision-Date: 2002-11-29 15:05+0700\n" +"Last-Translator: Bambang Purnomosidi D. P. \n" +"Language-Team: id \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=iso-8859-2\n" +"Content-Transfer-Encoding: 8bit\n" + +#: emenueditor.cpp:40 +msgid "Executables (*.*), *, All files (*.*), *" +msgstr "Dapat dieksekusi (*.*), *, Semua file (*.*), *" + +#: emenueditor.cpp:41 +msgid "File selection ..." +msgstr "Pemilihan file ..." + +#: emenueditor.cpp:52 +msgid "Menu editor" +msgstr "Editor menu" + +#: emenueditor.cpp:56 +msgid "&File" +msgstr "&File" + +#: emenueditor.cpp:57 +msgid "&Quit" +msgstr "&Keluar" + +#: emenueditor.cpp:65 +msgid "Programs:" +msgstr "Program:" + +#: emenueditor.cpp:67 +msgid "Click on the submenu or on the item you want" +msgstr "Klik pada submenu atau pada item yang anda inginkan" + +#: emenueditor.cpp:72 +msgid "New submenu" +msgstr "Submenu baru" + +#: emenueditor.cpp:75 +msgid "Delete submenu" +msgstr "Hapus submenu" + +#: emenueditor.cpp:78 +msgid "New item" +msgstr "Item baru" + +#: emenueditor.cpp:81 +msgid "Delete item" +msgstr "Hapus item" + +#: emenueditor.cpp:84 +msgid "Edit Item" +msgstr "Edit item" + +#: emenueditor.cpp:153 +msgid "Please, enter the name of the menu item." +msgstr "Silahkan, masukkan nama dari item menu." + +#: emenueditor.cpp:183 +msgid "Icons (*.png), *.png, All files (*.*), *" +msgstr "Ikon (*.png), *.png, Semua file (*.*), *" + +#: emenueditor.cpp:184 +msgid "Choose icon file..." +msgstr "Pilih file ikon..." + +#: emenueditor.cpp:196 +msgid "Edit item" +msgstr "Edit item" + +#: emenueditor.cpp:198 +msgid "Filename:" +msgstr "Nama file:" + +#: emenueditor.cpp:201 +msgid "Name in the menu:" +msgstr "Nama dalam menu:" + +#: emenueditor.cpp:204 +msgid "Command to execute:" +msgstr "Perintah untuk dieksekusi:" + +#: emenueditor.cpp:208 +msgid "Bro&wse..." +msgstr "Bro&wse..." + +#: emenueditor.cpp:212 +msgid "Icon filename:" +msgstr "Nama file ikon:" + +#: emenueditor.cpp:216 +msgid "&Save" +msgstr "$Simpan" + +#: emenueditor.cpp:220 +msgid "&Cancel" +msgstr "&Batal" + +#: emenueditor.cpp:224 +msgid "&Browse..." +msgstr "&Browse..." + +#: emenueditor.cpp:231 +msgid "New folder" +msgstr "Folder baru" + +#: emenueditor.cpp:277 +msgid "Please enter name of the new submenu:" +msgstr "Silahkan masukan nama dari submenu baru:" + +#: emenueditor.cpp:284 +msgid "Cannot create submenu!" +msgstr "Tidak bisa membuat submenu!" + +#: emenueditor.cpp:350 +msgid "" +"You should delete all the items from the submenu, before you can delete it!" +msgstr "" +"Anda harus menghapus semua item dari submenu, sebelum anda bisa menghapus " +"submenu!" + +#~ msgid "Go up..." +#~ msgstr "Ke atas..." + +#~ msgid "Go up one level" +#~ msgstr "Ke atas satu level" diff --git a/emenueditor/locale/messages.pot b/emenueditor/locale/messages.pot new file mode 100644 index 0000000..5d667fe --- /dev/null +++ b/emenueditor/locale/messages.pot @@ -0,0 +1,130 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2005-02-04 12:17+0100\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=CHARSET\n" +"Content-Transfer-Encoding: 8bit\n" + +#: emenueditor.cpp:40 +msgid "Executables (*.*), *, All files (*.*), *" +msgstr "" + +#: emenueditor.cpp:41 +msgid "File selection ..." +msgstr "" + +#: emenueditor.cpp:52 +msgid "Menu editor" +msgstr "" + +#: emenueditor.cpp:56 +msgid "&File" +msgstr "" + +#: emenueditor.cpp:57 +msgid "&Quit" +msgstr "" + +#: emenueditor.cpp:65 +msgid "Programs:" +msgstr "" + +#: emenueditor.cpp:67 +msgid "Click on the submenu or on the item you want" +msgstr "" + +#: emenueditor.cpp:72 +msgid "New submenu" +msgstr "" + +#: emenueditor.cpp:75 +msgid "Delete submenu" +msgstr "" + +#: emenueditor.cpp:78 +msgid "New item" +msgstr "" + +#: emenueditor.cpp:81 +msgid "Delete item" +msgstr "" + +#: emenueditor.cpp:84 +msgid "Edit Item" +msgstr "" + +#: emenueditor.cpp:153 +msgid "Please, enter the name of the menu item." +msgstr "" + +#: emenueditor.cpp:183 +msgid "Icons (*.png), *.png, All files (*.*), *" +msgstr "" + +#: emenueditor.cpp:184 +msgid "Choose icon file..." +msgstr "" + +#: emenueditor.cpp:196 +msgid "Edit item" +msgstr "" + +#: emenueditor.cpp:198 +msgid "Filename:" +msgstr "" + +#: emenueditor.cpp:201 +msgid "Name in the menu:" +msgstr "" + +#: emenueditor.cpp:204 +msgid "Command to execute:" +msgstr "" + +#: emenueditor.cpp:208 +msgid "Bro&wse..." +msgstr "" + +#: emenueditor.cpp:212 +msgid "Icon filename:" +msgstr "" + +#: emenueditor.cpp:216 +msgid "&Save" +msgstr "" + +#: emenueditor.cpp:220 +msgid "&Cancel" +msgstr "" + +#: emenueditor.cpp:224 +msgid "&Browse..." +msgstr "" + +#: emenueditor.cpp:231 +msgid "New folder" +msgstr "" + +#: emenueditor.cpp:277 +msgid "Please enter name of the new submenu:" +msgstr "" + +#: emenueditor.cpp:284 +msgid "Cannot create submenu!" +msgstr "" + +#: emenueditor.cpp:350 +msgid "" +"You should delete all the items from the submenu, before you can delete it!" +msgstr "" diff --git a/emenueditor/locale/ru.po b/emenueditor/locale/ru.po new file mode 100644 index 0000000..b56837f --- /dev/null +++ b/emenueditor/locale/ru.po @@ -0,0 +1,135 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR Free Software Foundation, Inc. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2005-02-04 12:17+0100\n" +"PO-Revision-Date: 2002-11-28 HO:MI+ZONE\n" +"Last-Translator: aabbvv \n" +"Language-Team: RUSSIAN \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=koi8-r\n" +"Content-Transfer-Encoding: 8bit\n" + +#: emenueditor.cpp:40 +msgid "Executables (*.*), *, All files (*.*), *" +msgstr " (*.*), *, (*.*), *" + +#: emenueditor.cpp:41 +msgid "File selection ..." +msgstr " ..." + +#: emenueditor.cpp:52 +msgid "Menu editor" +msgstr " " + +#: emenueditor.cpp:56 +msgid "&File" +msgstr "" + +#: emenueditor.cpp:57 +msgid "&Quit" +msgstr "" + +#: emenueditor.cpp:65 +msgid "Programs:" +msgstr ":" + +#: emenueditor.cpp:67 +msgid "Click on the submenu or on the item you want" +msgstr " " + +#: emenueditor.cpp:72 +msgid "New submenu" +msgstr " " + +#: emenueditor.cpp:75 +msgid "Delete submenu" +msgstr " " + +#: emenueditor.cpp:78 +msgid "New item" +msgstr " " + +#: emenueditor.cpp:81 +msgid "Delete item" +msgstr " " + +#: emenueditor.cpp:84 +msgid "Edit Item" +msgstr " " + +#: emenueditor.cpp:153 +msgid "Please, enter the name of the menu item." +msgstr " ." + +#: emenueditor.cpp:183 +msgid "Icons (*.png), *.png, All files (*.*), *" +msgstr " (*.png), *.png, (*.*), *" + +#: emenueditor.cpp:184 +msgid "Choose icon file..." +msgstr " ..." + +#: emenueditor.cpp:196 +msgid "Edit item" +msgstr " " + +#: emenueditor.cpp:198 +msgid "Filename:" +msgstr " :" + +#: emenueditor.cpp:201 +msgid "Name in the menu:" +msgstr " :" + +#: emenueditor.cpp:204 +msgid "Command to execute:" +msgstr ":" + +#: emenueditor.cpp:208 +msgid "Bro&wse..." +msgstr "..." + +#: emenueditor.cpp:212 +msgid "Icon filename:" +msgstr " :" + +#: emenueditor.cpp:216 +msgid "&Save" +msgstr "" + +#: emenueditor.cpp:220 +msgid "&Cancel" +msgstr "" + +#: emenueditor.cpp:224 +msgid "&Browse..." +msgstr "..." + +#: emenueditor.cpp:231 +msgid "New folder" +msgstr " " + +#: emenueditor.cpp:277 +msgid "Please enter name of the new submenu:" +msgstr " :" + +#: emenueditor.cpp:284 +msgid "Cannot create submenu!" +msgstr " !" + +#: emenueditor.cpp:350 +msgid "" +"You should delete all the items from the submenu, before you can delete it!" +msgstr " " + +#~ msgid "Go up..." +#~ msgstr "..." + +#~ msgid "Go up one level" +#~ msgstr " " diff --git a/emenueditor/locale/sk.po b/emenueditor/locale/sk.po new file mode 100644 index 0000000..dda1bf2 --- /dev/null +++ b/emenueditor/locale/sk.po @@ -0,0 +1,134 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR Free Software Foundation, Inc. +# FIRST AUTHOR , YEAR. +# +msgid "" +msgstr "" +"Project-Id-Version: emenueditor 1.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2005-02-04 12:17+0100\n" +"PO-Revision-Date: 2002-04-21 14:50+0200\n" +"Last-Translator: Martin Pekar \n" +"Language-Team: Slovak \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: emenueditor.cpp:40 +msgid "Executables (*.*), *, All files (*.*), *" +msgstr "Spustiteľné (*.*), *, Všetky súbory (*.*), *" + +#: emenueditor.cpp:41 +msgid "File selection ..." +msgstr "Výber súboru ..." + +#: emenueditor.cpp:52 +msgid "Menu editor" +msgstr "Editor ponuky" + +#: emenueditor.cpp:56 +msgid "&File" +msgstr "&Súbor" + +#: emenueditor.cpp:57 +msgid "&Quit" +msgstr "&Koniec" + +#: emenueditor.cpp:65 +msgid "Programs:" +msgstr "Programy:" + +#: emenueditor.cpp:67 +msgid "Click on the submenu or on the item you want" +msgstr "Kliknite na podponuku alebo na položku, ktorú chcete" + +#: emenueditor.cpp:72 +msgid "New submenu" +msgstr "Nová podponuka" + +#: emenueditor.cpp:75 +msgid "Delete submenu" +msgstr "Zmazať podponuku" + +#: emenueditor.cpp:78 +msgid "New item" +msgstr "Nová položka" + +#: emenueditor.cpp:81 +msgid "Delete item" +msgstr "Zmazať položku" + +#: emenueditor.cpp:84 +msgid "Edit Item" +msgstr "Editovať položku" + +#: emenueditor.cpp:153 +msgid "Please, enter the name of the menu item." +msgstr "Prosím vložte názov položky menu." + +#: emenueditor.cpp:183 +msgid "Icons (*.png), *.png, All files (*.*), *" +msgstr "Ikony (*.png), *.png, Všetky súbory (*.*), *" + +#: emenueditor.cpp:184 +msgid "Choose icon file..." +msgstr "Zvoľte súbor s ikonou..." + +#: emenueditor.cpp:196 +msgid "Edit item" +msgstr "Editovať položku" + +#: emenueditor.cpp:198 +msgid "Filename:" +msgstr "Názov súboru:" + +#: emenueditor.cpp:201 +msgid "Name in the menu:" +msgstr "Názov v ponuke:" + +#: emenueditor.cpp:204 +msgid "Command to execute:" +msgstr "Príkaz ku spusteniu:" + +#: emenueditor.cpp:208 +msgid "Bro&wse..." +msgstr "Zv&oliť..." + +#: emenueditor.cpp:212 +msgid "Icon filename:" +msgstr "Súbor ikony:" + +#: emenueditor.cpp:216 +msgid "&Save" +msgstr "&Uložiť" + +#: emenueditor.cpp:220 +msgid "&Cancel" +msgstr "&Zrušiť" + +#: emenueditor.cpp:224 +msgid "&Browse..." +msgstr "&Zvoliť..." + +#: emenueditor.cpp:231 +msgid "New folder" +msgstr "Nový adresár" + +#: emenueditor.cpp:277 +msgid "Please enter name of the new submenu:" +msgstr "Prosím zadajte názov novej ponuky:" + +#: emenueditor.cpp:284 +msgid "Cannot create submenu!" +msgstr "Nemôžem vytvoriť podponuku!" + +#: emenueditor.cpp:350 +msgid "" +"You should delete all the items from the submenu, before you can delete it!" +msgstr "Musíte zmazať všetky položky z podponuky predtým ako ju chcete zmazať!" + +#~ msgid "Go up..." +#~ msgstr "Ísť hore..." + +#~ msgid "Go up one level" +#~ msgstr "Ísť hore o úroveň" diff --git a/emenueditor/locale/sr.po b/emenueditor/locale/sr.po new file mode 100644 index 0000000..d06718f --- /dev/null +++ b/emenueditor/locale/sr.po @@ -0,0 +1,136 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR Free Software Foundation, Inc. +# FIRST AUTHOR , YEAR. +# +msgid "" +msgstr "" +"Project-Id-Version: emenueditor 1.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2005-02-04 12:17+0100\n" +"PO-Revision-Date: 2002-11-30 01:53+0100\n" +"Last-Translator: Dejan Lekic \n" +"Language-Team: LINUKS.org T.T. \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: emenueditor.cpp:40 +msgid "Executables (*.*), *, All files (*.*), *" +msgstr "Извршни фајлови (*.*), *, Сви фајлови (*.*), *" + +#: emenueditor.cpp:41 +msgid "File selection ..." +msgstr "Селекција фајла ..." + +#: emenueditor.cpp:52 +msgid "Menu editor" +msgstr "Едитор менија" + +#: emenueditor.cpp:56 +msgid "&File" +msgstr "&Фајл" + +#: emenueditor.cpp:57 +msgid "&Quit" +msgstr "&Крај" + +#: emenueditor.cpp:65 +msgid "Programs:" +msgstr "Програми:" + +#: emenueditor.cpp:67 +msgid "Click on the submenu or on the item you want" +msgstr "Кликни на подмени или на ставку коју желите" + +#: emenueditor.cpp:72 +msgid "New submenu" +msgstr "Нови подмени" + +#: emenueditor.cpp:75 +msgid "Delete submenu" +msgstr "Бриши подмени" + +#: emenueditor.cpp:78 +msgid "New item" +msgstr "Нова ставка" + +#: emenueditor.cpp:81 +msgid "Delete item" +msgstr "Бриши ставку" + +#: emenueditor.cpp:84 +msgid "Edit Item" +msgstr "Едитуј ставку" + +#: emenueditor.cpp:153 +msgid "Please, enter the name of the menu item." +msgstr "Молимо Вас, унесите име ставке у менију." + +#: emenueditor.cpp:183 +msgid "Icons (*.png), *.png, All files (*.*), *" +msgstr "Иконе (*.png), *.png, Сви фајлови (*.*), *" + +#: emenueditor.cpp:184 +msgid "Choose icon file..." +msgstr "Изаберите икон-фајл..." + +#: emenueditor.cpp:196 +msgid "Edit item" +msgstr "Едитуј ставку" + +#: emenueditor.cpp:198 +msgid "Filename:" +msgstr "Име фајла:" + +#: emenueditor.cpp:201 +msgid "Name in the menu:" +msgstr "Назив у менију:" + +#: emenueditor.cpp:204 +msgid "Command to execute:" +msgstr "Команда за извршавање:" + +#: emenueditor.cpp:208 +msgid "Bro&wse..." +msgstr "&Нађи..." + +#: emenueditor.cpp:212 +msgid "Icon filename:" +msgstr "Име фајла иконе:" + +#: emenueditor.cpp:216 +msgid "&Save" +msgstr "&Сними" + +#: emenueditor.cpp:220 +msgid "&Cancel" +msgstr "&Одустани" + +#: emenueditor.cpp:224 +msgid "&Browse..." +msgstr "&Нађи..." + +#: emenueditor.cpp:231 +msgid "New folder" +msgstr "Нови директоријум" + +#: emenueditor.cpp:277 +msgid "Please enter name of the new submenu:" +msgstr "Молимо Вас унесите назив новог подменија:" + +#: emenueditor.cpp:284 +msgid "Cannot create submenu!" +msgstr "Не могу да креирам подмени!" + +#: emenueditor.cpp:350 +msgid "" +"You should delete all the items from the submenu, before you can delete it!" +msgstr "" +"Требало би да обришете све ставке у подменију пре него покушате да га " +"обришете!" + +#~ msgid "Go up..." +#~ msgstr "Иди горе..." + +#~ msgid "Go up one level" +#~ msgstr "Иди један ниво горе" diff --git a/epanelconf/Jamfile b/epanelconf/Jamfile new file mode 100644 index 0000000..1d8065b --- /dev/null +++ b/epanelconf/Jamfile @@ -0,0 +1,16 @@ +# +# $Id$ +# +# Part of Equinox Desktop Environment (EDE). +# Copyright (c) 2000-2007 EDE Authors. +# +# This program is licenced under terms of the +# GNU General Public Licence version 2 or newer. +# See COPYING for details. + +SubDir TOP epanelconf ; + +SOURCE = epanelconf.cpp util.cpp ; + +MakeProgram epanelconf : $(SOURCE) ; +ExtractStrings locale : $(SOURCE) ; diff --git a/epanelconf/Makefile b/epanelconf/Makefile new file mode 100644 index 0000000..8ede31b --- /dev/null +++ b/epanelconf/Makefile @@ -0,0 +1,22 @@ + +CPPFILES = epanelconf.cpp util.cpp ../edelib2/Util.cpp ../edelib2/Config.cpp +TARGET = epanelconf + +POFILES = locale/ru.po\ + locale/sr.po\ + locale/sk.po\ + locale/hu.po\ + +include ../makeinclude + +install: + $(INSTALL_PROGRAM) $(TARGET) $(bindir) + $(INSTALL_LOCALE) + +uninstall: + $(RM) $(bindir)/$(TARGET) + +clean: + $(RM) $(TARGET) + $(RM) *.o + diff --git a/epanelconf/epanelconf.cpp b/epanelconf/epanelconf.cpp new file mode 100644 index 0000000..96b53d7 --- /dev/null +++ b/epanelconf/epanelconf.cpp @@ -0,0 +1,253 @@ +/* + * $Id$ + * + * Configure window for eworkpanel + * Part of Equinox Desktop Environment (EDE). + * Copyright (c) 2000-2006 EDE Authors. + * + * This program is licenced under terms of the + * GNU General Public Licence version 2 or newer. + * See COPYING for details. + */ + +#include "epanelconf.h" +#include "util.h" + +#include +#include + +using namespace fltk; + + + +// Widgets accessed from util.cpp +Input *workspaces[8]; + +Input* vcProgram; +Input* tdProgram; +Input* browserProgram; +Input* terminalProgram; +CheckButton* autohide_check; +ValueSlider* ws_slider; + +Window* panelWindow; + + +// Callbacks + +static void cb_Apply(Button*, void*) { + write_config(); + send_workspaces(); +} + +static void cb_Close(Button*, void*) { + exit(0); +} + +static void cb_Browse(Button*, void*) { +// char *file_types = _("Executables (*.*), *, All files (*.*), *"); +// const char *fileName = fl_select_file(0, file_types, _("File selection...")); + const char *fileName = file_chooser(_("Choose volume control program"), "*.*", vcProgram->value()); + if (fileName) + vcProgram->value(fileName); +} + +static void cb_Br(Button*, void*) { +// char *file_types = _("Executables (*.*), *, All files (*.*), *"); +// const char *fileName = fl_select_file(0, file_types, _("File selection...")); + const char *fileName = file_chooser(_("Choose time&date program"), "*.*", tdProgram->value()); + if (fileName) + tdProgram->value(fileName); +} + +static void cb_Browse1(Button*, void*) { +// char *file_types = _("Executables (*.*), *, All files (*.*), *"); +// const char *fileName = fl_select_file(0, file_types, _("File selection...")); + const char *fileName = file_chooser(_("Choose web browser program"), "*.*", browserProgram->value()); + if (fileName) + browserProgram->value(fileName); +} + + +static void cb_Br1(Button*, void*) { +// char *file_types = _("Executables (*.*), *, All files (*.*), *"); +// const char *fileName = fl_select_file(0, file_types, _("File selection...")); + const char *fileName = file_chooser(_("Choose file manager program"), "*.*", terminalProgram->value()); + if (fileName) + terminalProgram->value(fileName); +} + +static void cb_ws_slider(ValueSlider*, void*) { + int val = int(ws_slider->value()); + for(int n=0; n<8; n++) { + if(nactivate(); + else + workspaces[n]->deactivate(); + } +} + + +// Main window + +int main (int argc, char **argv) +{ + +Window* w; +//fl_init_locale_support("epanelconf", PREFIX"/share/locale"); +{ + Window* o = panelWindow = new Window(405, 270, _("Panel settings")); + w = o; + o->begin(); + { + Button* o = new Button(205, 235, 90, 25, _("&Apply")); + o->callback((Callback*)cb_Apply); + } + { + Button* o = new Button(305, 235, 90, 25, _("&Close")); + o->callback((Callback*)cb_Close); + } + { + TabGroup* o = new TabGroup(10, 10, 385, 215); + o->selection_color(o->color()); + o->selection_textcolor(o->textcolor()); + o->begin(); + { + Group* o = new Group(0, 25, 385, 190, _("Utilities")); + o->begin(); + { + Group* o = new Group(10, 20, 365, 100, "Panel utilities"); + o->box(ENGRAVED_BOX); + o->align(ALIGN_TOP|ALIGN_LEFT); + o->begin(); + { + Input* o = vcProgram = new Input(10, 20, 245, 25, _("Volume control program:")); + o->align(ALIGN_TOP|ALIGN_LEFT); + } + { + Button* o = new Button(265, 20, 90, 25, _("&Browse...")); + o->callback((Callback*)cb_Browse); + } + { + Input* o = tdProgram = new Input(10, 65, 245, 25, _("Time and date program:")); + o->align(ALIGN_TOP|ALIGN_LEFT); + } + { + Button* o = new Button(265, 65, 90, 25, _("Br&owse...")); + o->callback((Callback*)cb_Br); + } + o->end(); + } + { + Group* o = new Group(10, 140, 365, 35, _("Autohide")); + o->box(ENGRAVED_BOX); + o->align(ALIGN_TOP|ALIGN_LEFT); + o->begin(); + autohide_check = new CheckButton(10, 5, 345, 25, _("Automaticaly hide panel")); + o->end(); + } + o->end(); + } + { + Group* o = new Group(0, 25, 385, 190, _("Workspaces")); + o->hide(); + o->begin(); + { + ValueSlider* o = ws_slider = new ValueSlider(120, 10, 255, 25, _("Number of workspaces: ")); + o->type(ValueSlider::TICK_BELOW); + o->box(THIN_DOWN_BOX); + o->buttonbox(THIN_UP_BOX); + o->step(1); + o->callback((Callback*)cb_ws_slider); + o->align(ALIGN_LEFT|ALIGN_WRAP); + o->step(1); ; + o->range(1,8); + } + { + Group* o = new Group(10, 60, 370, 120, _("Workspace names:")); + o->box(ENGRAVED_BOX); + o->align(ALIGN_TOP|ALIGN_LEFT); + o->begin(); + { + Input* o = new Input(50, 5, 115, 20, _("WS 1:")); + o->deactivate(); + workspaces[0] = o; ; + } + { + Input* o = new Input(50, 35, 115, 20, _("WS 2:")); + o->deactivate(); + workspaces[1] = o; ; + } + { + Input* o = new Input(50, 65, 115, 20, _("WS 3:")); + o->deactivate(); + workspaces[2] = o; ; + } + { + Input* o = new Input(50, 95, 115, 20, _("WS 4:")); + o->deactivate(); + workspaces[3] = o; ; + } + { + Input* o = new Input(250, 5, 115, 20, _("WS 5:")); + o->deactivate(); + workspaces[4] = o; ; + } + { + Input* o = new Input(250, 35, 115, 20, _("WS 6:")); + o->deactivate(); + workspaces[5] = o; ; + } + { + Input* o = new Input(250, 65, 115, 20, _("WS 7:")); + o->deactivate(); + workspaces[6] = o; ; + } + { + Input* o = new Input(250, 95, 115, 20, _("WS 8:")); + o->deactivate(); + workspaces[7] = o; ; + } + o->end(); + } + o->end(); + } + { + Group* o = new Group(0, 25, 385, 190, _("Handlers")); + o->hide(); + o->begin(); + { + Group* o = new Group(10, 20, 365, 110, _("Handlers programs")); + o->box(ENGRAVED_BOX); + o->align(ALIGN_TOP|ALIGN_LEFT); + o->begin(); + { + Input* o = browserProgram = new Input(10, 20, 245, 25, _("Internet browser:")); + o->align(ALIGN_TOP|ALIGN_LEFT); + } + { + Button* o = new Button(265, 20, 90, 25, _("&Browse...")); + o->callback((Callback*)cb_Browse1); + } + { + Input* o = terminalProgram = new Input(10, 65, 245, 25, _("Terminal:")); + o->align(ALIGN_TOP|ALIGN_LEFT); + } + { + Button* o = new Button(265, 65, 90, 25, _("Br&owse...")); + o->callback((Callback*)cb_Br1); + } + o->end(); + } + o->end(); + } + o->end(); + } // TabGroup + o->end(); +} + +read_config(); +update_workspaces(); +w->show(argc, argv); +return run(); +} diff --git a/epanelconf/epanelconf.fl b/epanelconf/epanelconf.fl new file mode 100644 index 0000000..6eaf468 --- /dev/null +++ b/epanelconf/epanelconf.fl @@ -0,0 +1,189 @@ +# data file for the FLTK User Interface Designer (FLUID) +version 2.0100 +images_dir ./ +header_name {.h} +code_name {.cpp} +gridx 5 +gridy 5 +snap 3 +decl {// Panel config for EDE is (C) Copyright 2001-2002 by Martin Pekar, this program is provided under the terms of GNU GPL v.2, see file COPYING for more information.} {selected +} + +decl {\#include "util.h"} {} + +decl {extern fltk::Input *workspaces[8];} {} + +Function {} {open +} { + code {//fl_init_locale_support("epanelconf", PREFIX"/share/locale");} {} + {fltk::Window} panelWindow { + label {Panel settings} open + xywh {347 187 405 270} visible + } { + {fltk::Button} {} { + label {&Apply} + callback {write_config(); +send_workspaces();} + xywh {205 235 90 25} + } + {fltk::Button} {} { + label {&Close} + callback {Fl::first_window()->hide();} + private xywh {305 235 90 25} + } + {fltk::TabGroup} {} {open + xywh {10 10 385 215} + } { + {fltk::Group} {} { + label Utilities open + xywh {0 25 385 190} + } { + {fltk::Group} {} { + label {Panel utilities} open + xywh {10 20 365 100} align 5 box ENGRAVED_BOX + } { + {fltk::Input} vcProgram { + label {Volume control program:} + xywh {10 20 245 25} align 5 + } + {fltk::Button} {} { + label {&Browse...} + callback {char *file_types = _("Executables (*.*), *, All files (*.*), *"); +const char *fileName = fl_select_file(0, file_types, _("File selection...")); +if (fileName) { + vcProgram->value(fileName); +}} + private xywh {265 20 90 25} + } + {fltk::Input} tdProgram { + label {Time and date program:} + xywh {10 65 245 25} align 5 + } + {fltk::Button} {} { + label {Br&owse...} + callback {char *file_types = _("Executables (*.*), *, All files (*.*), *"); +const char *fileName = fl_select_file(0, file_types, _("File selection...")); +if (fileName) +{ + tdProgram->value(fileName); +}} + private xywh {265 65 90 25} + } + } + {fltk::Group} {} { + label Autohide open + xywh {10 140 365 35} align 5 box ENGRAVED_BOX + extra_code {;} + } { + {fltk::CheckButton} autohide_check { + label {Automaticaly hide panel} + xywh {10 5 345 25} + } + } + } + {fltk::Group} {} { + label Workspaces open + xywh {0 25 385 190} hide + } { + {fltk::ValueSlider} ws_slider { + label {Number of workspaces: } + callback {int val = int(ws_slider->value()); +for(int n=0; n<8; n++) { + if(nactivate(); + else + workspaces[n]->deactivate(); +}} + xywh {120 10 255 25} type TICK_BELOW align 132 box THIN_DOWN_BOX buttonbox THIN_UP_BOX step 1 + extra_code {o->step(1); ; +o->range(1,8);} + } + {fltk::Group} {} { + label {Workspace names:} open + xywh {10 60 370 120} align 5 box ENGRAVED_BOX + extra_code {;} + } { + {fltk::Input} {} { + label {WS 1:} + xywh {50 5 115 20} deactivate + extra_code {workspaces[0] = o; ;} + } + {fltk::Input} {} { + label {WS 2:} + xywh {50 35 115 20} deactivate + extra_code {workspaces[1] = o; ;} + } + {fltk::Input} {} { + label {WS 3:} + xywh {50 65 115 20} deactivate + extra_code {workspaces[2] = o; ;} + } + {fltk::Input} {} { + label {WS 4:} + xywh {50 95 115 20} deactivate + extra_code {workspaces[3] = o; ;} + } + {fltk::Input} {} { + label {WS 5:} + xywh {250 5 115 20} deactivate + extra_code {workspaces[4] = o; ;} + } + {fltk::Input} {} { + label {WS 6:} + xywh {250 35 115 20} deactivate + extra_code {workspaces[5] = o; ;} + } + {fltk::Input} {} { + label {WS 7:} + xywh {250 65 115 20} deactivate + extra_code {workspaces[6] = o; ;} + } + {fltk::Input} {} { + label {WS 8:} + xywh {250 95 115 20} deactivate + extra_code {workspaces[7] = o; ;} + } + } + } + {fltk::Group} {} { + label Handlers open + xywh {0 25 385 190} hide + } { + {fltk::Group} {} { + label {Handlers programs} open + xywh {10 20 365 110} align 5 box ENGRAVED_BOX + extra_code {;} + } { + {fltk::Input} browserProgram { + label {Internet browser:} + xywh {10 20 245 25} align 5 + } + {fltk::Button} {} { + label {&Browse...} + callback {char *file_types = _("Executables (*.*), *, All files (*.*), *"); +const char *fileName = fl_select_file(0, file_types, _("File selection...")); +if (fileName) { + browserProgram->value(fileName); +}} + private xywh {265 20 90 25} + } + {fltk::Input} terminalProgram { + label {Terminal:} + xywh {10 65 245 25} align 5 + } + {fltk::Button} {} { + label {Br&owse...} + callback {char *file_types = _("Executables (*.*), *, All files (*.*), *"); +const char *fileName = fl_select_file(0, file_types, _("File selection...")); +if (fileName) { + terminalProgram->value(fileName); +}} + private xywh {265 65 90 25} + } + } + } + } + } + code {read_config();} {} + code {update_workspaces();} {} +} diff --git a/epanelconf/epanelconf.fld b/epanelconf/epanelconf.fld new file mode 100644 index 0000000..1806172 --- /dev/null +++ b/epanelconf/epanelconf.fld @@ -0,0 +1,195 @@ +# data file for the FLTK User Interface Designer (FLUID) +version 2,0003 +images_dir ./ +i18n +header_name {.h} +code_name {.cpp} +gridx 5 +gridy 5 +snap 3 +decl {// Panel config for EDE is (C) Copyright 2001-2002 by Martin Pekar, this program is provided under the terms of GNU GPL v.2, see file COPYING for more information.} {} + +decl {\#include } {} + +decl {\#include } {} + +decl {\#include } {} + +decl {\#include "util.h"} {} + +decl {extern Fl_Input *workspaces[8];} {} + +Function {} {open +} { + code {fl_init_locale_support("epanelconf", PREFIX"/share/locale");} {} + Fl_Window panelWindow { + label {Panel settings} open + xywh {118 179 405 264} hide + } { + Fl_Button {} { + label {&Apply} + callback {write_config(); +send_workspaces();} + xywh {237 235 80 25} + } + Fl_Button {} { + label {&Close} + callback {Fl::first_window()->hide();} + private xywh {323 235 80 25} + } + Fl_Tabs {} {open + xywh {0 2 403 230} + } { + Fl_Group {} { + label Utilities open + xywh {0 22 403 208} + } { + Fl_Group {} { + label {Panel utilities} open + xywh {5 20 395 110} align 5 box ENGRAVED_BOX + } { + Fl_Input vcProgram { + label {Volume control program:} + xywh {10 22 285 23} align 5 + } + Fl_Button {} { + label {&Browse...} + callback {char *file_types = _("Executables (*.*), *, All files (*.*), *"); +const char *fileName = fl_select_file(0, file_types, _("File selection...")); +if (fileName) { + vcProgram->value(fileName); +}} selected + private xywh {305 20 80 25} + } + Fl_Input tdProgram { + label {Time and date program:} + xywh {10 67 285 23} align 5 + } + Fl_Button {} { + label {Br&owse...} + callback {char *file_types = _("Executables (*.*), *, All files (*.*), *"); +const char *fileName = fl_select_file(0, file_types, _("File selection...")); +if (fileName) +{ + tdProgram->value(fileName); +}} + private xywh {305 65 80 25} + } + } + Fl_Group {} { + label Autohide open + xywh {5 150 395 35} align 5 box ENGRAVED_BOX + extra_code {;} + } { + Fl_Check_Button autohide_check { + label {Automaticaly hide panel} + xywh {5 5 385 25} + } + } + } + Fl_Group {} { + label Workspaces open + xywh {0 22 403 208} hide + } { + Fl_Value_Slider ws_slider { + label {Number of workspaces: } + callback {int val = int(ws_slider->value()); +for(int n=0; n<8; n++) { + if(nactivate(); + else + workspaces[n]->deactivate(); +}} + xywh {145 10 255 20} type {HORIZONTAL|Fl_Slider::TICK_BELOW} align 132 box THIN_DOWN_BOX button_box THIN_UP_BOX step 1 + extra_code {o->step(1); ; +o->range(1,8);} + } + Fl_Group {} { + label {Workspace names:} open + xywh {5 60 395 130} align 5 box ENGRAVED_BOX + extra_code {;} + } { + Fl_Input {} { + label {WS 1:} + xywh {55 10 115 20} deactivate + extra_code {workspaces[0] = o; ;} + } + Fl_Input {} { + label {WS 2:} + xywh {55 40 115 20} deactivate + extra_code {workspaces[1] = o; ;} + } + Fl_Input {} { + label {WS 3:} + xywh {55 70 115 20} deactivate + extra_code {workspaces[2] = o; ;} + } + Fl_Input {} { + label {WS 4:} + xywh {55 100 115 20} deactivate + extra_code {workspaces[3] = o; ;} + } + Fl_Input {} { + label {WS 5:} + xywh {260 10 115 20} deactivate + extra_code {workspaces[4] = o; ;} + } + Fl_Input {} { + label {WS 6:} + xywh {260 40 115 20} deactivate + extra_code {workspaces[5] = o; ;} + } + Fl_Input {} { + label {WS 7:} + xywh {260 70 115 20} deactivate + extra_code {workspaces[6] = o; ;} + } + Fl_Input {} { + label {WS 8:} + xywh {260 100 115 20} deactivate + extra_code {workspaces[7] = o; ;} + } + } + } + Fl_Group {} { + label Handlers open + xywh {0 22 403 208} hide + } { + Fl_Group {} { + label {Handlers programs} open + xywh {5 20 395 110} align 5 box ENGRAVED_BOX + extra_code {;} + } { + Fl_Input browserProgram { + label {Internet browser:} + xywh {10 22 285 23} align 5 + } + Fl_Button {} { + label {&Browse...} + callback {char *file_types = _("Executables (*.*), *, All files (*.*), *"); +const char *fileName = fl_select_file(0, file_types, _("File selection...")); +if (fileName) { + browserProgram->value(fileName); +}} + private xywh {300 20 80 25} + } + Fl_Input terminalProgram { + label {Terminal:} + xywh {10 67 285 23} align 5 + } + Fl_Button {} { + label {Br&owse...} + callback {char *file_types = _("Executables (*.*), *, All files (*.*), *"); +const char *fileName = fl_select_file(0, file_types, _("File selection...")); +if (fileName) { + terminalProgram->value(fileName); +}} + private xywh {300 65 80 25} + } + } + } + } + } + code {read_config();} {} + code {update_workspaces();} {} +} diff --git a/epanelconf/epanelconf.h b/epanelconf/epanelconf.h new file mode 100644 index 0000000..d4e2551 --- /dev/null +++ b/epanelconf/epanelconf.h @@ -0,0 +1,35 @@ +/* + * $Id$ + * + * Configure window for eworkpanel + * Part of Equinox Desktop Environment (EDE). + * Copyright (c) 2000-2006 EDE Authors. + * + * This program is licenced under terms of the + * GNU General Public Licence version 2 or newer. + * See COPYING for details. + */ + +#ifndef epanelconf_h +#define epanelconf_h +#include +#include +#include +#include +#include +#include +#include +#include +#include "../edelib2/NLS.h" + +// Widgets accessed from util.cpp +extern fltk::Input *workspaces[8]; + +extern fltk::Input* vcProgram; +extern fltk::Input* tdProgram; +extern fltk::Input* browserProgram; +extern fltk::Input* terminalProgram; +extern fltk::CheckButton* autohide_check; +extern fltk::ValueSlider* ws_slider; + +#endif diff --git a/epanelconf/locale/hu.po b/epanelconf/locale/hu.po new file mode 100644 index 0000000..812ff2a --- /dev/null +++ b/epanelconf/locale/hu.po @@ -0,0 +1,131 @@ +msgid "" +msgstr "" +"Project-Id-Version: \n" +"POT-Creation-Date: \n" +"PO-Revision-Date: 2005-02-09 11:22+0100\n" +"Last-Translator: Nemeth Otto \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: epanelconf.cpp:25 +#: epanelconf.cpp:35 +#: epanelconf.cpp:60 +#: epanelconf.cpp:70 +msgid "Executables (*.*), *, All files (*.*), *" +msgstr "Futtatható fájlok (*.*), *, Minden fájl (*.*), *" + +#: epanelconf.cpp:26 +#: epanelconf.cpp:36 +#: epanelconf.cpp:61 +#: epanelconf.cpp:71 +msgid "File selection..." +msgstr "Fájl kiválasztása..." + +#: epanelconf.cpp:81 +msgid "Panel settings" +msgstr "Panel beállítások" + +#: epanelconf.cpp:83 +msgid "&Apply" +msgstr "&Alkalmaz" + +#: epanelconf.cpp:86 +msgid "&Close" +msgstr "Be&zár" + +#: epanelconf.cpp:90 +msgid "Utilities" +msgstr "Alkalmazások" + +#: epanelconf.cpp:91 +msgid "Panel utilities" +msgstr "Panel alkalmazások" + +#: epanelconf.cpp:94 +msgid "Volume control program:" +msgstr "Hangerőszabályzó program:" + +#: epanelconf.cpp:97 +#: epanelconf.cpp:177 +msgid "&Browse..." +msgstr "&Tallóz..." + +#: epanelconf.cpp:100 +msgid "Time and date program:" +msgstr "Dátum/idő program:" + +#: epanelconf.cpp:103 +#: epanelconf.cpp:183 +msgid "Br&owse..." +msgstr "Ta&llóz..." + +#: epanelconf.cpp:108 +msgid "Autohide" +msgstr "Elrejtés" + +#: epanelconf.cpp:111 +msgid "Automaticaly hide panel" +msgstr "Panel automatikus elrejtése" + +#: epanelconf.cpp:117 +msgid "Workspaces" +msgstr "Munkaterületek" + +#: epanelconf.cpp:119 +msgid "Number of workspaces: " +msgstr "Munkaterületek száma:" + +#: epanelconf.cpp:129 +msgid "Workspace names:" +msgstr "Munkaterület nevek:" + +#: epanelconf.cpp:132 +msgid "WS 1:" +msgstr "MT 1:" + +#: epanelconf.cpp:136 +msgid "WS 2:" +msgstr "MT 2:" + +#: epanelconf.cpp:140 +msgid "WS 3:" +msgstr "MT 3:" + +#: epanelconf.cpp:144 +msgid "WS 4:" +msgstr "MT 4:" + +#: epanelconf.cpp:148 +msgid "WS 5:" +msgstr "MT 5:" + +#: epanelconf.cpp:152 +msgid "WS 6:" +msgstr "MT 6:" + +#: epanelconf.cpp:156 +msgid "WS 7:" +msgstr "MT 7:" + +#: epanelconf.cpp:160 +msgid "WS 8:" +msgstr "MT 8:" + +#: epanelconf.cpp:169 +msgid "Handlers" +msgstr "Alapértelmezések" + +#: epanelconf.cpp:171 +msgid "Handlers programs" +msgstr "Alapértelmezett programok" + +#: epanelconf.cpp:174 +msgid "Internet browser:" +msgstr "Böngésző:" + +#: epanelconf.cpp:180 +msgid "Terminal:" +msgstr "Terminál:" + diff --git a/epanelconf/locale/id.po b/epanelconf/locale/id.po new file mode 100644 index 0000000..4a2a7fa --- /dev/null +++ b/epanelconf/locale/id.po @@ -0,0 +1,126 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR Free Software Foundation, Inc. +# FIRST AUTHOR , YEAR. +# +msgid "" +msgstr "" +"Project-Id-Version: epanelconf\n" +"POT-Creation-Date: 2002-10-17 18:15+0000\n" +"PO-Revision-Date: 2002-11-29 15:30+0700\n" +"Last-Translator: Bambang Purnomosidi D. P. \n" +"Language-Team: id \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=iso-8859-2\n" +"Content-Transfer-Encoding: 8bit\n" + +#: epanelconf.cpp:25 epanelconf.cpp:35 epanelconf.cpp:60 epanelconf.cpp:70 +msgid "Executables (*.*), *, All files (*.*), *" +msgstr "Dapat dieksekusi (*.*), *, Semua file (*.*), *" + +#: epanelconf.cpp:26 epanelconf.cpp:36 epanelconf.cpp:61 epanelconf.cpp:71 +msgid "File selection..." +msgstr "Pemilihan file" + +#: epanelconf.cpp:81 +msgid "Panel settings" +msgstr "Seting panel" + +#: epanelconf.cpp:83 +msgid "&Apply" +msgstr "Ter&apkan" + +#: epanelconf.cpp:86 +msgid "&Close" +msgstr "&Tutup" + +#: epanelconf.cpp:90 +msgid "Utilities" +msgstr "Utilitas" + +#: epanelconf.cpp:91 +msgid "Panel utilities" +msgstr "Utilitas panel" + +#: epanelconf.cpp:94 +msgid "Volume control program:" +msgstr "Program pengendali volumen" + +#: epanelconf.cpp:97 epanelconf.cpp:177 +msgid "&Browse..." +msgstr "&Browse..." + +#: epanelconf.cpp:100 +msgid "Time and date program:" +msgstr "Program jam dan tanggal:" + +#: epanelconf.cpp:103 epanelconf.cpp:183 +msgid "Br&owse..." +msgstr "Br&owse..." + +#: epanelconf.cpp:108 +msgid "Autohide" +msgstr "Sembunyikan otomatis" + +#: epanelconf.cpp:111 +msgid "Automaticaly hide panel" +msgstr "Sembunyikan panel otomatis" + +#: epanelconf.cpp:117 +msgid "Workspaces" +msgstr "Ruangkerja" + +#: epanelconf.cpp:119 +msgid "Number of workspaces: " +msgstr "Jumlah ruangkerja:" + +#: epanelconf.cpp:129 +msgid "Workspace names:" +msgstr "Nama ruangkerja:" + +#: epanelconf.cpp:132 +msgid "WS 1:" +msgstr "RK 1:" + +#: epanelconf.cpp:136 +msgid "WS 2:" +msgstr "RK 2:" + +#: epanelconf.cpp:140 +msgid "WS 3:" +msgstr "RK 3:" + +#: epanelconf.cpp:144 +msgid "WS 4:" +msgstr "RK 4:" + +#: epanelconf.cpp:148 +msgid "WS 5:" +msgstr "RK 5:" + +#: epanelconf.cpp:152 +msgid "WS 6:" +msgstr "RK 6:" + +#: epanelconf.cpp:156 +msgid "WS 7:" +msgstr "RK 7:" + +#: epanelconf.cpp:160 +msgid "WS 8:" +msgstr "RK 8:" + +#: epanelconf.cpp:169 +msgid "Handlers" +msgstr "Handler" + +#: epanelconf.cpp:171 +msgid "Handlers programs" +msgstr "Program handler" + +#: epanelconf.cpp:174 +msgid "Internet browser:" +msgstr "Browser internet:" + +#: epanelconf.cpp:180 +msgid "Terminal:" +msgstr "Terminal:" diff --git a/epanelconf/locale/messages.pot b/epanelconf/locale/messages.pot new file mode 100644 index 0000000..62985bf --- /dev/null +++ b/epanelconf/locale/messages.pot @@ -0,0 +1,127 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR Free Software Foundation, Inc. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"POT-Creation-Date: 2002-10-17 18:15+0000\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=CHARSET\n" +"Content-Transfer-Encoding: 8bit\n" + +#: epanelconf.cpp:25 epanelconf.cpp:35 epanelconf.cpp:60 epanelconf.cpp:70 +msgid "Executables (*.*), *, All files (*.*), *" +msgstr "" + +#: epanelconf.cpp:26 epanelconf.cpp:36 epanelconf.cpp:61 epanelconf.cpp:71 +msgid "File selection..." +msgstr "" + +#: epanelconf.cpp:81 +msgid "Panel settings" +msgstr "" + +#: epanelconf.cpp:83 +msgid "&Apply" +msgstr "" + +#: epanelconf.cpp:86 +msgid "&Close" +msgstr "" + +#: epanelconf.cpp:90 +msgid "Utilities" +msgstr "" + +#: epanelconf.cpp:91 +msgid "Panel utilities" +msgstr "" + +#: epanelconf.cpp:94 +msgid "Volume control program:" +msgstr "" + +#: epanelconf.cpp:97 epanelconf.cpp:177 +msgid "&Browse..." +msgstr "" + +#: epanelconf.cpp:100 +msgid "Time and date program:" +msgstr "" + +#: epanelconf.cpp:103 epanelconf.cpp:183 +msgid "Br&owse..." +msgstr "" + +#: epanelconf.cpp:108 +msgid "Autohide" +msgstr "" + +#: epanelconf.cpp:111 +msgid "Automaticaly hide panel" +msgstr "" + +#: epanelconf.cpp:117 +msgid "Workspaces" +msgstr "" + +#: epanelconf.cpp:119 +msgid "Number of workspaces: " +msgstr "" + +#: epanelconf.cpp:129 +msgid "Workspace names:" +msgstr "" + +#: epanelconf.cpp:132 +msgid "WS 1:" +msgstr "" + +#: epanelconf.cpp:136 +msgid "WS 2:" +msgstr "" + +#: epanelconf.cpp:140 +msgid "WS 3:" +msgstr "" + +#: epanelconf.cpp:144 +msgid "WS 4:" +msgstr "" + +#: epanelconf.cpp:148 +msgid "WS 5:" +msgstr "" + +#: epanelconf.cpp:152 +msgid "WS 6:" +msgstr "" + +#: epanelconf.cpp:156 +msgid "WS 7:" +msgstr "" + +#: epanelconf.cpp:160 +msgid "WS 8:" +msgstr "" + +#: epanelconf.cpp:169 +msgid "Handlers" +msgstr "" + +#: epanelconf.cpp:171 +msgid "Handlers programs" +msgstr "" + +#: epanelconf.cpp:174 +msgid "Internet browser:" +msgstr "" + +#: epanelconf.cpp:180 +msgid "Terminal:" +msgstr "" diff --git a/epanelconf/locale/ru.po b/epanelconf/locale/ru.po new file mode 100644 index 0000000..13dd50f --- /dev/null +++ b/epanelconf/locale/ru.po @@ -0,0 +1,127 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR Free Software Foundation, Inc. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"POT-Creation-Date: 2002-04-21 14:09+0200\n" +"PO-Revision-Date: 2002-11-28 HO:MI+ZONE\n" +"Last-Translator: aabbvv \n" +"Language-Team: RUSSIAN \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=koi8-r\n" +"Content-Transfer-Encoding: 8bit\n" + +#: epanelconf.cpp:25 epanelconf.cpp:35 epanelconf.cpp:60 epanelconf.cpp:70 +msgid "Executables (*.*), *, All files (*.*), *" +msgstr " (*.*), *, (*.*), *" + +#: epanelconf.cpp:26 epanelconf.cpp:36 epanelconf.cpp:61 epanelconf.cpp:71 +msgid "File selection..." +msgstr " ..." + +#: epanelconf.cpp:81 +msgid "Panel settings" +msgstr " " + +#: epanelconf.cpp:83 +msgid "&Apply" +msgstr "" + +#: epanelconf.cpp:86 +msgid "&Close" +msgstr "" + +#: epanelconf.cpp:90 +msgid "Utilities" +msgstr "" + +#: epanelconf.cpp:91 +msgid "Panel utilities" +msgstr " " + +#: epanelconf.cpp:94 +msgid "Volume control program:" +msgstr " :" + +#: epanelconf.cpp:97 epanelconf.cpp:177 +msgid "&Browse..." +msgstr "..." + +#: epanelconf.cpp:100 +msgid "Time and date program:" +msgstr ":" + +#: epanelconf.cpp:103 epanelconf.cpp:183 +msgid "Br&owse..." +msgstr "..." + +#: epanelconf.cpp:108 +msgid "Autohide" +msgstr "" + +#: epanelconf.cpp:111 +msgid "Automaticaly hide panel" +msgstr " " + +#: epanelconf.cpp:117 +msgid "Workspaces" +msgstr " " + +#: epanelconf.cpp:119 +msgid "Number of workspaces: " +msgstr ":" + +#: epanelconf.cpp:129 +msgid "Workspace names:" +msgstr ":" + +#: epanelconf.cpp:132 +msgid "WS 1:" +msgstr "" + +#: epanelconf.cpp:136 +msgid "WS 2:" +msgstr "" + +#: epanelconf.cpp:140 +msgid "WS 3:" +msgstr "" + +#: epanelconf.cpp:144 +msgid "WS 4:" +msgstr "" + +#: epanelconf.cpp:148 +msgid "WS 5:" +msgstr "" + +#: epanelconf.cpp:152 +msgid "WS 6:" +msgstr "" + +#: epanelconf.cpp:156 +msgid "WS 7:" +msgstr "" + +#: epanelconf.cpp:160 +msgid "WS 8:" +msgstr "" + +#: epanelconf.cpp:169 +msgid "Handlers" +msgstr "" + +#: epanelconf.cpp:171 +msgid "Handlers programs" +msgstr " " + +#: epanelconf.cpp:174 +msgid "Internet browser:" +msgstr " :" + +#: epanelconf.cpp:180 +msgid "Terminal:" +msgstr ":" diff --git a/epanelconf/locale/sk.po b/epanelconf/locale/sk.po new file mode 100644 index 0000000..35a5246 --- /dev/null +++ b/epanelconf/locale/sk.po @@ -0,0 +1,127 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR Free Software Foundation, Inc. +# FIRST AUTHOR , YEAR. +# +msgid "" +msgstr "" +"Project-Id-Version: epanelconf 1.0\n" +"POT-Creation-Date: 2002-04-21 14:09+0200\n" +"PO-Revision-Date: 2002-04-21 14:50+0200\n" +"Last-Translator: Martin Pekar \n" +"Language-Team: Slovak \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: epanelconf.cpp:26 epanelconf.cpp:36 +msgid "File selection..." +msgstr "Výber súboru..." + +#: epanelconf.cpp:60 +msgid "Panel settings" +msgstr "Nastavenia panelu" + +#: epanelconf.cpp:62 +msgid "&Apply" +msgstr "&Použiť" + +#: epanelconf.cpp:66 +msgid "&Close" +msgstr "&Zavrieť" + +#: epanelconf.cpp:71 +msgid "Utilities" +msgstr "Pomôcky" + +#: epanelconf.cpp:72 +msgid "Panel utilities" +msgstr "Pomôcky panelu" + +#: epanelconf.cpp:75 +msgid "Volume control program:" +msgstr "Program nastavenia hlasitosti:" + +#: epanelconf.cpp:79 +msgid "&Browse..." +msgstr "&Zvoliť..." + +#: epanelconf.cpp:83 +msgid "Time and date program:" +msgstr "Program nastavenia času a dátumu:" + +#: epanelconf.cpp:87 +msgid "Br&owse..." +msgstr "Zv&oliť..." + +#: epanelconf.cpp:94 +msgid "Autohide" +msgstr "Automatické skrytie" + +#: epanelconf.cpp:97 +msgid "Automaticaly hide panel" +msgstr "Automaticky skryť panel" + +#: epanelconf.cpp:106 +msgid "Workspaces" +msgstr "Pracovné plochy" + +#: epanelconf.cpp:108 +msgid "Number of workspaces: " +msgstr "Počet pracovných plôch: " + +#: epanelconf.cpp:118 +msgid "Workspace names:" +msgstr "Názvy pracovných plôch:" + +#: epanelconf.cpp:121 +msgid "WS 1:" +msgstr "PP 1:" + +#: epanelconf.cpp:125 +msgid "WS 2:" +msgstr "PP 2:" + +#: epanelconf.cpp:129 +msgid "WS 3:" +msgstr "PP 3:" + +#: epanelconf.cpp:133 +msgid "WS 4:" +msgstr "PP 4:" + +#: epanelconf.cpp:137 +msgid "WS 5:" +msgstr "PP 5:" + +#: epanelconf.cpp:141 +msgid "WS 6:" +msgstr "PP 6:" + +#: epanelconf.cpp:145 +msgid "WS 7:" +msgstr "PP 7:" + +#: epanelconf.cpp:149 +msgid "WS 8:" +msgstr "PP 8:" + +#: epanelconf.cpp:169 +msgid "Handlers" +msgstr "Správcovia" + +#: epanelconf.cpp:171 +msgid "Handlers programs" +msgstr "Programy správy" + +#: epanelconf.cpp:174 +msgid "Internet browser:" +msgstr "Internetový prehliadač:" + +#: epanelconf.cpp:180 +msgid "Terminal:" +msgstr "Terminál:" + +#: epanelconf.cpp:25 epanelconf.cpp:35 epanelconf.cpp:60 epanelconf.cpp:70 +msgid "Executables (*.*), *, All files (*.*), *" +msgstr "Spustiteľné (*.*), *, Všetky súbory (*.*), *" + diff --git a/epanelconf/locale/sr.po b/epanelconf/locale/sr.po new file mode 100644 index 0000000..9748a91 --- /dev/null +++ b/epanelconf/locale/sr.po @@ -0,0 +1,135 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR Free Software Foundation, Inc. +# FIRST AUTHOR , YEAR. +# +msgid "" +msgstr "" +"Project-Id-Version: epanelconf 1.0\n" +"POT-Creation-Date: 2002-10-17 18:15+0000\n" +"PO-Revision-Date: 2002-11-30 02:04+0100\n" +"Last-Translator: Dejan Lekic \n" +"Language-Team: LINUKS.org T.T. \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: epanelconf.cpp:25 +#: epanelconf.cpp:35 +#: epanelconf.cpp:60 +#: epanelconf.cpp:70 +msgid "Executables (*.*), *, All files (*.*), *" +msgstr "Извршни фајлови (*.*), *, Сви фајлови (*.*), *" + +#: epanelconf.cpp:26 +#: epanelconf.cpp:36 +#: epanelconf.cpp:61 +#: epanelconf.cpp:71 +msgid "File selection..." +msgstr "Селектовање фајла..." + +#: epanelconf.cpp:81 +msgid "Panel settings" +msgstr "Особине панела" + +#: epanelconf.cpp:83 +msgid "&Apply" +msgstr "&Примени" + +#: epanelconf.cpp:86 +msgid "&Close" +msgstr "&Затвори" + +#: epanelconf.cpp:90 +msgid "Utilities" +msgstr "Помоћни алати" + +#: epanelconf.cpp:91 +msgid "Panel utilities" +msgstr "Помоћни алати за панел" + +#: epanelconf.cpp:94 +msgid "Volume control program:" +msgstr "Програм за контролу јачине звука:" + +#: epanelconf.cpp:97 +#: epanelconf.cpp:177 +msgid "&Browse..." +msgstr "&Нађи..." + +#: epanelconf.cpp:100 +msgid "Time and date program:" +msgstr "Време и датум - програм:" + +#: epanelconf.cpp:103 +#: epanelconf.cpp:183 +msgid "Br&owse..." +msgstr "&Нађи..." + +#: epanelconf.cpp:108 +msgid "Autohide" +msgstr "Аутоскривање" + +#: epanelconf.cpp:111 +msgid "Automaticaly hide panel" +msgstr "Аутоматски сакриј панел" + +#: epanelconf.cpp:117 +msgid "Workspaces" +msgstr "Радне површине" + +#: epanelconf.cpp:119 +msgid "Number of workspaces: " +msgstr "Број радних површина:" + +#: epanelconf.cpp:129 +msgid "Workspace names:" +msgstr "Имена радних површина:" + +#: epanelconf.cpp:132 +msgid "WS 1:" +msgstr "РП 1:" + +#: epanelconf.cpp:136 +msgid "WS 2:" +msgstr "РП 2:" + +#: epanelconf.cpp:140 +msgid "WS 3:" +msgstr "РП 3:" + +#: epanelconf.cpp:144 +msgid "WS 4:" +msgstr "РП 4:" + +#: epanelconf.cpp:148 +msgid "WS 5:" +msgstr "РП 5:" + +#: epanelconf.cpp:152 +msgid "WS 6:" +msgstr "РП 6:" + +#: epanelconf.cpp:156 +msgid "WS 7:" +msgstr "РП 7:" + +#: epanelconf.cpp:160 +msgid "WS 8:" +msgstr "РП 8:" + +#: epanelconf.cpp:169 +msgid "Handlers" +msgstr "Хендлери" + +#: epanelconf.cpp:171 +msgid "Handlers programs" +msgstr "Програми-хендлери" + +#: epanelconf.cpp:174 +msgid "Internet browser:" +msgstr "Интернет браузер:" + +#: epanelconf.cpp:180 +msgid "Terminal:" +msgstr "Терминал:" + diff --git a/epanelconf/util.cpp b/epanelconf/util.cpp new file mode 100644 index 0000000..3a6d235 --- /dev/null +++ b/epanelconf/util.cpp @@ -0,0 +1,347 @@ +/* + * $Id$ + * + * Configure window for eworkpanel + * Part of Equinox Desktop Environment (EDE). + * Copyright (c) 2000-2006 EDE Authors. + * + * This program is licenced under terms of the + * GNU General Public Licence version 2 or newer. + * See COPYING for details. + */ + +#include "epanelconf.h" + +#include +#include +//#include +#include "../edelib2/Config.h" +//#include + +using namespace fltk; +using namespace edelib; + + + +extern Input *workspaces[8]; + +void read_config() +{ + char temp_value[128]; + bool temp_bool=0; + Config cfg(Config::find_file("ede.conf", 0)); + cfg.set_section("Panel"); + + if(!cfg.read("Volume Control", temp_value, 0, sizeof(temp_value))) { + vcProgram->value(temp_value); + } + + if(!cfg.read("Time and date", temp_value, 0, sizeof(temp_value))) { + tdProgram->value(temp_value); + } + + cfg.read("AutoHide", temp_bool, false); + autohide_check->value(temp_bool); + + cfg.set_section("Web"); + if(!cfg.read("Browser", temp_value, 0, sizeof(temp_value))) { + browserProgram->value(temp_value); + } + + cfg.set_section("Terminal"); + if(!cfg.read("Terminal", temp_value, 0, sizeof(temp_value))) { + terminalProgram->value(temp_value); + } + +} + +void write_config() +{ + Config cfg(Config::find_file("ede.conf", 0)); + cfg.set_section("Panel"); + cfg.write("Volume Control", vcProgram->value()); + cfg.write("Time and date", tdProgram->value()); + cfg.write("AutoHide", autohide_check->value()); + + cfg.set_section("Web"); + cfg.write("Browser", browserProgram->value()); + cfg.set_section("Terminal"); + cfg.write("Terminal", terminalProgram->value()); + + // Write workspace names to file, edewm will read and set on startup + cfg.set_section("Workspaces"); + cfg.write("Count", int(ws_slider->value())); + for(int n=0; n<8; n++) { + char tmp[128]; snprintf(tmp, sizeof(tmp)-1, "Workspace%d", n+1); + cfg.write(tmp, workspaces[n]->value()); + } +} + +/* +// This was an attempt to separate code into Fl_WM class +// For the moment, we abandon this attempt + +void get_workspaces(Fl_CString_List &desktops, int &count); +void update_workspaces() +{ + Fl_CString_List desktops; + desktops.auto_delete(true); + + int count; + get_workspaces(desktops, count); + if(count>8) count=8; + for(int n=0; n<8; n++) { + const char *name = desktops.item(n); + Fl_Input *i = workspaces[n]; + if(nactivate(); + if(name) { + i->value(name); + } else { + char tmp[128]; + snprintf(tmp, sizeof(tmp)-1, "%s %d", "Workspace" ,n+1); + i->value(tmp); + } + } + ws_slider->value(count); + desktops.clear(); +}*/ + +///////////////////////////////////// +///////////////////////////////////// +// Code for setting desktop names using NET-WM + +static bool atoms_inited=false; + +// NET-WM spec desktop atoms +static Atom _XA_NET_NUM_DESKTOPS; +static Atom _XA_NET_DESKTOP_NAMES; +// GNOME atoms: +static Atom _XA_WIN_WORKSPACE_COUNT; +static Atom _XA_WIN_WORKSPACE_NAMES; + +static void init_atoms() +{ + if(atoms_inited) return; + open_display(); + +#define A(name) XInternAtom(xdisplay, name, False) + + _XA_NET_NUM_DESKTOPS = A("_NET_NUMBER_OF_DESKTOPS"); + _XA_NET_DESKTOP_NAMES = A("_NET_DESKTOP_NAMES"); + + _XA_WIN_WORKSPACE_COUNT = A("_WIN_WORKSPACE_COUNT"); + _XA_WIN_WORKSPACE_NAMES = A("_WIN_WORKSPACE_NAMES"); + + atoms_inited=true; +} + +void* getProperty(XWindow w, Atom a, Atom type, unsigned long* np=0) +{ + Atom realType; + int format; + unsigned long n, extra; + int status; + void* prop; + status = XGetWindowProperty(xdisplay, w, + a, 0L, 256L, False, type, &realType, + &format, &n, &extra, (uchar**)&prop); + if (status != Success) return 0; + if (!prop) return 0; + if (!n) {XFree(prop); return 0;} + if (np) *np = n; + return prop; +} + +int getIntProperty(XWindow w, Atom a, Atom type, int deflt) { + void* prop = getProperty(w, a, type); + if(!prop) return deflt; + int r = int(*(long*)prop); + XFree(prop); + return r; +} + +void setProperty(XWindow w, Atom a, Atom type, int v) { + long prop = v; + XChangeProperty(xdisplay, w, a, type, 32, PropModeReplace, (uchar*)&prop,1); +} + +//void get_workspaces(Fl_CString_List &desktops, int &count) +void update_workspaces() +{ + init_atoms(); + + int count = 0; + int current = 0; +// desktops.clear(); +// desktops.auto_delete(true); + + int length=0; + char *buffer=0; + + XTextProperty names; + // First try to get NET desktop names + XGetTextProperty(xdisplay, RootWindow(xdisplay, xscreen), &names, _XA_NET_DESKTOP_NAMES); + // If not found, look for GNOME ones + if(!names.value) XGetTextProperty(xdisplay, RootWindow(xdisplay, xscreen), &names, _XA_WIN_WORKSPACE_NAMES); + buffer = (char *)names.value; + length = names.nitems; + + if(buffer) { + char* c = buffer; + for (int i = 1; c < buffer+length; i++) { + char* d = c; + while(*d) d++; + if(*c != '<') { + if(strcmp(c, "") != 0) { + Input *i = workspaces[current]; + i->activate(); + i->value(strdup(c)); + current++; + } + } + c = d+1; + } + XFree(names.value); + } + + count = getIntProperty(RootWindow(xdisplay, xscreen), _XA_NET_NUM_DESKTOPS, XA_CARDINAL, -1); + if(count<0) count = getIntProperty(RootWindow(xdisplay, xscreen), _XA_WIN_WORKSPACE_COUNT, XA_CARDINAL, -1); + + // FIXME: What to do with count now? +} + + + +// Code taken from FL_WM.cpp +Atom _XA_NET_SUPPORTED = 0; +Atom _XA_NET_SUPPORTING_WM_CHECK = 0; + +XWindow fl_wmspec_check_window = None; +bool fl_netwm_supports(Atom &xproperty) +{ + // Vedran: -manual atoms initing: + _XA_NET_SUPPORTING_WM_CHECK = A("_NET_SUPPORTING_WM_CHECK"); + _XA_NET_SUPPORTED = A("_NET_SUPPORTED"); + + static Atom *atoms = NULL; + static int natoms = 0; + + Atom type; + int format; + ulong nitems; + ulong bytes_after; + XWindow *xwindow; + + if(fl_wmspec_check_window != None) { + if(atoms == NULL) + return false; + for(int i=0; ivalue()); + + // Tell windowmanager to update its internal desktop count + //Fl_WM::set_workspace_count(cnt); + fl_set_workspace_count(cnt); + + char *ws_names[8]; + for(int n=0; nvalue(), "")) { + char tmp[128]; + snprintf(tmp, sizeof(tmp)-1, "%s %d", "Workspace", n+1); + ws_names[n] = strdup(tmp); + } else + ws_names[n] = strdup(workspaces[n]->value()); + } + + XTextProperty names; + if(XStringListToTextProperty((char **)ws_names, cnt, &names)) { + XSetTextProperty(xdisplay, RootWindow(xdisplay, xscreen), &names, _XA_NET_DESKTOP_NAMES); + XSetTextProperty(xdisplay, RootWindow(xdisplay, xscreen), &names, _XA_WIN_WORKSPACE_NAMES); + XFree(names.value); + } +} diff --git a/epanelconf/util.h b/epanelconf/util.h new file mode 100644 index 0000000..f7d4137 --- /dev/null +++ b/epanelconf/util.h @@ -0,0 +1,22 @@ +/* + * $Id$ + * + * Configure window for eworkpanel + * Part of Equinox Desktop Environment (EDE). + * Copyright (c) 2000-2006 EDE Authors. + * + * This program is licenced under terms of the + * GNU General Public Licence version 2 or newer. + * See COPYING for details. + */ + +#ifndef util_h +#define util_h + +extern void read_config(); +extern void write_config(); + +extern void update_workspaces(); +extern void send_workspaces(); + +#endif diff --git a/esvrconf/Jamfile b/esvrconf/Jamfile new file mode 100644 index 0000000..7dee57d --- /dev/null +++ b/esvrconf/Jamfile @@ -0,0 +1,16 @@ +# +# $Id$ +# +# Part of Equinox Desktop Environment (EDE). +# Copyright (c) 2000-2007 EDE Authors. +# +# This program is licenced under terms of the +# GNU General Public Licence version 2 or newer. +# See COPYING for details. + +SubDir TOP eimage ; + +SOURCE = escreensaver.cpp escrsaverconf.cpp ; + +MakeProgram esvrconf : $(SOURCE) ; +ExtractStrings locale : $(SOURCE) ; diff --git a/esvrconf/Makefile b/esvrconf/Makefile new file mode 100644 index 0000000..111bf76 --- /dev/null +++ b/esvrconf/Makefile @@ -0,0 +1,21 @@ + +CPPFILES = escreensaver.cpp escrsaverconf.cpp ../edelib2/Util.cpp ../edelib2/Config.cpp +TARGET = esvrconf + +POFILES = locale/ru.po\ + locale/sk.po\ + locale/hu.po\ + +include ../makeinclude + +install: + $(INSTALL_PROGRAM) $(TARGET) $(bindir) + $(INSTALL_LOCALE) + +uninstall: + $(RM) $(bindir)/$(TARGET) + +clean: + $(RM) $(TARGET) + $(RM) *.o + diff --git a/esvrconf/ehacklist.h b/esvrconf/ehacklist.h new file mode 100644 index 0000000..dd15f4e --- /dev/null +++ b/esvrconf/ehacklist.h @@ -0,0 +1,207 @@ +/* + * $Id$ + * + * Screensaver configuration + * Part of Equinox Desktop Environment (EDE). + * Copyright (c) 2000-2006 EDE Authors. + * + * This program is licenced under terms of the + * GNU General Public Licence version 2 or newer. + * See COPYING for details. + */ + + +// This is from xscreensaver 4.0 XScreenSaver.ad + +char hacks[] = " \ + \"Qix (solid)\" qix -root -solid -segments 100 \n\ + \"Qix (transparent)\" qix -root -count 4 -solid -transparent \n\ + \"Qix (linear)\" qix -root -count 5 -solid -transparent \ + -linear -segments 250 -size 100 \n\ +- mono: \"Qix (xor)\" qix -root -linear -count 5 -size 200 \ + -spread 30 -segments 75 -solid -xor \n\ + \ + \"Attraction (balls)\" attraction -root -mode balls \n\ + \"Attraction (lines)\" attraction -root -mode lines -points 3\ + -segments 200 \n\ +- \"Attraction (poly)\" attraction -root -mode polygons \n\ + \"Attraction (splines)\" attraction -root -mode splines -segments \ + 300 \n\ + \"Attraction (orbital)\" attraction -root -mode lines -radius 300 \ + -orbit -vmult 0.5 \n\ + \ + pyro -root \n\ + rocks -root \n\ + helix -root \n\ + pedal -root \n\ + rorschach -root -offset 7 \n\ + hopalong -root \n\ + greynetic -root \n\ + imsmap -root \n\ + slidescreen -root \n\ + decayscreen -root \n\ + jigsaw -root \n\ + blitspin -root -grab \n\ + slip -root \n\ + distort -root \n\ + spotlight -root \n\ + \"Ripples (oily)\" ripples -root -oily -light 2 \n\ + \"Ripples (stir)\" ripples -root -oily -light 2 -stir \n\ + \"Ripples (desktop)\" ripples -root -water -light 6 \n\ + hypercube -root \n\ + hyperball -root \n\ + halo -root \n\ + maze -root \n\ + noseguy -root \n\ + flame -root \n\ + lmorph -root \n\ + deco -root \n\ + moire -root \n\ + moire2 -root \n\ + lightning -root \n\ + strange -root \n\ + spiral -root \n\ + laser -root \n\ + grav -root \n\ + \"Grav (trails)\" grav -root -trail -decay \n\ + drift -root \n\ + ifs -root \n\ + julia -root \n\ + penrose -root \n\ + sierpinski -root \n\ + braid -root \n\ + galaxy -root \n\ + bouboule -root \n\ + swirl -root \n\ + flag -root \n\ + sphere -root \n\ + forest -root \n\ + lisa -root \n\ + lissie -root \n\ + goop -root -max-velocity 0.5 -elasticity \ + 0.9 \n\ + starfish -root \n\ + \"Starfish (blob)\" starfish -root -blob \n\ + munch -root \n\ + fadeplot -root \n\ + coral -root -delay 0 \n\ + mountain -root \n\ + triangle -root -delay 1 \n\ + worm -root \n\ + rotor -root \n\ + ant -root \n\ + demon -root \n\ + loop -root \n\ + vines -root \n\ + kaleidescope -root \n\ + xjack -root \n\ + xlyap -root -randomize \n\ + cynosure -root \n\ + flow -root \n\ + epicycle -root \n\ + interference -root \n\ + truchet -root -randomize \n\ + bsod -root \n\ + crystal -root \n\ + discrete -root \n\ + kumppa -root \n\ + rd-bomb -root \n\ + \"RD-Bomb (mobile)\" rd-bomb -root -speed 1 -size 0.1 \n\ + sonar -root \n\ + t3d -root \n\ + penetrate -root \n\ + deluxe -root \n\ + compass -root \n\ + squiral -root \n\ + xflame -root \n\ + wander -root \n\ + \"Wander (spots)\" wander -root -advance 0 -size 10 -circles \ + -length 10000 -reset 100000 \n\ + critical -root \n\ + phosphor -root \n\ + xmatrix -root \n\ + petri -root -size 2 -count 20 \n\ + \"Petri 2\" petri -root -minlifespeed 0.02 \ + -maxlifespeed 0.03 -minlifespan 1 \ + -maxlifespan 1 -instantdeathchan 0 \ + -minorchan 0 -anychan 0.3 \n\ + shadebobs -root \n\ + ccurve -root \n\ + blaster -root \n\ + bumps -root \n\ + xteevee -root \n\ + xspirograph -root \n\ + nerverot -root \n\ +- \"NerveRot (dense)\" nerverot -root -count 1000 \n\ +- \"NerveRot (thick)\" nerverot -root -count 100 -line-width 4 \ + -max-nerve-radius 0.8 -nervousness 0.5 -db \n\ + xrayswarm -root \n\ +- \"Zoom (Fatbits)\" zoom -root \n\ + \"Zoom (Lenses)\" zoom -root -lenses \n\ + rotzoomer -root \n\ +- \"RotZoomer (mobile)\" rotzoomer -root -move \n\ +- \"RotZoomer (sweep)\" rotzoomer -root -sweep \n\ + whirlwindwarp -root \n\ + \"WhirlyGig\" whirlygig -root \n\ + \"SpeedMine\" speedmine -root \n\ + \"SpeedWorm\" speedmine -root -worm \n\ + vermiculate -root \n\ + color: bubbles -root \n\ + default-n: webcollage -root \n\ + default-n: \"WebCollage (whacked)\" \ + webcollage -root -filter \ + 'vidwhacker -stdin -stdout' \n\ +- default-n: vidwhacker -root \n\ + \ + GL: gears -root \n\ + GL: \"Gears (planetary)\" gears -root -planetary \n\ + GL: superquadrics -root \n\ + GL: morph3d -root \n\ + GL: cage -root \n\ + GL: moebius -root \n\ + GL: stairs -root \n\ + GL: pipes -root \n\ + GL: sproingies -root \n\ + GL: rubik -root \n\ + GL: atlantis -root \n\ + GL: lament -root \n\ + GL: bubble3d -root \n\ + GL: glplanet -root \n\ + GL: pulsar -root \n\ +- GL: \"Pulsar (textures)\" \ + pulsar -root -texture -mipmap \ + -texture_quality -light -fog \n\ +- GL: extrusion -root \n\ + GL: sierpinski3d -root \n\ + GL: menger -root \n\ + GL: \"GFlux\" gflux -root \n\ + GL: \"GFlux (grab)\" gflux -root -mode grab \n\ + GL: stonerview -root \n\ + GL: starwars -root \n\ + GL: gltext -root \n\ + GL: \"GLText (clock)\" gltext -text \"%A%n%d %b %Y%n%r\" -root \n\ + GL: \"Molecule\" molecule -root \n\ + GL: \"Molecule (lumpy)\" molecule -root -no-bonds -no-labels \n\ + GL: dangerball -root \n\ + GL: circuit -root \n\ + GL: engine -root \n\ + GL: flipscreen3d -root \n\ + \ +- xdaliclock -root -builtin3 -cycle \n\ +- default-n: xearth -nofork -nostars -ncolors 50 \ + -night 3 -wait 0 -timewarp 400.0 -pos \ + sunrel/38/-30 \n\ +- xplanetbg -xscreensaver -moonside \ + -markerfile earth -wait 1 -timewarp 400 \n\ +- ssystem -fullscreen :32 \n\ +- xmountains -b -M -Z 0 -r 1 \n\ +- \"XMountains (top)\" xmountains -b -M -Z 0 -r 1 -m \n\ +- xaos -fullscreen -autopilot \ + -incoloring -1 -outcoloring -1 \n\ +- xfishtank -d -s \n\ +- xsnow \n\ +- goban -root \n\ +- electricsheep \n\ +- cosmos -root \n\ +- GL: sphereEversion --root \n"; + diff --git a/esvrconf/escreensaver.cpp b/esvrconf/escreensaver.cpp new file mode 100644 index 0000000..bfef92a --- /dev/null +++ b/esvrconf/escreensaver.cpp @@ -0,0 +1,514 @@ +/* + * $Id$ + * + * Screensaver configuration + * Part of Equinox Desktop Environment (EDE). + * Copyright (c) 2000-2006 EDE Authors. + * + * This program is licenced under terms of the + * GNU General Public Licence version 2 or newer. + * See COPYING for details. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "../edeconf.h" +// blah + +/*#include +#include +#include +#include */ + +#include +//#include +#include +#include +#include +#include "../edelib2/Config.h" + +#include "escreensaver.h" +#include "escrsaverconf.h" +#include "ehacklist.h" + + +using namespace fltk; +using namespace edelib; + + + + + +int running_saver = 0; +pid_t running_preview_pid = 0; +int default_saver = 0; + +typedef struct screenhack screenhack; +struct screenhack +{ + bool enabled_p; + char *visual; + char *name; + char *command; +}; + +struct saver_preferences +{ + screenhack **screenhacks; /* the scrsavers to run */ + int screenhacks_count; +}; + +char* format_command(const char *cmd, bool wrap_p); + +/* Returns a new string describing the shell command. + This may be just the name of the program, capitalized. + It also may be something from the resource database (gotten + by looking for "hacks.XYZ.name", where XYZ is the program.) + */ +char* make_hack_name(const char *shell_command) +{ + char *s = strdup (shell_command); + char *s2; + + for (s2 = s; *s2; s2++) /* truncate at first whitespace */ + if (isspace (*s2)) + { + *s2 = 0; + break; + } + + s2 = strrchr (s, '/'); /* if pathname, take last component */ + if (s2) + { + s2 = strdup (s2+1); + free (s); + s = s2; + } + + if (strlen (s) > 50) /* 51 is hereby defined as "unreasonable" */ + s[50] = 0; + + for (s2 = s; *s2; s2++) /* if it has any capitals, return it */ + if (*s2 >= 'A' && *s2 <= 'Z') + return s; + + /* else cap it */ + if (s[0] >= 'a' && s[0] <= 'z') + s[0] -= 'a'-'A'; + /* (magic leading X) */ + if (s[0] == 'X' && s[1] >= 'a' && s[1] <= 'z') + s[1] -= 'a'-'A'; + return s; +} + + +//Parsing scrsavers + +screenhack* parse_screenhack(const char *line) +{ + screenhack *h = (screenhack *) calloc (1, sizeof(*h)); + const char *s; + + h->enabled_p = true; + + /* skip whitespace */ + while (isspace(*line)) line++; + if (*line == '-') /* handle "-" */ + { + h->enabled_p = false; + line++; + /* skip whitespace */ + while (isspace(*line)) line++; + } + + s = line; /* handle "visual:" */ + while (*line && *line != ':' && *line != '"' && !isspace(*line)) + line++; + if (*line != ':') + line = s; + else + { + h->visual = (char *) malloc (line-s+1); + strncpy (h->visual, s, line-s); + h->visual[line-s] = 0; + if (*line == ':') line++;/* skip ":" */ + /* skip whitespace */ + while (isspace(*line)) line++; + } + + if (*line == '"') /* handle "name" */ + { + line++; + s = line; + while (*line && *line != '"') + line++; + h->name = (char *) malloc (line-s+1); + strncpy(h->name, s, line-s); + h->name[line-s] = 0; + if (*line == '"') line++;/* skip "\"" */ + /* skip whitespace */ + while (isspace(*line)) line++; + } + + /* handle command */ + h->command = format_command(line, false); + return h; +} + + +char* format_command(const char *cmd, bool wrap_p) +{ + int tab = 30; + int col = tab; + char *cmd2 = (char *) calloc (1, 2 * (strlen (cmd) + 1)); + const char *in = cmd; + char *out = cmd2; + while (*in) + { + /* shrink all whitespace to one space, for the benefit of the "demo" + mode display. We only do this when we can easily tell that the + whitespace is not significant (no shell metachars). + */ + switch (*in) + { + case '\'': case '"': case '`': case '\\': + /* Metachars are scary. Copy the rest of the line unchanged. */ + while (*in) + *out++ = *in++, col++; + break; + + case ' ': case '\t': + /* Squeeze all other whitespace down to one space. */ + while (*in == ' ' || *in == '\t') + in++; + *out++ = ' ', col++; + break; + + default: + /* Copy other chars unchanged. */ + *out++ = *in++, col++; + break; + } + } + + *out = 0; + + /* Strip trailing whitespace */ + while (out > cmd2 && isspace (out[-1])) + *(--out) = 0; + + return cmd2; +} + + +static struct saver_preferences p; + +void getScreenhacks() +{ + int i, j; + int start = 0; + int end = 0; + int size; + char *d = hacks; + + p.screenhacks = 0; + p.screenhacks_count = 0; + + if (!d || !*d) + return; + + size = strlen (d); + + /* Count up the number of newlines (which will be equal to or larger than + one less than the number of hacks.) + */ + + for (i = j = 0; d[i]; i++) + { + if (d[i] == '\n') j++; + } + + j++; + + p.screenhacks = (screenhack **) calloc (j + 1, sizeof (screenhack *)); + + /* Iterate over the lines in `d' (the string with newlines) + and make new strings to stuff into the `screenhacks' array. + */ + p.screenhacks_count = 0; + while (start < size) + { + // skip forward over whitespace. + while (d[start] == ' ' || d[start] == '\t' || d[start] == '\n') + start++; + + // skip forward to newline or end of string. + end = start; + while (d[end] != 0 && d[end] != '\n') + end++; + + // null terminate + d[end] = '\0'; + + p.screenhacks[p.screenhacks_count++] = parse_screenhack (d + start); + if (p.screenhacks_count >= i) + abort(); + + start = end+1; + } + + if (p.screenhacks_count == 0) + { + free(p.screenhacks); + p.screenhacks = 0; + } +} + + +void free_screenhack(screenhack *hack) +{ + if (hack->visual) free (hack->visual); + if (hack->name) free (hack->name); + free(hack->command); + memset(hack, 0, sizeof(*hack)); + free (hack); +} + +static void free_screenhack_list(screenhack **list, int count) +{ + int i; + if (!list) return; + for (i = 0; i < count; i++) + if (list[i]) free_screenhack (list[i]); + free (list); +} + +Config config("EDE Team", "escrsaver"); + +void readConfiguration() +{ + int cdefserver = 0; + config.get("Saver", "Active", cdefserver); + + if (!config.error()) + { + default_saver = cdefserver; + saversList->text(saversList->child(default_saver)->label()); + } + + int ctimeout = 0; + config.get("Saver", "Timeout", ctimeout, 1); + if (!config.error()) timeoutSlider->value(ctimeout); + + int cdpmsOn = 0; + config.get("DPMS", "On", cdpmsOn); + if (!config.error()) {enableDPMSCheck->value(cdpmsOn); enableDPMSCheck->do_callback();} + + int cdpmsStandby = 0; config.get("DPMS", "Standby", cdpmsStandby); + if (!config.error()) standbySlider->value(cdpmsStandby); + + int cdpmsSuspend = 0; + config.get("DPMS", "Suspend", cdpmsSuspend); + if (!config.error()) suspendSlider->value(cdpmsSuspend); + + int cdpmsOff = 0; + config.get("DPMS", "Off", cdpmsOff); + if (!config.error()) offSlider->value(cdpmsOff); +} + + +void writeConfiguration() +{ +// FLE_Config config(fle_find_config_file("apps/escrsaver.conf", 1)); + config.create_section("Saver"); + config.set_section("Saver"); + + config.write("Active", saversList->item() ? (int)saversList->item()->user_data() : default_saver); + + config.write("Timeout", timeoutSlider->value()); + config.create_section("DPMS"); + config.set_section("DPMS"); + config.write("On", enableDPMSCheck->value()); + config.write("Standby", standbySlider->value()); + config.write("Suspend", suspendSlider->value()); + config.write("Off", offSlider->value()); + + writeConfigurationSaver(); +} + + +void writeConfigurationSaver() +{ + char *home = getenv("HOME"); + char *path = (char*)malloc(200); + snprintf(path,200,"%s/.xscreensaver", home); + delete [] home; + + FILE *config = fopen(path, "w+"); + + delete [] path; + + fprintf(config, "timeout: 0:%d:00\n", (int) timeoutSlider->value()); + fprintf(config, "dpmsEnabled: %s\n", enableDPMSCheck->value() ? "True" : "False"); + + fprintf(config, "dpmsStandby: 0:%d:00\n", (int) standbySlider->value()); + fprintf(config, "dpmsSuspend: 0:%d:00\n", (int) suspendSlider->value()); + fprintf(config, "dpmsOff: 0:%d:00\n", (int) offSlider->value()); + + fprintf(config, "mode: one\n"); + + + fprintf(config, "selected: %d\n", 0); + + fprintf(config, "programs: \"%s\" %s\n", saversList->item() ? + (char*)p.screenhacks[(int)saversList->item()->user_data()]->name : + (char*)p.screenhacks[default_saver]->name, + saversList->item() ? + (char*)p.screenhacks[(int)saversList->item()->user_data()]->command : + (char*)p.screenhacks[default_saver]->command + ); + + fclose(config); + +} + + +void clearOnExit() +{ + free_screenhack_list(p.screenhacks, p.screenhacks_count); + exit(0); +} + + +static void killPreviewSubproc() +{ + if (running_preview_pid) + { + kill(running_preview_pid, SIGTERM); + running_preview_pid = 0; + } + running_saver = 0; +} + + +void launchPreviewSubprocess(char *new_cmd) +{ + extern char **environ; + pid_t forked; + + if (running_preview_pid) + { + killPreviewSubproc(); + } + + switch ((int) (forked = fork ())) + { + case -1: + { + alert(_("Couldn't fork screensaver subprocess.")); + return; + } + case 0: + { + usleep(250000); + char *argv[4]; + argv[0] = "sh"; + argv[1] = "-c"; + argv[2] = new_cmd; + argv[3] = NULL; + if (execve("/bin/sh", argv, environ) == -1) + alert(_("Couldn't fork shell subprocess.")); + exit(1); + break; + } + default: + running_preview_pid = forked; + break; + } +} + +// fill combo box with scrsavers names +// TODO: read screensavers actually installed on the system +void fillSaversList(InputBrowser *browser) +{ + for (int i = 0; i < p.screenhacks_count; i++) + { + browser->begin(); + Item *item = 0; + if (!(p.screenhacks[i]->name)) // if scrsaver do not have the name + { + item = new Item(make_hack_name(p.screenhacks[i]->command)); + } + else item = new Item(p.screenhacks[i]->name); + + item->user_data((void*) i); + item->activate(p.screenhacks[i]->enabled_p); + browser->end(); + } + browser->text(browser->child(0)->label()); +} + +// preview +void startSaverPreview() +{ + static XWindow id; + static int wid = 0; + static bool warned = false; + + if (!wid) + { + id = xid(saverWindow); + wid=1; + } + saverWindow->show(); + + if (id==0) + return; + killPreviewSubproc(); + + char *location = 0; + if (access(PREFIX"/X11R6/lib/xscreensaver/", F_OK)==0) + location = PREFIX"/X11R6/lib/xscreensaver/"; + else if (access(PREFIX"/lib/xscreensaver/", F_OK)==0) + location = PREFIX"/lib/xscreensaver/"; + else if (access("/usr/X11R6/lib/xscreensaver/", F_OK)==0) + location = "/usr/X11R6/lib/xscreensaver/"; + else if (access("/lib/xscreensaver/",F_OK)==0) + location = "/lib/xscreensaver/"; + else { + location = ""; + if (!warned) { + alert(_("xscreensaver wasn't found on your system.\n\nEquinox Desktop Environment uses xscreensaver to display screen savers. Please install this package if you wish to use graphical screen savers.")); + warned=true; + } + } + + // no need to continue now... + if (strlen(location)<1) return; + + + char cmd[4096] = {0}; + char* savercmd; + // all sorts of stuff can be undefined (zero), so we need to check thoroughly + if (saversList->item()) { + int saverno = (int)saversList->item()->user_data(); + fprintf (stderr, " ++ screenhack %d\n", saverno); + if (p.screenhacks && p.screenhacks[saverno] && p.screenhacks[saverno]->command) { + savercmd = (char*)p.screenhacks[(int)saversList->item()->user_data()]->command; + } else { + // no preview + return; + } + } else + savercmd = (char*)p.screenhacks[default_saver]->command; + snprintf(cmd, 4096, "%s%s -window-id 0x%X", location, savercmd, (int)id); + launchPreviewSubprocess(cmd); +} diff --git a/esvrconf/escreensaver.h b/esvrconf/escreensaver.h new file mode 100644 index 0000000..65a56d7 --- /dev/null +++ b/esvrconf/escreensaver.h @@ -0,0 +1,41 @@ +/* + * $Id$ + * + * Screensaver configuration + * Part of Equinox Desktop Environment (EDE). + * Copyright (c) 2000-2006 EDE Authors. + * + * This program is licenced under terms of the + * GNU General Public Licence version 2 or newer. + * See COPYING for details. + */ + +#ifndef escreensaver_h +#define escreensaver_h + +#include +#include + +/*#include +#include +#include +#include +#include */ + +#include +#include +#include +#include "../edelib2/NLS.h" + +void fillSaversList(fltk::InputBrowser *); +void startSaverPreview(); +void readConfiguration(); +void writeConfiguration(); +void writeConfigurationSaver(); +void getScreenhacks(); +void clearOnExit(); + +#endif + + + diff --git a/esvrconf/escrsaverconf.cpp b/esvrconf/escrsaverconf.cpp new file mode 100644 index 0000000..438490b --- /dev/null +++ b/esvrconf/escrsaverconf.cpp @@ -0,0 +1,176 @@ +/* + * $Id$ + * + * Screensaver configuration + * Part of Equinox Desktop Environment (EDE). + * Copyright (c) 2000-2006 EDE Authors. + * + * This program is licenced under terms of the + * GNU General Public Licence version 2 or newer. + * See COPYING for details. + */ + +#include "escrsaverconf.h" +#include "escreensaver.h" +#include "../edelib2/NLS.h" + +#include +#include +#include +#include "icons/energy.xpm" + +fltk::Window* mainWindow; + +static void cb_mainWindow(fltk::Window*, void*) { + clearOnExit(); +} + +fltk::InputBrowser* saversList; + +static void cb_saversList(fltk::InputBrowser*, void*) { + startSaverPreview(); +} + +fltk::ValueInput* timeoutSlider; + +static void cb_OK(fltk::Button*, void*) { + writeConfiguration(); clearOnExit(); +} + +static void cb_Cancel(fltk::Button*, void*) { + clearOnExit(); +} + +fltk::Group* dpmsGroup; +fltk::ValueInput* standbySlider; +fltk::ValueInput* suspendSlider; +fltk::ValueInput* offSlider; +fltk::CheckButton* enableDPMSCheck; + +static void cb_enableDPMSCheck(fltk::CheckButton*, void*) { + if (enableDPMSCheck->value()) dpmsGroup->activate(); else dpmsGroup->deactivate(); + enableDPMSCheck->redraw(); +} + + +static void cb_Apply(fltk::Button*, void*) { + writeConfiguration(); +} + +fltk::Window* saverWindow; + +int main(int argc, char **argv) { + fltk::Window* w; + //fl_init_locale_support("escrsaverconf", PREFIX"/share/locale"); + {fltk::Window* o = mainWindow = new fltk::Window(300, 420, _("Screensaver settings")); + w = o; + o->set_vertical(); + o->callback((fltk::Callback*)cb_mainWindow); + o->begin(); + {fltk::Group* o = new fltk::Group(10, 185, 280, 45, "Screensaver"); + o->box(fltk::ENGRAVED_BOX); + o->align(fltk::ALIGN_TOP|fltk::ALIGN_LEFT); + o->begin(); + {fltk::InputBrowser* o = saversList = new fltk::InputBrowser(10, 10, 155, 25); + o->callback((fltk::Callback*)cb_saversList); + o->align(fltk::ALIGN_TOP|fltk::ALIGN_LEFT); + //o->type(1); + getScreenhacks(); + fillSaversList(o); + } + {fltk::Group* o = new fltk::Group(165, 5, 105, 35); + o->begin(); + {fltk::ValueInput* o = timeoutSlider = new fltk::ValueInput(65, 5, 40, 25, "Timeout:"); + o->maximum(60); + o->step(1); + o->value(1); + o->align(fltk::ALIGN_LEFT|fltk::ALIGN_CLIP|fltk::ALIGN_WRAP); + } + o->end(); + } + o->end(); + } + {fltk::Group* o = new fltk::Group(10, 255, 280, 115, "DPMS"); + o->box(fltk::ENGRAVED_BOX); + o->align(fltk::ALIGN_TOP|fltk::ALIGN_LEFT); + o->begin(); + {fltk::Group* o = dpmsGroup = new fltk::Group(70, 0, 205, 108); + o->deactivate(); + o->begin(); + {fltk::ValueInput* o = standbySlider = new fltk::ValueInput(160, 10, 40, 25, "Standby:"); + o->maximum(60); + o->step(1); + o->value(10); + o->align(fltk::ALIGN_LEFT|fltk::ALIGN_WRAP); + } + {fltk::ValueInput* o = suspendSlider = new fltk::ValueInput(160, 45, 40, 25, "Suspend:"); + o->maximum(60); + o->step(1); + o->value(15); + o->align(fltk::ALIGN_LEFT|fltk::ALIGN_WRAP); + } + {fltk::ValueInput* o = offSlider = new fltk::ValueInput(160, 80, 40, 25, "Off:"); + o->maximum(60); + o->step(1); + o->value(20); + o->align(fltk::ALIGN_LEFT|fltk::ALIGN_WRAP); + } + o->end(); + } + {fltk::CheckButton* o = enableDPMSCheck = new fltk::CheckButton(10, 45, 145, 25, "Enabled"); + o->callback((fltk::Callback*)cb_enableDPMSCheck); + o->align(fltk::ALIGN_LEFT|fltk::ALIGN_INSIDE|fltk::ALIGN_WRAP); + } + {fltk::InvisibleBox* o = new fltk::InvisibleBox(10, 10, 55, 35); + fltk::xpmImage *img = new fltk::xpmImage((const char**)energy_xpm); + o->image(img); + } + o->end(); + } +// {fltk::Button* o = new fltk::Button(0, 380, 90, 25, "&OK"); +// o->callback((fltk::Callback*)cb_OK); +// } + {fltk::Button* o = new fltk::Button(100, 380, 90, 25, "&Apply"); + o->callback((fltk::Callback*)cb_Apply); + } + {fltk::Button* o = new fltk::Button(200, 380, 90, 25, "&Close"); + o->callback((fltk::Callback*)cb_Cancel); + } + {fltk::Group* o = new fltk::Group(45, 5, 200, 165); + o->begin(); + {fltk::InvisibleBox* o = new fltk::InvisibleBox(10, 6, 180, 131); + o->box(fltk::UP_BOX); + } + {fltk::InvisibleBox* o = new fltk::InvisibleBox(20, 15, 160, 110); + o->box(fltk::DOWN_BOX); + } + {fltk::InvisibleBox* o = new fltk::InvisibleBox(70, 137, 59, 3); + o->box(fltk::THIN_UP_BOX); + } + {fltk::InvisibleBox* o = new fltk::InvisibleBox(52, 140, 95, 12); + o->box(fltk::UP_BOX); + } + {fltk::InvisibleBox* o = new fltk::InvisibleBox(164, 127, 15, 6); + o->box(fltk::THIN_UP_BOX); + } + {fltk::InvisibleBox* o = new fltk::InvisibleBox(157, 128, 2, 4); + o->set_vertical(); + o->box(fltk::FLAT_BOX); + o->color(fltk::GREEN); + } + {fltk::Window* o = saverWindow = new fltk::Window(22, 17, 156, 106); + o->box(fltk::FLAT_BOX); + o->color(fltk::BLACK); + o->end(); + } + o->end(); + } + o->end(); + } + readConfiguration(); + cb_enableDPMSCheck(enableDPMSCheck, 0); //deactivate controls if it's off + mainWindow->end(); + mainWindow->show(); + startSaverPreview(); //preview active saver + return fltk::run(); +} diff --git a/esvrconf/escrsaverconf.fl b/esvrconf/escrsaverconf.fl new file mode 100644 index 0000000..5426f8d --- /dev/null +++ b/esvrconf/escrsaverconf.fl @@ -0,0 +1,117 @@ +# data file for the FLTK User Interface Designer (FLUID) +version 2.0100 +images_dir ./ +header_name {.h} +code_name {.cpp} +gridx 5 +gridy 5 +snap 3 +decl {\#include "escreensaver.h"} {} + +Function {main(int argc, char **argv)} {open return_type int +} { + code {//fl_init_locale_support("escrsaverconf", PREFIX"/share/locale");} {} + {fltk::Window} mainWindow { + label {Screensaver settings} + callback {clearOnExit();} open + xywh {401 74 300 420} visible + } { + {fltk::Group} {} { + label Screensaver open + xywh {10 185 280 45} align 5 box ENGRAVED_BOX + } { + {fltk::Choice} saversList { + callback {startSaverPreview();} + xywh {10 10 155 25} align 5 + extra_code {o->type(1); getScreenhacks(); +fillSaversList(o);} + class {fltk::InputBrowser} + } {} + {fltk::Group} {} {open + xywh {165 5 105 35} + } { + {fltk::ValueInput} timeoutSlider { + label {Timeout:} + xywh {65 5 40 25} align 196 maximum 60 step 1 value 1 + } + } + } + {fltk::Button} {} { + label {&OK} + callback {writeConfiguration(); clearOnExit();} + xywh {0 380 90 25} + } + {fltk::Button} {} { + label {&Cancel} + callback {clearOnExit();} + xywh {200 380 90 25} + } + {fltk::Group} {} { + label DPMS open + xywh {10 255 280 115} align 5 box ENGRAVED_BOX + } { + {fltk::Group} dpmsGroup {open + xywh {70 0 205 108} deactivate + } { + {fltk::ValueInput} standbySlider { + label {Standby:} + xywh {160 10 40 25} align 132 maximum 60 step 1 value 10 + } + {fltk::ValueInput} suspendSlider { + label {Suspend:} + xywh {160 45 40 25} align 132 maximum 60 step 1 value 15 + } + {fltk::ValueInput} offSlider { + label {Off:} + xywh {160 80 40 25} align 132 maximum 60 step 1 value 20 + } + } + {fltk::CheckButton} enableDPMSCheck { + label Enabled + callback {if (enableDPMSCheck->value()) dpmsGroup->activate(); else dpmsGroup->deactivate();} + xywh {10 45 145 25} align 148 + } + {fltk::InvisibleBox} {} { + xywh {10 10 55 35} image {icons/energy.xpm} + } + } + {fltk::Button} {} { + label {&Apply} + callback {writeConfiguration();} + xywh {100 380 90 25} + } + {fltk::Group} {} {open + xywh {45 5 200 165} + } { + {fltk::InvisibleBox} {} { + xywh {10 6 180 131} box UP_BOX + } + {fltk::InvisibleBox} {} { + xywh {20 15 160 110} box DOWN_BOX + } + {fltk::InvisibleBox} {} { + xywh {70 137 59 3} box THIN_UP_BOX + } + {fltk::InvisibleBox} {} { + xywh {52 140 95 12} box UP_BOX + } + {fltk::InvisibleBox} {} { + xywh {164 127 15 6} box THIN_UP_BOX + } + {fltk::InvisibleBox} {} { + xywh {157 128 2 4} box FLAT_BOX color 2 + } + {fltk::InvisibleBox} saverWindow { + xywh {22 17 156 106} box FLAT_BOX color 32 + extra_code {o->end();} + class Fl_Window + } + } + } + code {readConfiguration(); +mainWindow->end(); +mainWindow->show(); +startSaverPreview(); //preview active saver +//return fltk::run();} {selected + } +} diff --git a/esvrconf/escrsaverconf.fld b/esvrconf/escrsaverconf.fld new file mode 100644 index 0000000..6b17dff --- /dev/null +++ b/esvrconf/escrsaverconf.fld @@ -0,0 +1,128 @@ +# data file for the FLTK User Interface Designer (FLUID) +version 2.0030 +images_dir ./ +header_name {.h} +code_name {.cpp} +gridx 5 +gridy 5 +snap 3 +decl {\#include "escreensaver.h"} {} + +Function {main(int argc, char **argv)} {open return_type int +} { + code {fl_init_locale_support("escrsaverconf", PREFIX"/share/locale");} {} + Fl_Window mainWindow { + label {Screensaver settings} + callback {clearOnExit();} open + xywh {329 68 285 374} hide + extra_code {o->label(_(o->label()));} + } { + Fl_Group {} { + label Screensaver open + xywh {5 185 275 55} align 5 box ENGRAVED_BOX + extra_code {o->label(_(o->label()));} + } { + Fl_Choice saversList { + callback {startSaverPreview();} open + xywh {7 15 158 23} align 5 + extra_code {\#include +o->type(1); getScreenhacks(); +fillSaversList(o);} + class Fl_Input_Browser + } {} + Fl_Group {} {open + xywh {175 5 95 45} + } { + Fl_Value_Input timeoutSlider { + label {Timeout:} + xywh {55 9 40 25} align 196 maximum 60 step 1 value 1 + extra_code {o->label(_(o->label()));} + } + } + } + Fl_Button {} { + label {&OK} + callback {writeConfiguration(); clearOnExit();} + xywh {30 345 80 25} + extra_code {o->label(_(o->label()));} + } + Fl_Button {} { + label {&Cancel} + callback {clearOnExit();} selected + xywh {200 345 80 25} + extra_code {o->label(_(o->label()));} + } + Fl_Group {} { + label DPMS open + xywh {5 260 275 80} align 5 box ENGRAVED_BOX + extra_code {o->label(_(o->label()));} + } { + Fl_Group dpmsGroup {open + xywh {130 2 140 74} deactivate + } { + Fl_Value_Input standbySlider { + label {Standby:} + xywh {100 2 40 20} align 132 maximum 60 step 1 value 10 + extra_code {o->label(_(o->label()));} + } + Fl_Value_Input suspendSlider { + label {Suspend:} + xywh {100 27 40 20} align 132 maximum 60 step 1 value 15 + extra_code {o->label(_(o->label()));} + } + Fl_Value_Input offSlider { + label {Off:} + xywh {100 52 40 20} align 132 maximum 60 step 1 value 20 + extra_code {o->label(_(o->label()));} + } + } + Fl_Check_Button enableDPMSCheck { + label Enabled + callback {if (enableDPMSCheck->value()) dpmsGroup->activate(); else dpmsGroup->deactivate();} + xywh {60 25 105 25} align 148 + extra_code {o->label(_(o->label()));} + } + Fl_Box {} { + xywh {5 15 55 35} image {icons/energy.xpm} + } + } + Fl_Button {} { + label {&Apply} + callback {writeConfiguration();} + xywh {115 345 80 25} + extra_code {o->label(_(o->label()));} + } + Fl_Group {} {open + xywh {40 5 205 165} + } { + Fl_Box {} { + xywh {10 6 180 131} box UP_BOX + } + Fl_Box {} { + xywh {20 15 160 110} box DOWN_BOX + } + Fl_Box {} { + xywh {70 137 59 3} box THIN_UP_BOX + } + Fl_Box {} { + xywh {52 140 95 12} box UP_BOX + } + Fl_Box {} { + xywh {164 127 15 6} box THIN_UP_BOX + } + Fl_Box {} { + xywh {157 128 2 4} box FLAT_BOX color 2 + } + Fl_Box saverWindow { + xywh {22 17 156 106} box FLAT_BOX color 32 + extra_code {o->end();} + class Fl_Window + } + } + } + code {readConfiguration(); +mainWindow->end(); +mainWindow->show(); +startSaverPreview(); //preview active saver +return Fl::run();} {} +} diff --git a/esvrconf/escrsaverconf.h b/esvrconf/escrsaverconf.h new file mode 100644 index 0000000..9e6963d --- /dev/null +++ b/esvrconf/escrsaverconf.h @@ -0,0 +1,33 @@ +/* + * $Id$ + * + * Screensaver configuration + * Part of Equinox Desktop Environment (EDE). + * Copyright (c) 2000-2006 EDE Authors. + * + * This program is licenced under terms of the + * GNU General Public Licence version 2 or newer. + * See COPYING for details. + */ + +#ifndef escrsaverconf_h +#define escrsaverconf_h +#include +#include +extern fltk::Window* mainWindow; +#include +#include +extern fltk::InputBrowser* saversList; +#include +extern fltk::ValueInput* timeoutSlider; +#include +extern fltk::Group* dpmsGroup; +extern fltk::ValueInput* standbySlider; +extern fltk::ValueInput* suspendSlider; +extern fltk::ValueInput* offSlider; +#include +extern fltk::CheckButton* enableDPMSCheck; +#include +extern fltk::Window* saverWindow; +int main(int argc, char **argv); +#endif diff --git a/esvrconf/icons/energy.xpm b/esvrconf/icons/energy.xpm new file mode 100644 index 0000000..2559406 --- /dev/null +++ b/esvrconf/icons/energy.xpm @@ -0,0 +1,307 @@ +/* XPM */ +static char * energy_xpm[] = { +"48 48 256 2", +" c None", +". c #000000", +"+ c #4271D0", +"@ c #4777D0", +"# c #4D81BE", +"$ c #3C6FB7", +"% c #4977D8", +"& c #5CA24B", +"* c #5A9A7E", +"= c #61AC4A", +"- c #65B33B", +"; c #4E86A9", +"> c #4579C2", +", c #3966C4", +"' c #4170DC", +") c #5BA52C", +"! c #549C48", +"~ c #65BC0E", +"{ c #67BF00", +"] c #559953", +"^ c #3A63E4", +"/ c #58A723", +"( c #55A42B", +"_ c #56A71A", +": c #64B713", +"< c #3F7695", +"[ c #5EAB26", +"} c #519362", +"| c #58A63A", +"1 c #4A6FB3", +"2 c #55A226", +"3 c #539D3D", +"4 c #559D33", +"5 c #4B8B5E", +"6 c #519533", +"7 c #498A75", +"8 c #3559F9", +"9 c #529E27", +"0 c #40A01E", +"a c #57A823", +"b c #599F3A", +"c c #35699B", +"d c #3B6CAB", +"e c #53954A", +"f c #3F77A5", +"g c #3C6AA6", +"h c #4E914F", +"i c #539A43", +"j c #2E8947", +"k c #9CB232", +"l c #74AF1B", +"m c #35718B", +"n c #458760", +"o c #2F5DBB", +"p c #3864B4", +"q c #4D9347", +"r c #509739", +"s c #4D9847", +"t c #4B8C49", +"u c #448F4C", +"v c #2B8336", +"w c #FFFE5D", +"x c #BBB859", +"y c #2B60AB", +"z c #4D923A", +"A c #498F42", +"B c #497870", +"C c #2850B7", +"D c #2F6094", +"E c #46895A", +"F c #448546", +"G c #326C73", +"H c #498F3D", +"I c #91AF4F", +"J c #FFFF68", +"K c #F8D645", +"L c #257433", +"M c #3B727C", +"N c #3260AC", +"O c #325DA6", +"P c #2E5AA5", +"Q c #42874F", +"R c #33795E", +"S c #2A52C4", +"T c #448954", +"U c #487F56", +"V c #488950", +"W c #4B8A52", +"X c #196C58", +"Y c #FFF253", +"Z c #6E6C32", +"` c #E2D957", +" . c #6B9142", +".. c #236C8B", +"+. c #3D7B5C", +"@. c #3164A7", +"#. c #325DAA", +"$. c #2B7A5B", +"%. c #206B5F", +"&. c #FFF43E", +"*. c #003A2E", +"=. c #AEC865", +"-. c #DAC32C", +";. c #012592", +">. c #073CCA", +",. c #0E4BC2", +"'. c #104BB7", +"). c #2E58A7", +"!. c #1241B3", +"~. c #2F6E5F", +"{. c #2B55B4", +"]. c #2D57AF", +"^. c #31765A", +"/. c #5F8D4E", +"(. c #7A916B", +"_. c #91A480", +":. c #FFFF44", +"<. c #AE9B4E", +"[. c #004778", +"}. c #FFFF4E", +"|. c #C1BC6B", +"1. c #89968A", +"2. c #708287", +"3. c #4A5F88", +"4. c #395F9C", +"5. c #2A51A2", +"6. c #0032B2", +"7. c #4163AB", +"8. c #25686B", +"9. c #2B4D9B", +"0. c #2B599B", +"a. c #234BA7", +"b. c #2E5DA2", +"c. c #337765", +"d. c #136168", +"e. c #FEED65", +"f. c #D0BB4D", +"g. c #F5D457", +"h. c #EACC4D", +"i. c #AEA94B", +"j. c #022686", +"k. c #558C3C", +"l. c #E3D160", +"m. c #FEE336", +"n. c #FDE85B", +"o. c #91894A", +"p. c #24499B", +"q. c #002BB5", +"r. c #F8D52B", +"s. c #3C7C53", +"t. c #175687", +"u. c #0637A7", +"v. c #022CBF", +"w. c #08438D", +"x. c #095460", +"y. c #013162", +"z. c #163E97", +"A. c #0006C2", +"B. c #61746F", +"C. c #CDB22B", +"D. c #586A55", +"E. c #0023B4", +"F. c #013991", +"G. c #00239C", +"H. c #977D1A", +"I. c #0023A3", +"J. c #3C5CA7", +"K. c #E8CB38", +"L. c #000C90", +"M. c #D4C853", +"N. c #07296E", +"O. c #185876", +"P. c #FEE24A", +"Q. c #08329E", +"R. c #68788A", +"S. c #ADAD7E", +"T. c #305E56", +"U. c #787850", +"V. c #2C4887", +"W. c #024C6E", +"X. c #556D96", +"Y. c #0011AA", +"Z. c #24479E", +"`. c #1B45A3", +" + c #1D449C", +".+ c #0018A8", +"++ c #1D387A", +"@+ c #000F6F", +"#+ c #FFFD37", +"$+ c #A99935", +"%+ c #FFFE55", +"&+ c #FFFF76", +"*+ c #4A514C", +"=+ c #EDD74C", +"-+ c #948C30", +";+ c #1439A2", +">+ c #294B95", +",+ c #003897", +"'+ c #FFFE27", +")+ c #232E47", +"!+ c #013485", +"~+ c #204692", +"{+ c #0C3598", +"]+ c #0026A8", +"^+ c #0007B4", +"/+ c #929768", +"(+ c #000397", +"_+ c #000B59", +":+ c #0F2F8E", +"<+ c #E8E45D", +"[+ c #C9C662", +"}+ c #1F4292", +"|+ c #EECF1F", +"1+ c #0006AB", +"2+ c #617CA2", +"3+ c #0014A4", +"4+ c #001AB5", +"5+ c #3D5789", +"6+ c #001CA5", +"7+ c #264E80", +"8+ c #19409B", +"9+ c #0F3B98", +"0+ c #0D2E93", +"a+ c #385170", +"b+ c #012CAB", +"c+ c #012AA4", +"d+ c #DEC21D", +"e+ c #0000B3", +"f+ c #1B4A86", +"g+ c #163A9C", +"h+ c #183C9F", +"i+ c #193D97", +"j+ c #143A98", +"k+ c #0D349D", +"l+ c #000EBD", +"m+ c #163793", +"n+ c #103198", +"o+ c #163696", +"p+ c #123A9A", +"q+ c #11349B", +"r+ c #153E90", +"s+ c #102E9E", +"t+ c #00158D", +"u+ c #062E98", +"v+ c #123796", +"w+ c #113A9D", +"x+ c #00169B", +"y+ c #022A97", +"z+ c #0E3491", +"A+ c #0D3294", +"B+ c #113091", +"C+ c #0E3191", +"D+ c #113295", +"E+ c #113592", +"F+ c #12358D", +"G+ c #344F9F", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" . . . . . . ", +" . . . . . + @ # # # $ . . . . . ", +" . . $ + % & * = - ; > # # # # @ % > . . ", +" . , > ' * ) ! ~ { { @ ' @ @ ' @ ] & > @ , . ", +" . . ^ ; / ( _ : , & { < ^ [ & ; } ~ : : ~ [ | 1 . . ", +" . 2 ) 3 _ / 4 5 6 7 5 $ 8 ] 9 2 _ _ 4 4 | 4 ) 0 _ a b . ", +" . c d e ) 3 ( < f a g ^ $ 3 h 5 3 b ! 3 3 i | j k l m < n . ", +" . d o p ( q i e r _ 9 m o , n _ 4 s t s q e s u v w x v h < o . ", +" . 1 y o h z t q 6 A B C , p p z D E F G H q t t j I J K L s M N p . ", +" . O P o c z Q A H R S S p O N o T U D c B t V V W X Y Z ` ...+.O N P . ", +" . N @.o c H n M G S N @.#.N o M A V t T $.$.%.%.X X &.*.=.-.;.>.,.'.'.. ", +" . P ).O ).!.%.~.{.S {.#.).P ].).F +.R R ^./.(.I (._.:.<.[.X }.|.1.1.2.3.4.. ", +" . 5.).P 6.7.1.8.M 9.0.C 5.).a.b.Q c.d.d.~.&.e.f.g.h.i.j.+ k.(.l.m.f.n.J o.. ", +" . p.5.9.q._.r.f.o.q.+.s.t.6.a.u.v.w.x.` e.y.x.y.i.z.A.B.Y C.D.E.F.A.G.:.H.I.a.. ", +" . a.5.!.J.K.L.M.N.0.%.O.U P.Q.R.:.3.S.r.C.I n.T.J U.x i.V.G.t.G W.X.:.U.Y.C Z.. ", +" . `. +p..+f.++}.@+S.#+$+@+%+r.$+&+*+e.K &+f.f.Z =+%+-+++E.;+a.>+,+(.'+)+!+0.Z.~+p.. ", +" . {+]+^+2.#+i.N./+J K.U.(.w -+:.=+(+1.m.n._+B C.w *+^+'+:+a.u.`.E.S.i.;.9. + + + +. ", +" . |.<+[+w *+!+n.C.%+L.i.o.-+D.j.j.v.}+#+U..+O.n.|+1+2+K.3+4+5+Q.6+B P.[.7+`.8+8+9+. ", +" . 9.0+B.a+h./+=+*+Q.a+b+6+!+N.F.!.u.c+=+d+++4+M.$+o.A.|.U.e+|.'+:.a+L.&.y.f+g+h+i+j+. ", +" . 1 ;.b+q.G.*+G.E.k+b+8+h+7+7+;+i+I.2.r.$+1+X.o.x ++l+M.U.w '+_+3.:./+M.Z q.h+f+8+{+7.. ", +" . Z.0+m+m+n+b+n+o+p+o+o+q+f+r+s+m+G.3.f.j.^+/+m.$+1+;.w #+D.(+E.3+t+f.w l.L.r+r+q+0+ +. ", +" . u+p+v+w+{+v+w+n+w+v+{+w+z.r+n+q+z.c+x+u.6+R.C.(+b+V.r.@+^+;+o+z.]+e+(.-.G.k+s+j+y+J.. ", +" . :+z+0+:+A+0+B+A+B+z+0+B+0+A+z+C+C+:+D+B+:+y+3+D+E+u+(+c+F+E+0+:+E+D+x+x+D+z+C+B+j.G+. ", +" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" "}; diff --git a/esvrconf/locale/hu.po b/esvrconf/locale/hu.po new file mode 100644 index 0000000..bd31336 --- /dev/null +++ b/esvrconf/locale/hu.po @@ -0,0 +1,63 @@ +msgid "" +msgstr "" +"Project-Id-Version: \n" +"POT-Creation-Date: \n" +"PO-Revision-Date: 2005-02-10 14:54+0100\n" +"Last-Translator: Nemeth Otto \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: escreensaver.cpp:385 +msgid "Couldn't fork screensaver subprocess." +msgstr "" + +#: escreensaver.cpp:397 +msgid "Couldn't fork shell subprocess." +msgstr "" + +#: escrsaverconf.cpp:377 +msgid "Screensaver settings" +msgstr "Képernyőkímélő beállítások" + +#: escrsaverconf.cpp:382 +msgid "Screensaver" +msgstr "Képernyőkímélő" + +#: escrsaverconf.cpp:399 +msgid "Timeout:" +msgstr "Idö:" + +#: escrsaverconf.cpp:412 +msgid "&OK" +msgstr "&OK" + +#: escrsaverconf.cpp:418 +msgid "&Cancel" +msgstr "Mégs&em" + +#: escrsaverconf.cpp:424 +msgid "DPMS" +msgstr "" + +#: escrsaverconf.cpp:433 +msgid "Standby:" +msgstr "Készenlét:" + +#: escrsaverconf.cpp:441 +msgid "Suspend:" +msgstr "Pihen:" + +#: escrsaverconf.cpp:449 +msgid "Off:" +msgstr "Kikapcsol:" + +#: escrsaverconf.cpp:459 +msgid "Enabled" +msgstr "Engedélyez" + +#: escrsaverconf.cpp:474 +msgid "&Apply" +msgstr "&Alkalmaz" + diff --git a/esvrconf/locale/messages.pot b/esvrconf/locale/messages.pot new file mode 100644 index 0000000..dae9701 --- /dev/null +++ b/esvrconf/locale/messages.pot @@ -0,0 +1,67 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR Free Software Foundation, Inc. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"POT-Creation-Date: 2002-04-21 14:09+0200\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=CHARSET\n" +"Content-Transfer-Encoding: 8bit\n" + +#: escreensaver.cpp:385 +msgid "Couldn't fork screensaver subprocess." +msgstr "" + +#: escreensaver.cpp:397 +msgid "Couldn't fork shell subprocess." +msgstr "" + +#: escrsaverconf.cpp:377 +msgid "Screensaver settings" +msgstr "" + +#: escrsaverconf.cpp:382 +msgid "Screensaver" +msgstr "" + +#: escrsaverconf.cpp:399 +msgid "Timeout:" +msgstr "" + +#: escrsaverconf.cpp:412 +msgid "&OK" +msgstr "" + +#: escrsaverconf.cpp:418 +msgid "&Cancel" +msgstr "" + +#: escrsaverconf.cpp:424 +msgid "DPMS" +msgstr "" + +#: escrsaverconf.cpp:433 +msgid "Standby:" +msgstr "" + +#: escrsaverconf.cpp:441 +msgid "Suspend:" +msgstr "" + +#: escrsaverconf.cpp:449 +msgid "Off:" +msgstr "" + +#: escrsaverconf.cpp:459 +msgid "Enabled" +msgstr "" + +#: escrsaverconf.cpp:474 +msgid "&Apply" +msgstr "" diff --git a/esvrconf/locale/ru.po b/esvrconf/locale/ru.po new file mode 100644 index 0000000..0536d88 --- /dev/null +++ b/esvrconf/locale/ru.po @@ -0,0 +1,67 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR Free Software Foundation, Inc. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"POT-Creation-Date: 2002-04-21 14:09+0200\n" +"PO-Revision-Date: 2002-11-28 HO:MI+ZONE\n" +"Last-Translator: aabbvv \n" +"Language-Team: RUSSIAN \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=koi8-r\n" +"Content-Transfer-Encoding: 8bit\n" + +#: escreensaver.cpp:385 +msgid "Couldn't fork screensaver subprocess." +msgstr " " + +#: escreensaver.cpp:397 +msgid "Couldn't fork shell subprocess." +msgstr " " + +#: escrsaverconf.cpp:377 +msgid "Screensaver settings" +msgstr " " + +#: escrsaverconf.cpp:382 +msgid "Screensaver" +msgstr " " + +#: escrsaverconf.cpp:399 +msgid "Timeout:" +msgstr ":" + +#: escrsaverconf.cpp:412 +msgid "&OK" +msgstr "&OK" + +#: escrsaverconf.cpp:418 +msgid "&Cancel" +msgstr "" + +#: escrsaverconf.cpp:424 +msgid "DPMS" +msgstr "DMPS" + +#: escrsaverconf.cpp:433 +msgid "Standby:" +msgstr ":" + +#: escrsaverconf.cpp:441 +msgid "Suspend:" +msgstr ":" + +#: escrsaverconf.cpp:449 +msgid "Off:" +msgstr ":" + +#: escrsaverconf.cpp:459 +msgid "Enabled" +msgstr "" + +#: escrsaverconf.cpp:474 +msgid "&Apply" +msgstr "" diff --git a/esvrconf/locale/sk.po b/esvrconf/locale/sk.po new file mode 100644 index 0000000..7b21e00 --- /dev/null +++ b/esvrconf/locale/sk.po @@ -0,0 +1,66 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR Free Software Foundation, Inc. +# FIRST AUTHOR , YEAR. +# +msgid "" +msgstr "" +"Project-Id-Version: esvrconf 1.0\n" +"POT-Creation-Date: 2002-04-21 14:09+0200\n" +"PO-Revision-Date: 2002-04-21 14:50+0200\n" +"Last-Translator: Martin Pekar \n" +"Language-Team: Slovak \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: escreensaver.cpp:385 +msgid "Couldn't fork screensaver subprocess." +msgstr "Nemôžem spustiť podproces šetriča obrazovky" + +#: escreensaver.cpp:397 +msgid "Couldn't fork shell subprocess." +msgstr "Nemôžem spustiť podproces shelu." + +#: escrsaverconf.cpp:377 +msgid "Screensaver settings" +msgstr "Nastavenie šetriča obrazovky" + +#: escrsaverconf.cpp:382 +msgid "Screensaver" +msgstr "Šetrič obrazovky" + +#: escrsaverconf.cpp:399 +msgid "Timeout:" +msgstr "Čas:" + +#: escrsaverconf.cpp:412 +msgid "&OK" +msgstr "&OK" + +#: escrsaverconf.cpp:418 +msgid "&Cancel" +msgstr "&Zrušiť" + +#: escrsaverconf.cpp:424 +msgid "DPMS" +msgstr "DPMS" + +#: escrsaverconf.cpp:433 +msgid "Standby:" +msgstr "Standby:" + +#: escrsaverconf.cpp:441 +msgid "Suspend:" +msgstr "Suspend:" + +#: escrsaverconf.cpp:449 +msgid "Off:" +msgstr "Off:" + +#: escrsaverconf.cpp:459 +msgid "Enabled" +msgstr "Povolené" + +#: escrsaverconf.cpp:474 +msgid "&Apply" +msgstr "&Použiť" diff --git a/etimedate/Date_Time.h b/etimedate/Date_Time.h new file mode 100644 index 0000000..0d1b1c9 --- /dev/null +++ b/etimedate/Date_Time.h @@ -0,0 +1,155 @@ +/* + * Date_Time class for FLTK + * Copyright (C) Vedran Ljubovic , 2005. + * WWW: http://www.sourceforge.net/projects/ede + * + * This library is distributed under the GNU LIBRARY GENERAL PUBLIC LICENSE + * version 2. See COPYING for details. + * + */ + +#ifndef _DATE_TIME_H_ +#define _DATE_TIME_H_ + +class DateTime; + +/** \class Timezone + This class enables various manipulations of timezones needed for the DateTime class. +*/ +class Timezone { +public: +/** \fn Timezone::Timezone() + Creates a variable that contains UTC (Coordinated Universal Time) +*/ + TimeZone (); + +/** \fn char* Timezone::place() + Returns location of current timezone e.g. Europe/Sarajevo +*/ + char* place(); + +/** \fn void Timezone::parse(char*) + Parse given string into timezone. String can be place as returned by place() or a part of it. +*/ + void parse(char*); + +/** \fn int Timezone::correction(DateTime*) + Correction i.e. the number of minutes that needs to be added to UTC to get the current time zone. Because of daylight saving, this number can be different during the year - so DateTime needs to be specified. From this number a RFC822-compliant correction can be calculated - e.g. 180 means "+0300". +*/ + int correction(DateTime*); + +/** \fn static char** Timezone::list() + A useful function to return a list of timezone names as used by place() and parse(). +*/ + static char** list(); +} + +/** \class DateTime + DateTime +*/ +class DateTime { +public: +/** \fn DateTime::DateTime() + Creates DateTime at January 1st, year 0, 00:00:00 +*/ + DateTime (); + +/** \fn DateTime::DateTime(double) + Creates DateTime with given time_t value (as returned by time()) +*/ + DateTime (double); + + int year(); + int month(); + int day(); + int hour(); + int minute(); + int second(); + + bool year(int); + bool month(int); + bool day(int); + bool hour(int); + bool minute(int); + bool second(int); + + + + static char dateInputFormat[32]; + static char timeInputFormat[32]; + static char dateFormat[32]; + static char timeFormat[32]; + static char datePartsOrder[4]; + static char dateSeparator; + static char timeSeparator; + static bool time24Mode; + + Fl_Date_Time (short y,short m,short d,short hour=0,short minute=0,short second=0); + Fl_Date_Time (const char * dat); + Fl_Date_Time (const Fl_Date_Time &dt); + Fl_Date_Time (const double dt=0); + + static Fl_Date_Time convert (const long); + + void format_date(char *str) const; + void format_time(char *str, bool ampm=true) const; + + // These functions don't affect the actual system time. + // You can only alter the time for the current program. + static void Now(Fl_Date_Time dt); // Sets to current date and time + static Fl_Date_Time System(); // Gets to current system date and time + static Fl_Date_Time Now(); // Gets to current date and time + static Fl_Date_Time Date(); // Gets to current date + static Fl_Date_Time Time(); // Gets to current time + + short days_in_month() const; // Number of days in month (1..31) + short day_of_week() const; // (1..7) + short day_of_year() const; // returns relative date since Jan. 1 + + char* day_name() const; // Character Day Of Week ('Sunday'..'Saturday') + char* month_name() const; // Character Month name + + unsigned date() const; // Numeric date of date object + short day() const; // Numeric day of date object + short month() const; // Month number (1..12) + short year() const; + + char* date_string() const; + char* time_string() const; + + void decode_date(short *y,short *m,short *d) const; + void decode_time(short *h,short *m,short *s,short *ms) const; + + operator double (void) const; + + void operator = (const Fl_Date_Time& date); + void operator = (const char * dat); + + Fl_Date_Time operator + (int i); + Fl_Date_Time operator - (int i); + Fl_Date_Time operator + (Fl_Date_Time& dt); + Fl_Date_Time operator - (Fl_Date_Time& dt); + + Fl_Date_Time& operator += (int i); + Fl_Date_Time& operator -= (int i); + Fl_Date_Time& operator += (Fl_Date_Time& dt); + Fl_Date_Time& operator -= (Fl_Date_Time& dt); + + Fl_Date_Time& operator ++ (); // Prefix increment + Fl_Date_Time& operator ++ (int); // Postfix increment + Fl_Date_Time& operator -- (); // Prefix decrement + Fl_Date_Time& operator -- (int); // Postfix decrement + +protected: + double m_dateTime; +}; + +// Date comparison +static inline bool operator < (const Fl_Date_Time &dt1, const Fl_Date_Time &dt2) { return ( (double)dt1 < (double)dt2 ); } +static inline bool operator <= (const Fl_Date_Time &dt1, const Fl_Date_Time &dt2) { return ( (double)dt1 <= (double)dt2 ); } +static inline bool operator > (const Fl_Date_Time &dt1, const Fl_Date_Time &dt2) { return ( (double)dt1 > (double)dt2 ); } +static inline bool operator >= (const Fl_Date_Time &dt1, const Fl_Date_Time &dt2) { return ( (double)dt1 >= (double)dt2 ); } +static inline bool operator == (const Fl_Date_Time &dt1, const Fl_Date_Time &dt2) { return ( (double)dt1 == (double)dt2 ); } +static inline bool operator != (const Fl_Date_Time &dt1, const Fl_Date_Time &dt2) { return ( (double)dt1 != (double)dt2 ); } + +#endif diff --git a/etimedate/EDE_Calendar.cpp b/etimedate/EDE_Calendar.cpp new file mode 100644 index 0000000..fe2f7e9 --- /dev/null +++ b/etimedate/EDE_Calendar.cpp @@ -0,0 +1,471 @@ +/*************************************************************************** + Fl_Calendar.cpp - description + ------------------- + begin : Sun Aug 18 2002 + copyright : (C) 2002 by Alexey Parshin + email : alexeyp@m7.tts-sf.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ +// +// Ported to FLTK2 by Vedran Ljubovic , 2005. + +#include "EDE_Calendar.h" + +// For NLS stuff +//#include "../core/fl_internal.h" +#include +#include +#include +#include +#include +#include +#include + +#include "../edelib2/NLS.h" + +using namespace fltk; + + + + +// FIXME: dont do static +static EDE_Calendar* thecalendar; + + + + +// Constants + +static const char *weekDayLabels[7] = { + "Su","Mo","Tu","We","Th","Fr","Sa" +}; + +static const char *monthDayLabels[31] = { + "1","2","3","4","5","6","7","8","9","10", + "11","12","13","14","15","16","17","18","19","20", + "21","22","23","24","25","26","27","28","29","30", + "31" +}; + +static const char *switchLabels[4] = { + "@-1<<","@-1<","@-1>","@-1>>" +}; + +static const int monthChanges[4] = { + -12,-1,1,12 +}; + +// TODO: read this from locale +const bool weekStartsOnMonday = false; + + +// Callback function for day buttons + +void EDE_Calendar::cbDayButtonClicked(Widget *button, void *param) { + if (event_clicks() == 1 || event_key() == ReturnKey) { +// NOTE: this used to read: +// button->parent->dayButtonChanged... +// but it didn't work! FIXME + thecalendar->dayButtonChanged((unsigned)param); + } else { + thecalendar->dayButtonClicked((unsigned)param); + } +} + +// Callback function for switch buttons + +void EDE_Calendar::cbSwitchButtonClicked(Widget *button, void *param) { + thecalendar->switchButtonClicked((int)param); +} + + +// Real callback functions: + +void EDE_Calendar::dayButtonClicked(unsigned cday) { + if (cday < 1 || cday > 31) return; + short year, month, day; + m_activeDate.decode_date(&year,&month,&day); + Fl_Date_Time::encode_date((double&)m_activeDate,year,month,cday); + redraw(); +// do_callback(); // callback only on changing "today" date +} + +void EDE_Calendar::dayButtonChanged(unsigned cday) { + if (cday < 1 || cday > 31) return; + short year, month, day; + m_todayDate.decode_date(&year,&month,&day); + m_activeDate.decode_date(&year,&month,&day); + Fl_Date_Time::encode_date((double&)m_todayDate,year,month,cday); + redraw(); + do_callback(); +} + +void EDE_Calendar::switchButtonClicked(int monthChange) { + short year, month, day; + m_activeDate.decode_date(&year,&month,&day); + month += monthChange; + if (month < 1) { + month += 12; + year--; + } + if (month > 12) { + month -= 12; + year++; + } +// Fl_Date_Time newDate(year,month,day); +// date(newDate); + Fl_Date_Time::encode_date((double&)m_activeDate,year,month,day); + redraw(); +// do_callback(); +} + + +// This is stuff for NamedStyle - still needed? + +static void revert(Style* s) { + s->color_ = GRAY75; + s->buttoncolor_ = GRAY75; + s->box_ = FLAT_BOX; + s->buttonbox_ = THIN_UP_BOX; + s->textfont_ = HELVETICA_BOLD; +} + +static NamedStyle style("Calendar", revert, &EDE_Calendar::default_style); +NamedStyle* EDE_Calendar::default_style = &::style; + + +// Constructor + +EDE_Calendar::EDE_Calendar(int x,int y,int w,int h,const char *lbl) +: Group(2,2,w-2,h-2,lbl) { + thecalendar = this; + m_globalx = x; m_globaly = y; + + style(default_style); + unsigned i; + + // Header box + m_headerBox = new Group(x,y,w,32); + m_monthNameBox = new InvisibleBox(x,y,w,16); + m_monthNameBox->box(NO_BOX); + + // NLS stuff - FIXME this can't work because gettext needs literals inside _() + for (i=0; i<7;i++) weekDayLabels[i]=_(weekDayLabels[i]); + + // Weekday headers + for (i = 0; i < 7; i++) { + m_dayNameBoxes[i] = new InvisibleBox(x+i*16,y+16,16,16,weekDayLabels[i]); + } + m_headerBox->end(); + + // Day buttons, correct positions are set by resize() + m_buttonBox = new Group(x,y+32,w,64); + m_buttonBox->box(FLAT_BOX); + for (i = 0; i < 31; i++) { + Button *btn = new Button(0,0,16,16,monthDayLabels[i]); + m_dayButtons[i] = btn; + btn->callback(EDE_Calendar::cbDayButtonClicked, (void *)(i+1)); + } + m_buttonBox->end(); + + // Switch buttons, correct positions are set by resize() + for (i = 0; i < 4; i++) { + m_switchButtons[i] = new Button(x,y,16,16,switchLabels[i]); + m_switchButtons[i]->callback(EDE_Calendar::cbSwitchButtonClicked, (void *)monthChanges[i]); + m_switchButtons[i]->labeltype(SYMBOL_LABEL); + } + + end(); + date(Fl_Date_Time::Now()); +} + +/* +// New style ctor +Fl_Calendar::Fl_Calendar(const char* l,int layout_size,Align layout_al,int label_w) +: Group (l,layout_size,layout_al,label_w) +{ + + ctor_init(0,0,w(),h()); +}*/ + +void EDE_Calendar::layout() { + int xx = m_globalx, yy = m_globaly; // in FLTK2 positions are absolute, not relative + int ww = w(), hh = h(); + Rectangle* rect = new Rectangle(xx,yy,ww,hh); + box()->inset(*rect); + unsigned i; + + // one daybox = boxh*boxw is unit of size + int boxh = hh / 10; + int boxw = ww / 7; + + // rounding dimensions to a whole number of boxes + ww = boxw * 7; + hh = hh / boxh * boxh; // why not boxh * 10 ? + + // center horizontally inside this space + xx = xx + (w()-ww)/2+1; + +// if(xxdx()) xx=box()->dx(); //TODO: dx() is no longer available + + // resize header + m_headerBox->resize(xx, yy, ww, boxh*2+2); + m_monthNameBox->resize(xx, yy, ww, boxh); // month name is actually larger + + // resize column titles (Su, Mo, Tu...) + for (i=0; i < 7; i++) { + m_dayNameBoxes[i]->resize(boxw*i + xx, boxh + yy+2, boxw, boxh); // why +2 ? + } + + // compute the month start date + short year, month, day; + if ((double)m_todayDate < 1) m_todayDate = Fl_Date_Time::Now(); + if ((double)m_activeDate < 1) m_activeDate = m_todayDate; + m_activeDate.decode_date(&year,&month,&day); + Fl_Date_Time monthDate(year,month,1); + + // create month name label + char yearstr[4]; + snprintf(yearstr,4,"%d",year); + strncpy(m_headerLabel, monthDate.month_name(), 13); + strcat(m_headerLabel, ", "); + strcat(m_headerLabel, yearstr); + m_monthNameBox->label(m_headerLabel); + + // resize day buttons + int topOffset = boxh*2 + yy+2; + m_buttonBox->resize(xx, topOffset, boxw*7, boxh*6); // background + + int dayOffset = monthDate.day_of_week()-1; + int daysInMonth = monthDate.days_in_month(); + for (i = 0; i < 31; i++) { + Button *btn = m_dayButtons[i]; + btn->resize(dayOffset*boxw + xx, topOffset, boxw, boxh); // 32 = header; bh = daynameboxes + if ((int)i < daysInMonth) { + dayOffset++; + if (dayOffset > 6) { + dayOffset = 0; + topOffset += boxh; + } + btn->show(); + } + else btn->hide(); + } + + int sby = m_buttonBox->y() + m_buttonBox->h(); + for (i = 0; i < 2; i++) + m_switchButtons[i]->resize(i*boxw + xx, sby, boxw, boxh); + + int x1 = ww - boxw * 2; + for (i = 2; i < 4; i++) { + m_switchButtons[i]->resize((i-2)*boxw + x1 + xx, sby, boxw, boxh); + } + + //Clear layout flags + Widget::layout(); +} + +void EDE_Calendar::draw() { + // Note - Fl_Calendar has fixed colors because themes could make it ugly or unreadable + // TODO: Improve this! + +// Color btn_color = color_average(buttoncolor(), WHITE, .4f); + //Color btn_color_hl = color_average(buttoncolor(), GRAY75, .5f); + + //Color btn_color = lerp(buttoncolor(), WHITE, .4f); + Color btn_color = fltk::color(255,255,204); // light yellowish grey a la paper - don't remove fltk:: ! + Color btn_color_hl = WHITE; + Color label_color = BLACK; + Color day_color = lerp(BLUE, GRAY85, .8f); + Color day_color_wknd = lerp(BLUE, WHITE, .9f); // light reddish gray + + unsigned i; + + short year, month, day; + m_activeDate.decode_date(&year,&month,&day); + short activeindex = day-1; + short tyear, tmonth, tday; + m_todayDate.decode_date(&tyear,&tmonth,&tday); + short todayindex = tday-1; + if (tyear != year || tmonth != month) todayindex=-1; + + + for (i = 0; i < 31; i++) { + Button *btn = m_dayButtons[i]; + btn->box(THIN_UP_BOX); + //btn->focusbox(DOTTED_FRAME); + btn->color(btn_color); +// btn->highlight_color(btn_color_hov); + btn->labelfont(labelfont()); + btn->labelcolor(label_color); + btn->labelsize(labelsize()); + if((int)i==activeindex) { + btn->box(FLAT_BOX); + btn->color(btn_color_hl); + } + if((int)i==todayindex) { + //btn->box(BORDER_FRAME); + // TODO: why is this rectangle drawn behind button? +// setcolor((Color)RED); +// drawline(btn->x(),btn->y(),btn->x(),btn->y()+btn->h()); +// drawline(btn->x(),btn->y()+btn->h(),btn->x()+btn->w(),btn->y()+btn->h()); +// drawline(btn->x()+btn->w(),btn->y()+btn->h(),btn->x()+btn->w(),btn->y()); +// drawline(btn->x()+btn->w(),btn->y(),btn->x(),btn->y()); + + btn->focusbox(BORDER_FRAME); + // How do I make a red frame? apparently not possible +// btn->textcolor(RED); + focus(btn); + } + } + + for (i = 0; i < 4; i++) { + m_switchButtons[i]->box(FLAT_BOX); + m_switchButtons[i]->color(WHITE); + m_switchButtons[i]->labelcolor(BLACK); + m_switchButtons[i]->highlight_color(GRAY75); + m_switchButtons[i]->labelsize(labelsize()); + } + + for (i=0; i < 7; i++) { + m_dayNameBoxes[i]->box(buttonbox()); + m_dayNameBoxes[i]->color(day_color); + m_dayNameBoxes[i]->labelcolor(label_color); + m_dayNameBoxes[i]->labelsize(labelsize()); + if(i==0 || i==6) + m_dayNameBoxes[i]->color(day_color_wknd); +// m_dayNameBoxes[i]->labelcolor(RED); + } + + m_monthNameBox->labelfont(textfont()); + m_monthNameBox->labelsize(textsize()); + m_monthNameBox->labelcolor(textcolor()); + +// m_buttonBox->color(darker(buttoncolor())); + m_buttonBox->color(lerp(buttoncolor(),BLACK,.67f)); + + Group::draw(); +} + +void EDE_Calendar::measure(int& ww,int& hh) const { + ww = (w() / 7) * 7; + hh = (h() / 10) * 10; +} + +void EDE_Calendar::date(Fl_Date_Time dt) { + m_todayDate = dt; + m_activeDate = dt; + + short year, month, day; + m_todayDate.decode_date(&year,&month,&day); + focus(m_dayButtons[day-1]); + + relayout(); + redraw(); +} + +Fl_Date_Time EDE_Calendar::date() const { + short year, month, day; + m_todayDate.decode_date(&year,&month,&day); + return Fl_Date_Time(year, month, day); +} + +//------------------------------------------------------------------------------------------------------ + +/* Fl_Popup_Calendar - we lack Fl_Popup_Window to make this work... maybe later + +static void popup_revert(Style* s) +{ + s->color = GRAY75; + s->buttoncolor = GRAY75; + s->box = BORDER_BOX; + s->buttonbox = THIN_UP_BOX; + s->font = HELVETICA_BOLD; +} + +static NamedStyle popup_style("Popup_Calendar", popup_revert, &Fl_Popup_Calendar::default_style); +NamedStyle* Fl_Popup_Calendar::default_style = &::popup_style; + +void cb_clicked(Widget *w, void *d) { + Window *win = w->window(); + if(win) { + win->set_value(); + win->hide(); + } + Fl::exit_modal(); //Just in case :) +} + +Fl_Popup_Calendar::Fl_Popup_Calendar(Widget *dateControl) + : Fl_Popup_Window(150,150,"Calendar") +{ + style(default_style); + m_dateControl = dateControl; + m_calendar = new Fl_Calendar(0,0,w(),h()); + m_calendar->callback(cb_clicked); + m_calendar->box(NO_BOX); + m_calendar->copy_style(style()); + + end(); +} + +void Fl_Popup_Calendar::draw() +{ + m_calendar->copy_style(style()); + Fl_Popup_Window::draw(); +} + +void Fl_Popup_Calendar::layout() { + m_calendar->resize(box()->dx(),box()->dy(),w()-box()->dw(),h()-box()->dh()); + m_calendar->layout(); + Fl_Popup_Window::layout(); +} + +bool Fl_Popup_Calendar::popup() { + if (m_dateControl) { + int width = m_dateControl->w(); + if (width < 175) width = 175; + int X=0, Y=0; + for(Widget* w = m_dateControl; w; w = w->parent()) { + X += w->x(); + Y += w->y(); + } + int height = 160; + m_calendar->size(width,height); + m_calendar->measure(width,height); + + resize(X, Y+m_dateControl->h()-1, width+box()->dw(), height+box()->dh()); + } + return Fl_Popup_Window::show_popup(); +} + +bool Fl_Popup_Calendar::popup(Widget *dateControl, int X, int Y, int W, int H) { + if(dateControl) { + int width = (W>0) ? W : dateControl->w(); + if (width < 175) width = 175; + int height = (H>0) ? H : 175; + if (height < 175) height = 175; + for(Widget* w = m_dateControl; w; w = w->parent()) { + X += w->x(); + Y += w->y(); + } + resize(X, Y, width, height); + } + return Fl_Popup_Window::show_popup(); +} + + +int Fl_Popup_Calendar::handle(int event) { + int rc = Fl_Popup_Window::handle(event); + + if (rc) return rc; + + return m_calendar->handle(event); +}*/ diff --git a/etimedate/EDE_Calendar.h b/etimedate/EDE_Calendar.h new file mode 100644 index 0000000..1b0279e --- /dev/null +++ b/etimedate/EDE_Calendar.h @@ -0,0 +1,111 @@ +/* + * $Id$ + * + * Extended Fast Light Toolkit (EFLTK) + * Copyright (C) 2002-2003 by EDE-Team + * WWW: http://www.sourceforge.net/projects/ede + * + * Fast Light Toolkit (FLTK) + * Copyright (C) 1998-2003 by Bill Spitzak and others. + * WWW: http://www.fltk.org + * + * This library is distributed under the GNU LIBRARY GENERAL PUBLIC LICENSE + * version 2. See COPYING for details. + * + * Author : Alexey Parshin + * Email : alexey@fltk.net + * + * Please report all bugs and problems to "efltk-bugs@fltk.net" + * + */ +// +// Ported to FLTK2 by Vedran Ljubovic , 2005. + +#ifndef _EDE_CALENDAR_H_ +#define _EDE_CALENDAR_H_ + +/* +#include +#include +#include +#include +#include */ + +#include "Fl_Date_Time.h" +#include +#include +#include +#include + +/** Fl_Calendar */ +class EDE_Calendar : public fltk::Group { +public: + static fltk::NamedStyle* default_style; + + /** The traditional constructor creates the calendar using the position, size, and label. */ + EDE_Calendar(int x,int y,int w,int h,const char *lbl=0L); + + /** The new style constructor creates the calendar using the label, size, alignment, and label_width. */ +// Fl_Calendar(const char* l = 0,int layout_size=30,fltk::Align layout_al=fltk::ALIGN_TOP,int label_w=100); + + virtual void layout(); + virtual void draw(); + virtual void measure(int& w,int& h) const; + + virtual void reset() { date(Fl_Date_Time::Now()); } + + void date(Fl_Date_Time dt); + Fl_Date_Time date() const; + + void dayButtonClicked(unsigned day); + void dayButtonChanged(unsigned day); + void switchButtonClicked(int monthChange); + +private: + static void cbDayButtonClicked(fltk::Widget *,void *); + static void cbSwitchButtonClicked(fltk::Widget *,void *); + + fltk::Group *m_headerBox; + fltk::Group *m_buttonBox; + fltk::InvisibleBox *m_monthNameBox; + fltk::InvisibleBox *m_dayNameBoxes[7]; + fltk::Button *m_dayButtons[31]; + fltk::Button *m_switchButtons[4]; + Fl_Date_Time m_todayDate; + Fl_Date_Time m_activeDate; + int m_globalx, m_globaly; + char m_headerLabel[20]; // month+year shouldn't get larger in any locale + + + void ctor_init(int x,int y,int w,int h); +}; + +/* We lack Fl_Popup_Window to make this work... Maybe later... + +class Fl_Popup_Calendar : public Fl_Popup_Window { +public: + static fltk::NamedStyle* default_style; + + Fl_Popup_Calendar(fltk::Widget *dateControl=NULL); + + Fl_Calendar *calendar() { return m_calendar; } + + void clicked() { set_value(); } + void layout(); + void draw(); + int handle(int); + + void date(Fl_Date_Time dt) { m_calendar->date(dt); } + Fl_Date_Time date() const { return m_calendar->date(); } + + bool popup(); + // Popup calendar, relative to widget + bool popup(fltk::Widget *dateControl, int X, int Y, int W=0, int H=0); + +private: + friend class Fl_Calendar; + Fl_Calendar *m_calendar; + fltk::Widget *m_dateControl; +};*/ + +#endif diff --git a/etimedate/Fl_Date_Time.cpp b/etimedate/Fl_Date_Time.cpp new file mode 100644 index 0000000..d2077ef --- /dev/null +++ b/etimedate/Fl_Date_Time.cpp @@ -0,0 +1,735 @@ +/*************************************************************************** + Fl_Date_Time.cpp - description + ------------------- + begin : Tue Dec 14 1999 + copyright : (C) 1999 by Alexey Parshin + email : alexeyp@m7.tts-sf.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ +// +// Ported to FLTK2 by Vedran Ljubovic , 2005. + +//#include +//#include + +/*#include +#include */ + +#include "Fl_Date_Time.h" + +// For NLS stuff +//#include "../core/fl_internal.h" +#include "../edelib2/NLS.h" +#include + +#include +#include +#include +#include + +#ifndef _WIN32 +# include +#else +# include +#endif + +static const char *dayname[] = { + "Sunday", "Monday", "Tuesday", "Wednesday", + "Thursday", "Friday", "Saturday" +}; + +static const char *mname[] = { + "January", "February", "March", "April", "May", "June", + "July", "August", "September", "October", "November", "December" +}; + +static const short _monthDays[2][12] = { + {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}, + {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31} //Leap year +}; + +static const short _monthDaySums[2][12] = { + {0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334}, + {0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335} //Leap year +}; + +#define DateDelta 693594 + +char Fl_Date_Time::dateInputFormat[32]; +char Fl_Date_Time::timeInputFormat[32]; +char Fl_Date_Time::dateFormat[32]; +char Fl_Date_Time::datePartsOrder[4]; +char Fl_Date_Time::timeFormat[32]; +bool Fl_Date_Time::time24Mode; +char Fl_Date_Time::dateSeparator; +char Fl_Date_Time::timeSeparator; +double Fl_Date_Time::dateTimeOffset; + +static void upperCase(char *dest, const char *src, int dest_len) { + int i = 0; + int len = strlen(src); + if(len>dest_len) len=dest_len; //No buffer overflow. + for (; i < len; i++) + dest[i] = (char)toupper( src[i] ); + dest[i] = '\0'; +} + +static int trimRight(char *s) { + int len = strlen(s); + while( (len--) >= 0) { + if( (unsigned char)s[len] > 32 ) { + len++; + s[len] = '\0'; + break; + } + } + return len; +} + +static char parseDateOrTime(char *format,char *dt) { + char separator[] = " "; + + // Cut-off trailing non-digit characters + int len = strlen(dt); + char *ptr = dt + len - 1; + while (!isdigit(*ptr)) ptr--; + *(ptr+1) = 0; + // find a separator char + ptr = dt; + while (isalnum(*ptr) || *ptr == ' ') ptr++; + separator[0] = *ptr; + ptr = strtok(dt,separator); + strcpy(format,""); + + const char *pattern; + while (ptr) { + int number = atoi(ptr); + switch (number) { + case 10: pattern = "HH"; // hour (12-hour mode) + Fl_Date_Time::time24Mode = false; + break; + case 22: pattern = "HH"; // hour (24-hour mode) + Fl_Date_Time::time24Mode = true; + break; + case 48: pattern = "NN"; // minute + break; + case 59: pattern = "SS"; // second + break; + case 17: pattern = "DD"; // day + strcat(Fl_Date_Time::datePartsOrder,"D"); + break; + case 6: pattern = "MM"; // month + strcat(Fl_Date_Time::datePartsOrder,"M"); + break; + case 2000: + case 0: pattern = "YYYY"; // year + strcat(Fl_Date_Time::datePartsOrder,"Y"); + break; + default: pattern = NULL; break; + } + if (pattern) { + strcat(format,pattern); + strcat(format,separator); + } + ptr = strtok(NULL,separator); + } + len = strlen(format); + if (len) + format[len-1] = 0; + + return separator[0]; +} + +class Fl_Date_Time_Format { +public: + Fl_Date_Time_Format(); +}; + +static void buildDateInputFormat() { + Fl_Date_Time::dateInputFormat[0] = 0; + char separator[] = { Fl_Date_Time::dateSeparator, 0 }; + for (int i = 0; i < 3; i++) + switch (Fl_Date_Time::datePartsOrder[i]) { + case 'D': strcat(Fl_Date_Time::dateInputFormat,"39\\"); + strcat(Fl_Date_Time::dateInputFormat,separator); + break; + case 'M': strcat(Fl_Date_Time::dateInputFormat,"19\\"); + strcat(Fl_Date_Time::dateInputFormat,separator); + break; + case 'Y': strcat(Fl_Date_Time::dateInputFormat,"2999\\"); + strcat(Fl_Date_Time::dateInputFormat,separator); + break; + } + int len = strlen(Fl_Date_Time::dateInputFormat); + if (len) + Fl_Date_Time::dateInputFormat[len-2] = 0; +} + +static void buildTimeInputFormat() { + if (Fl_Date_Time::time24Mode) + strcpy(Fl_Date_Time::timeInputFormat,"29\\:59"); + else strcpy(Fl_Date_Time::timeInputFormat,"19\\:59T\\M"); +} + +Fl_Date_Time_Format::Fl_Date_Time_Format() { + char dateBuffer[32]; + char timeBuffer[32]; + // make a special date and time - today :) + struct tm t; + t.tm_year = 100; // since 1900, -> 2000 + t.tm_mon = 5; // June (January=0) + t.tm_mday = 17; + t.tm_hour = 22; + t.tm_min = 48; + t.tm_sec = 59; + + t.tm_wday = 0; // Sunday + + // Build local data and time + strftime(timeBuffer,32,"%X",&t); + strftime(dateBuffer,32,"%x",&t); + + // Build local date and time formats + Fl_Date_Time::datePartsOrder[0] = 0; + Fl_Date_Time::time24Mode = false; // to be determined below + Fl_Date_Time::dateSeparator = parseDateOrTime(Fl_Date_Time::dateFormat,dateBuffer); + Fl_Date_Time::timeSeparator = parseDateOrTime(Fl_Date_Time::timeFormat,timeBuffer); + if (!Fl_Date_Time::time24Mode) + strcat(Fl_Date_Time::timeFormat,"AM"); + buildDateInputFormat(); + buildTimeInputFormat(); +} + +// This is the only instance to Fl_Date_Time_Format. +static Fl_Date_Time_Format dateFormat; + +bool Fl_Date_Time::is_leap_year(const short year) { + return ((year&3) == 0 && year%100 != 0 || year%400 == 0); +} + +void Fl_Date_Time::encode_date(double &dt,short year,short month,short day) { + if (year == 0 && month == 0 && day == 0) { + dt = 0; + return; + } + if (month < 1 || month > 12) { + dt = 0; + return; + } + int yearKind = is_leap_year(year); + if (day < 1 || day > _monthDays[yearKind][month-1]) { + dt = 0; + return; + } + + if (year <= 0 || year > 9999) { + dt = 0; + return; + } + + day += _monthDaySums[yearKind][month-1]; + int i = year - 1; + dt = i * 365 + i / 4 - i / 100 + i / 400 + day - DateDelta; +} + +void Fl_Date_Time::encode_date(double &dt,const char *dat) { + char bdat[64]; + short datePart[7], partNumber = 0; + char *ptr = NULL; + int i; + + memset(datePart,0,sizeof(datePart)); + upperCase(bdat, dat, sizeof(bdat)); + + if (strcmp(bdat,"TODAY") == 0) { + dt = Date(); // Sets the current date + return; + } else { + int len = strlen(bdat); + for(i = 0; i <= len && partNumber < 7; i++) { + char c = bdat[i]; + if (c == dateSeparator || c == timeSeparator || c == ' ' || c == 0) { + if (c == timeSeparator && partNumber < 3) partNumber = 3; + if (ptr) { // end of token + bdat[i] = 0; + datePart[partNumber] = (short)atoi(ptr); + partNumber++; + ptr = NULL; + } + } else { + if (!isdigit(c)) { + dt = 0; + return; + } + if (!ptr) ptr = bdat + i; + } + } + if (partNumber < 3) { // Not enough date parts + dt = 0; + return; + } + short month=0, day=0, year=0; + for(i = 0; i < 3; i++) + switch (datePartsOrder[i]) { + case 'M': month = datePart[i]; break; + case 'D': day = datePart[i]; break; + case 'Y': year = datePart[i]; break; + } + if (year < 100) { + if (year < 35) year = short(year + 2000); + else year = short(year + 1900); + } + double dd; + encode_date(dd,year,month,day); + if (partNumber > 3) { // Time part included into string + double d; + encode_time(d,datePart[3],datePart[4],datePart[5],datePart[6]); + dd += d; + } + dt = dd; + + } +} + +void Fl_Date_Time::encode_time(double& dt,short h,short m,short s,short ms) { + dt = (h + ((m + (s + ms / 100.0) / 60.0) / 60.0)) / 24.0; +} + +void Fl_Date_Time::encode_time(double& dt,const char *tim) { + char bdat[32]; + short timePart[4] = { 0, 0, 0, 0}, + partNumber = 0; + char *ptr = NULL; + bool afternoon = false; + + upperCase(bdat, tim, sizeof(bdat)); + + if (!trimRight(bdat)) { + dt = 0; + return; + } + + if (strcmp(bdat,"TIME") == 0) { + dt = Time(); // Sets the current date + return; + } else { + char *p = strstr(bdat,"AM"); + if (p) { + *p = 0; + } else { + p = strstr(bdat,"PM"); + if (p) { + *p = 0; + afternoon = true; + } + } + trimRight(bdat); + int len = strlen(bdat); + for (int i = 0; i <= len && partNumber < 4; i++) { + char c = bdat[i]; + if (c == timeSeparator || c == ' ' || c == '.' || c == 0) { + if (ptr) { // end of token + bdat[i] = 0; + timePart[partNumber] = (short) atoi(ptr); + partNumber++; + ptr = NULL; + } + } else { + if (!isdigit(c)) { + dt = 0; + return; + } + if (!ptr) ptr = bdat + i; + } + } + if (afternoon && timePart[0] != 12) + timePart[0] = short(timePart[0] + 12); + encode_time(dt,timePart[0],timePart[1],timePart[2],timePart[3]); + } +} + +const int S1 = 24 * 60 * 60; // seconds in 1 day + +void Fl_Date_Time::decode_time(const double dt,short& h,short& m,short& s,short& ms) { + double t = dt - (int) dt; + + int secs = int(t * S1 + 0.5); + h = short(secs / 3600); + secs = secs % 3600; + m = short(secs / 60); + secs = secs % 60; + s = short(secs); + ms = 0; +} + +const int D1 = 365; // Days in 1 year +const int D4 = D1 * 4 + 1; // Days in 4 years +const int D100 = D4 * 25 - 1; // Days in 100 years +const int D400 = D100 * 4 + 1; // Days in 400 years + +static void DivMod(int op1, int op2, int& div, int& mod) { + div = op1 / op2; + mod = op1 % op2; +} + +void Fl_Date_Time::decode_date(const double dat, short& year, short& month, short& day) { + int Y, M, D, I; + int T = (int) dat + DateDelta; + + T--; + Y = 1; + while (T >= D400) { + T -= D400; + Y += 400; + } + + DivMod(T, D100, I, D); + if (I == 4) { + I--; + D += D100; + } + + Y += I * 100; + DivMod(D, D4, I, D); + Y += I * 4; + DivMod(D, D1, I, D); + if (I == 4) { + I--; + D += D1; + } + Y += I; + year = Y; + //year = short (Y + 1900); + + int leapYear = is_leap_year(short(year)); + for (M = 0;;M++) { + I = _monthDays[leapYear][M]; + if (D < I) + break; + D -= I; + } + + month = short (M + 1); + day = short (D + 1); +} + +//---------------------------------------------------------------- +// Constructors +//---------------------------------------------------------------- +Fl_Date_Time::Fl_Date_Time (short year,short month,short day,short hour,short minute,short second) { + double t; + int i; + // NLS stuff + for (i=0; i<7;i++) dayname[i]=_(dayname[i]); + for (i=0; i<12;i++) mname[i]=_(mname[i]); + + encode_date(m_dateTime,year,month,day); + encode_time(t,hour,minute,second); + m_dateTime += t; +} + +Fl_Date_Time::Fl_Date_Time (const char * dat) { + + int i; + // NLS stuff + for (i=0; i<7;i++) dayname[i]=_(dayname[i]); + for (i=0; i<12;i++) mname[i]=_(mname[i]); + + char* s1 = strdup(dat);//( Fl_String(dat).trim() ); + // TODO: s1.trim() + char* s2; + + if (!*dat) { + m_dateTime = 0; + return; + } + s1 = strtok(s1, " "); + char* p = strtok(NULL, " "); + if (p != NULL) { + s2 = strdup(p+1); + if (strlen(s2)>21) s2[21] = '\0'; + // TODO: s2.trim() + // s1[p] = '\0'; - strtok() already did that + } + if ( strchr(s1,dateSeparator) ) { + encode_date(m_dateTime, s1); + if ( strchr(s2,timeSeparator) ) { + double dt; + encode_time(dt, s2); + m_dateTime += dt; + } + } + else encode_time(m_dateTime, s1); +} + +Fl_Date_Time::Fl_Date_Time (const Fl_Date_Time &dt) { + int i; + // NLS stuff + for (i=0; i<7;i++) dayname[i]=_(dayname[i]); + for (i=0; i<12;i++) mname[i]=_(mname[i]); + + m_dateTime = dt.m_dateTime; +} + +Fl_Date_Time::Fl_Date_Time (const double dt) { + int i; + // NLS stuff + for (i=0; i<7;i++) dayname[i]=_(dayname[i]); + for (i=0; i<12;i++) mname[i]=_(mname[i]); + + m_dateTime = dt; +} +//---------------------------------------------------------------- +// Assignments +//---------------------------------------------------------------- +void Fl_Date_Time::operator = (const Fl_Date_Time &dt) { + m_dateTime = dt.m_dateTime; +} + +void Fl_Date_Time::operator = (const char * dat) { + encode_date(m_dateTime, dat); +} + +//---------------------------------------------------------------- +// Conversion operations +//---------------------------------------------------------------- +// Fl_Date_Time::operator int (void) { return (int) dateTime; } + +Fl_Date_Time::operator double (void) const { return m_dateTime; } + +//---------------------------------------------------------------- +// Date Arithmetic +//---------------------------------------------------------------- +Fl_Date_Time Fl_Date_Time::operator + (int i) { + return Fl_Date_Time(m_dateTime + i); +} + +Fl_Date_Time Fl_Date_Time::operator - (int i) { + return Fl_Date_Time(m_dateTime - i); +} + +Fl_Date_Time Fl_Date_Time::operator + (Fl_Date_Time& dt) { + return Fl_Date_Time(m_dateTime + dt.m_dateTime); +} + +Fl_Date_Time Fl_Date_Time::operator - (Fl_Date_Time& dt) { + return Fl_Date_Time(m_dateTime - dt.m_dateTime); +} + +Fl_Date_Time& Fl_Date_Time::operator += (int i) { + m_dateTime += i; + return *this; +} + +Fl_Date_Time& Fl_Date_Time::operator -= (int i) { + m_dateTime -= i; + return *this; +} + +Fl_Date_Time& Fl_Date_Time::operator += (Fl_Date_Time& dt) { + m_dateTime += dt.m_dateTime; + return *this; +} + +Fl_Date_Time& Fl_Date_Time::operator -= (Fl_Date_Time& dt) { + m_dateTime -= dt.m_dateTime; + return *this; +} + +Fl_Date_Time& Fl_Date_Time::operator ++() { + m_dateTime += 1; + return *this; +} + +Fl_Date_Time &Fl_Date_Time::operator ++(int) { + m_dateTime += 1; + return *this; +} + +Fl_Date_Time &Fl_Date_Time::operator --() { + m_dateTime -= 1; + return *this; +} + +Fl_Date_Time &Fl_Date_Time::operator --(int) { + m_dateTime -= 1; + return *this; +} + +//---------------------------------------------------------------- +// Format routine +//---------------------------------------------------------------- +void Fl_Date_Time::format_date (char *str) const { + char *ptr = str; + short month, day, year; + + if (m_dateTime == 0) { + *str = 0; + return; + } + decode_date(m_dateTime,year,month,day); + for (int i = 0; i < 3; i++) { + switch (datePartsOrder[i]) { + case 'M': sprintf(ptr,"%02i%c",month,dateSeparator); + break; + case 'D': sprintf(ptr,"%02i%c",day,dateSeparator); + break; + case 'Y': sprintf(ptr,"%04i%c",year,dateSeparator); + break; + } + ptr += strlen(ptr); + } + *(ptr-1) = 0; +} + +void Fl_Date_Time::format_time (char *str,bool ampm) const { + short h,m,s,ms; + + if (m_dateTime == 0) { + *str = 0; + return; + } + decode_time(m_dateTime,h,m,s,ms); + if (ampm) { + char format[] = "%02i%c%02iAM"; + if (h > 11) format[10] = 'P'; + sprintf(str,format,h%12,timeSeparator,m); + } + else sprintf(str,"%02i%c%02i%c%02i",h,timeSeparator,m,timeSeparator,s); +} +//---------------------------------------------------------------- +// Miscellaneous Routines +//---------------------------------------------------------------- +short Fl_Date_Time::day_of_year( void ) const { + Fl_Date_Time temp( 1, 1, year() ); + + return (short) (m_dateTime - temp.m_dateTime); +} + +Fl_Date_Time Fl_Date_Time::convert(const long tt) { + struct tm *t = localtime((time_t*)&tt); + double dat,tim; + encode_date(dat,short(t->tm_year+1900),short(t->tm_mon+1),short(t->tm_mday)); + encode_time(tim,short(t->tm_hour),short(t->tm_min),short(t->tm_sec),short(0)); + return dat + tim; +} + +#ifdef _WIN32 +#define FILETIME_1970 0x019db1ded53e8000 +const BYTE DWLEN = sizeof(DWORD) * 8; +/* Code ripped from some xntp implementation on http://src.openresources.com. */ +long get_usec() +{ + FILETIME ft; + __int64 msec; + GetSystemTimeAsFileTime(&ft); + msec = (__int64) ft.dwHighDateTime << DWLEN | ft.dwLowDateTime; + msec = (msec - FILETIME_1970) / 10; + return (long) (msec % 1000000); +} +#endif + +// Get the current system time +Fl_Date_Time Fl_Date_Time::System() { + time_t tt; + time(&tt); + double datetime = convert(tt); +#ifndef _WIN32 + timeval tp; + gettimeofday(&tp,0L); + double mcsec = tp.tv_usec / 1000000.0 / (3600 * 24); +#else + // This works now! + double mcsec = get_usec() / 1000000.0 / (3600 * 24); +#endif + return datetime + mcsec; +} + +// Get the current system time with optional synchronization offset +Fl_Date_Time Fl_Date_Time::Now() { + return (double)Fl_Date_Time::System() + Fl_Date_Time::dateTimeOffset; +} + +// Set the synchronization offset +void Fl_Date_Time::Now(Fl_Date_Time dt) { + Fl_Date_Time::dateTimeOffset = (double)dt - (double)Fl_Date_Time::System(); +} + +Fl_Date_Time Fl_Date_Time::Date() { + double dat = Now(); + return double(int(dat)); +} + +Fl_Date_Time Fl_Date_Time::Time() { + double dat = Now(); + return dat - int(dat); +} + +short Fl_Date_Time::days_in_month() const { + short y, m, d; + decode_date(m_dateTime,y,m,d); + return _monthDays[is_leap_year(y)][m-1]; +} + +unsigned Fl_Date_Time::date() const { + return unsigned(m_dateTime); +} + +short Fl_Date_Time::day() const { + short y, m, d; + decode_date(m_dateTime,y,m,d); + return d; +} + +short Fl_Date_Time::month() const { + short y, m, d; + decode_date(m_dateTime,y,m,d); + return m; +} + +short Fl_Date_Time::year() const { + short y, m, d; + decode_date(m_dateTime,y,m,d); + return y; +} + +short Fl_Date_Time::day_of_week (void) const { + return short((int(m_dateTime) - 1) % 7 + 1); +} + +char* Fl_Date_Time::day_name (void) const { + return strdup(dayname[day_of_week() - 1]); +} + +char* Fl_Date_Time::month_name() const { + return strdup(mname[month()-1]); +} + +char* Fl_Date_Time::date_string() const { + char buffer[32]; + format_date(buffer); + return strdup(buffer); +} + +char* Fl_Date_Time::time_string() const { + char buffer[32]; + format_time(buffer,!time24Mode); + return strdup(buffer); +} + +void Fl_Date_Time::decode_date(short *y,short *m,short *d) const { + decode_date(m_dateTime,*y,*m,*d); +} + +void Fl_Date_Time::decode_time(short *h,short *m,short *s,short *ms) const { + decode_time(m_dateTime,*h,*m,*s,*ms); +} + diff --git a/etimedate/Fl_Date_Time.h b/etimedate/Fl_Date_Time.h new file mode 100644 index 0000000..44d7f48 --- /dev/null +++ b/etimedate/Fl_Date_Time.h @@ -0,0 +1,120 @@ +/* + * $Id$ + * + * Extended Fast Light Toolkit (EFLTK) + * Copyright (C) 2002-2003 by EDE-Team + * WWW: http://www.sourceforge.net/projects/ede + * + * Fast Light Toolkit (FLTK) + * Copyright (C) 1998-2003 by Bill Spitzak and others. + * WWW: http://www.fltk.org + * + * This library is distributed under the GNU LIBRARY GENERAL PUBLIC LICENSE + * version 2. See COPYING for details. + * + * Author : Alexey Parshin + * Email : alexey@fltk.net + * + * Please report all bugs and problems to "efltk-bugs@fltk.net" + * + */ +// +// Ported to FLTK2 by Vedran Ljubovic , 2005. + +#ifndef _FL_DATE_TIME_H_ +#define _FL_DATE_TIME_H_ + +/*#include "Fl_Export.h" +#include "Fl_String.h"*/ + +/** Fl_Date_Time */ +class Fl_Date_Time { +public: + static char dateInputFormat[32]; + static char timeInputFormat[32]; + static char dateFormat[32]; + static char timeFormat[32]; + static char datePartsOrder[4]; + static char dateSeparator; + static char timeSeparator; + static bool time24Mode; + + Fl_Date_Time (short y,short m,short d,short hour=0,short minute=0,short second=0); + Fl_Date_Time (const char * dat); + Fl_Date_Time (const Fl_Date_Time &dt); + Fl_Date_Time (const double dt=0); + + static Fl_Date_Time convert (const long); + + void format_date(char *str) const; + void format_time(char *str, bool ampm=true) const; + + // These functions don't affect the actual system time. + // You can only alter the time for the current program. + static void Now(Fl_Date_Time dt); // Sets to current date and time + static Fl_Date_Time System(); // Gets to current system date and time + static Fl_Date_Time Now(); // Gets to current date and time + static Fl_Date_Time Date(); // Gets to current date + static Fl_Date_Time Time(); // Gets to current time + + short days_in_month() const; // Number of days in month (1..31) + short day_of_week() const; // (1..7) + short day_of_year() const; // returns relative date since Jan. 1 + + char* day_name() const; // Character Day Of Week ('Sunday'..'Saturday') + char* month_name() const; // Character Month name + + unsigned date() const; // Numeric date of date object + short day() const; // Numeric day of date object + short month() const; // Month number (1..12) + short year() const; + + char* date_string() const; + char* time_string() const; + + void decode_date(short *y,short *m,short *d) const; + void decode_time(short *h,short *m,short *s,short *ms) const; + + operator double (void) const; + + void operator = (const Fl_Date_Time& date); + void operator = (const char * dat); + + Fl_Date_Time operator + (int i); + Fl_Date_Time operator - (int i); + Fl_Date_Time operator + (Fl_Date_Time& dt); + Fl_Date_Time operator - (Fl_Date_Time& dt); + + Fl_Date_Time& operator += (int i); + Fl_Date_Time& operator -= (int i); + Fl_Date_Time& operator += (Fl_Date_Time& dt); + Fl_Date_Time& operator -= (Fl_Date_Time& dt); + + Fl_Date_Time& operator ++ (); // Prefix increment + Fl_Date_Time& operator ++ (int); // Postfix increment + Fl_Date_Time& operator -- (); // Prefix decrement + Fl_Date_Time& operator -- (int); // Postfix decrement + + static void decode_date(const double dt,short& y,short& m,short& d); + static void decode_time(const double dt,short& h,short& m,short& s,short& ms); + static void encode_date(double &dt,short y=0,short m=0,short d=0); + static void encode_date(double &dt,const char *dat); + static void encode_time(double &dt,short h=0,short m=0,short s=0,short ms=0); + static void encode_time(double &dt,const char *tim); + static bool is_leap_year(const short year); + +protected: + double m_dateTime; + static double dateTimeOffset; // The offset from current' system time for synchronization + // with outside system +}; + +// Date comparison +static inline bool operator < (const Fl_Date_Time &dt1, const Fl_Date_Time &dt2) { return ( (double)dt1 < (double)dt2 ); } +static inline bool operator <= (const Fl_Date_Time &dt1, const Fl_Date_Time &dt2) { return ( (double)dt1 <= (double)dt2 ); } +static inline bool operator > (const Fl_Date_Time &dt1, const Fl_Date_Time &dt2) { return ( (double)dt1 > (double)dt2 ); } +static inline bool operator >= (const Fl_Date_Time &dt1, const Fl_Date_Time &dt2) { return ( (double)dt1 >= (double)dt2 ); } +static inline bool operator == (const Fl_Date_Time &dt1, const Fl_Date_Time &dt2) { return ( (double)dt1 == (double)dt2 ); } +static inline bool operator != (const Fl_Date_Time &dt1, const Fl_Date_Time &dt2) { return ( (double)dt1 != (double)dt2 ); } + +#endif diff --git a/etimedate/Jamfile b/etimedate/Jamfile new file mode 100644 index 0000000..d296bc7 --- /dev/null +++ b/etimedate/Jamfile @@ -0,0 +1,16 @@ +# +# $Id$ +# +# Part of Equinox Desktop Environment (EDE). +# Copyright (c) 2000-2007 EDE Authors. +# +# This program is licenced under terms of the +# GNU General Public Licence version 2 or newer. +# See COPYING for details. + +SubDir TOP etimedate ; + +SOURCE = etimedate.cpp TimeBox.cpp EDE_Calendar.cpp Fl_Date_Time.cpp ; + +MakeProgram etimedate : $(SOURCE) ; +ExtractStrings locale : $(SOURCE) ; diff --git a/etimedate/Makefile b/etimedate/Makefile new file mode 100644 index 0000000..dee0db4 --- /dev/null +++ b/etimedate/Makefile @@ -0,0 +1,22 @@ + +CPPFILES = ../edelib2/Util.cpp ../edelib2/Config.cpp ../edelib2/Run.cpp ../edelib2/process.cpp ../edelib2/pty.cpp etimedate.cpp TimeBox.cpp EDE_Calendar.cpp Fl_Date_Time.cpp +TARGET = etimedate + +POFILES = locale/ru.po\ + locale/sr.po\ + locale/sk.po\ + locale/hu.po\ + +include ../makeinclude + +install: + $(INSTALL_PROGRAM) $(TARGET) $(bindir) + $(INSTALL_LOCALE) + +uninstall: + $(RM) $(bindir)/$(TARGET) + +clean: + $(RM) $(TARGET) + $(RM) *.o + diff --git a/etimedate/TODO b/etimedate/TODO new file mode 100644 index 0000000..c04dc69 --- /dev/null +++ b/etimedate/TODO @@ -0,0 +1,17 @@ +TODO with etimedate: +* calendar +- review methods and add new, for better future usability +- create new doxygen documentation +- add ability to calculate difference between selected date and today +* clock +- redesign clock - use bitmaps for background and possibly hands +- add seconds to input and buttons +- use Date_Time class +- remove unnecessary methods, add new ones +- merge two boxes? +- make hands movable with mouse +* timezones +- add city coordinates (find in evolution / kde), draw current zone on map +- make map sensitive / hotspots on city coordinates +* Date_Time class +- new class \ No newline at end of file diff --git a/etimedate/TimeBox.cpp b/etimedate/TimeBox.cpp new file mode 100644 index 0000000..5453cae --- /dev/null +++ b/etimedate/TimeBox.cpp @@ -0,0 +1,461 @@ +// TimeBox.cxx +// Class that displays a clock with ability to set time +// Part of Equinox Desktop Environment (EDE) +// +// Based on Fl_Time.cxx +// Copyright (C) 2000 Softfield Research Ltd. +// +// Changes 02/09/2001 by Martin Pekar +// Ported to FLTK2 and redesigned by Vedran Ljubovic , 2005. +// +// This program is licenced under terms of the +// GNU General Public Licence version 2 or newer. +// See COPYING for details. + +// TODO: Update from clock example in latest fltk2 test + +// Note V.Lj.: I don't think we need all of this, some code could be +// safely removed + +#include +#include +#include +#include + +#include +#include +#include "../edelib2/NLS.h" +#include +#include + +#include "etimedate.h" +#include "TimeBox.h" + + +// Constructor + +TimeBox::TimeBox(int x, int y, int w, int h, char *l) : fltk::Group(x, y, w, h, l) +{ + // Basic layout of TimeBox + // TODO: this should be part of draw() so that the widget could be resizable + int button_width; // button_height=button_width + int realx,realy,realh,realw; //realh = realw + realw/7 (buttons) + + if (h >= w * 8/7) { + realx = x; + realy = y + (h-(int)(w*8/7))/2; + realw = w; + realh = (int)w * 8/7; + } else { + realx = x + (w-(int)(h*7/8))/2; + realy = y; + realw = (int)h * 7/8; + realh = h; + } + button_width = (int)(realw/7); + + clock = new fltk::ClockOutput(realx, realy, realw, realw); + + input_time = new fltk::Input(realx, realy+realw, realw - button_width * 4, button_width, 0); + input_time->callback(input_changed_cb, this); + input_time->when(fltk::WHEN_CHANGED); +// input_time->textsize(12); + + button_decrease_hour = new fltk::Button(realx + realw - 4 * button_width, realy+realw + 2, button_width, button_width-4, "@-1<<"); + button_decrease_hour->callback(button_cb, this); + button_decrease_hour->labeltype(fltk::SYMBOL_LABEL); + button_decrease_hour->box(fltk::THIN_UP_BOX); +// button_decrease_hour->labelcolor(buttoncolor()); +// button_decrease_hour->highlight_color(fltk::color_average(buttoncolor(), fltk::GRAY, .5f)); + button_decrease_hour->highlight_color(fltk::lerp(buttoncolor(),fltk::WHITE,.67f)); // ex. fl_lighter() + + button_increase_hour = new fltk::Button(realx + realw - 3 * button_width, realy+realw + 2, button_width, button_width-4, "@-1>>"); + button_increase_hour->callback(button_cb, this); + button_increase_hour->labeltype(fltk::SYMBOL_LABEL); + button_increase_hour->box(fltk::THIN_UP_BOX); +// button_increase_hour->labelcolor(buttoncolor()); +// button_increase_hour->highlightcolor(fltk::color_average(buttoncolor(), fltk::GRAY, .5f)); + button_increase_hour->highlight_color(fltk::lerp(buttoncolor(),fltk::WHITE,.67f)); // ex. fl_lighter() + + button_decrease_minute = new fltk::Button(realx + realw - 2 * button_width, realy+realw + 2, button_width, button_width-4, "@-1<"); + button_decrease_minute->callback(button_cb, this); + button_decrease_minute->labeltype(fltk::SYMBOL_LABEL); + button_decrease_minute->box(fltk::THIN_UP_BOX); +// button_decrease_minute->labelcolor(buttoncolor()); +// button_decrease_minute->highlight_color(fltk::color_average(buttoncolor(), fltk::GRAY, .5f)); + button_decrease_minute->highlight_color(fltk::lerp(buttoncolor(),fltk::WHITE,.67f)); // ex. fl_lighter() + + button_increase_minute = new fltk::Button(realx + realw - button_width, realy+realw + 2, button_width, button_width-4, "@-1>"); + button_increase_minute->callback(button_cb, this); + button_increase_minute->labeltype(fltk::SYMBOL_LABEL); + button_increase_minute->box(fltk::THIN_UP_BOX); +// button_increase_minute->labelcolor(buttoncolor()); +// button_increase_minute->highlight_color(fltk::color_average(buttoncolor(), fltk::GRAY, .5f)); + button_increase_minute->highlight_color(fltk::lerp(buttoncolor(),fltk::WHITE,.67f)); // ex. fl_lighter() + + end(); + +//type(fltk::TIME_12HOUR); + // TODO: read this from current locale + type(TIMEBOX_24HOUR); + current_tv = (struct timeval*)malloc(sizeof(struct timeval)-1); + display_tv = (struct timeval*)malloc(sizeof(struct timeval)-1); + current_time(); +} + + +// dtor +TimeBox::~TimeBox() +{ + free(current_tv); + free(display_tv); +} + + +// Reset the clock to current system time + +void TimeBox::current_time() +{ + struct tm* display_time_tm; + + gettimeofday(current_tv, 0); + display_tv->tv_sec = current_tv->tv_sec; + display_tv->tv_usec = current_tv->tv_usec; + display_time_tm = localtime(¤t_tv->tv_sec); + + if(type() == TIMEBOX_24HOUR) strftime(time_string, 19, "%2H:%2M", display_time_tm); + else strftime(time_string, 19, "%2I:%2M %p", display_time_tm); + + input_time->value(time_string); + + // Start the clock and display current time + clock->value(display_tv->tv_sec); + add_timeout(1.0f); +} + + +// Update the clock each second + +int TimeBox::handle(int event) +{ + switch(event) { + case fltk::TIMEOUT: + { + struct timeval t; gettimeofday(&t, 0); + clock->value(t.tv_sec); + float delay = 1.0f-float(t.tv_usec)*.000001f; + if (delay < .1f || delay > .9f) delay = 1.0f; + add_timeout(delay); + } + break; + } + return clock->handle(event); // right? +} + + +// This apparently has the side effect of moving the clock relatively to +// the current time, e.g +// system time TimeBox +// before 1:00 1:02 +// after 1:03 1:05 +// etc. + +void TimeBox::refresh() +{ + long different; + + if (valid()) + { + different = - display_tv->tv_sec + current_tv->tv_sec; + gettimeofday(current_tv, 0); + + display_tv->tv_sec = current_tv->tv_sec - different; + redisplay(); + } +} + + +// Update the text input field + +void TimeBox::redisplay() +{ + struct tm *display_time_tm; + + display_time_tm = localtime(&display_tv->tv_sec); + + if(type() == TIMEBOX_24HOUR) strftime(time_string, 19, "%2H:%2M", display_time_tm); + else strftime(time_string, 19, "%2I:%2M %p", display_time_tm); + + input_time->value(time_string); +} + + +// Stop the clock and update it (move hands) + +void TimeBox::move_hands() +{ + struct tm *display_time_tm; + + display_time_tm = localtime(&display_tv->tv_sec); + + remove_timeout(); + clock->value(display_tv->tv_sec); +} + + +int TimeBox::hour() +{ + struct tm *display_time_tm; + + display_time_tm = localtime(&display_tv->tv_sec); + return display_time_tm->tm_hour; +} + + +int TimeBox::minute() +{ + struct tm *display_time_tm; + + display_time_tm = localtime(&display_tv->tv_sec); + return display_time_tm->tm_min; +} + + +void TimeBox::hour(int value) +{ + struct tm *display_time_tm; + + display_time_tm = localtime(&display_tv->tv_sec); + display_time_tm->tm_hour = value; + display_tv->tv_sec = mktime(display_time_tm); +} + + +void TimeBox::minute(int value) +{ + struct tm *display_time_tm; + + display_time_tm = localtime(&display_tv->tv_sec); + if(value < 0) + { + display_time_tm->tm_min = 59; + display_time_tm->tm_hour--; + } + else if(value >= 0 && value <= 59) + { + display_time_tm->tm_min = value; + } + else if (value > 59) + { + display_time_tm->tm_min = 0; + display_time_tm->tm_hour++; + } + display_time_tm->tm_sec = 0; + display_tv->tv_sec = mktime(display_time_tm); +} + + +void TimeBox::settime() +{ + struct tm *display_time_tm; + display_time_tm = localtime(&display_tv->tv_sec); + // return display_time_tm->tm_min; + time_t ct = mktime (display_time_tm); + if (stime(&ct)!=0) + fltk::alert(_("Error setting time. You are probably not superuser!")); +} + + +void TimeBox::value(int h, int m) +{ + hour(h); + minute(m); +} + + +bool TimeBox::valid() +{ + int h, m; + char a[5]; + + if(type() == TIMEBOX_12HOUR) + { + if (sscanf(input_time->value(), "%d:%d %s",&h, &m, a) == 3) + { + if (h >= 1 && h <= 12 && m >= 0 && m <= 59 && (strcasecmp(a, "am") == 0 || strcasecmp(a, "pm") == 0)) + { + last_valid = true; + return true; + } + } + } + else + { + if (sscanf(input_time->value(), "%d:%d",&h, &m) == 2) + { + if (h >= 0 && h <= 23 && m >= 0 && m <= 59) + { + last_valid = true; + return true; + } + } + } + last_valid = false; + return false; +} + + +void TimeBox::input_changed_cb(fltk::Widget* widget, void* data) +{ + TimeBox* t = (TimeBox*) data; + int h, m; + char a[5]; + + if (t->valid()) + { + if(t->type() == TIMEBOX_12HOUR) + { + sscanf(t->input_time->value(), "%d:%d %2s",&h, &m, a); + if(strcasecmp(a, "am") == 0) + { + if(h < 12) + { + t->hour(h); + } + else + { + t->hour(0); + } + } + else + { + if(h < 12) + { + t->hour(h + 12); + } + else + { + t->hour(12); + } + } + } + else + { + sscanf(t->input_time->value(), "%d:%d",&h, &m); + t->hour(h); + } + t->minute(m); + t->move_hands(); + } + t->do_callback(); +} + + +void TimeBox::button_cb(fltk::Widget* widget, void* data) +{ + TimeBox* t = (TimeBox*) data; + + if(widget == t->button_decrease_hour) + { + t->hour(t->hour()-1); + } + if (widget == t->button_decrease_minute) + { + t->minute(t->minute()-1); + } + if (widget == t->button_increase_minute) + { + t->minute(t->minute()+1); + } + if (widget == t->button_increase_hour) + { + t->hour(t->hour()+1); + } + t->redisplay(); + t->move_hands(); + t->do_callback(); +} + + +void TimeBox::textsize(int size) +{ + input_time->textsize(size); +} + + +void TimeBox::labelsize(int size) +{ + button_decrease_hour->labelsize(size); + button_decrease_minute->labelsize(size); + button_increase_minute->labelsize(size); + button_increase_hour->labelsize(size); + fltk::Group::labelsize(size); +} + + +void TimeBox::textfont(fltk::Font* font) +{ + input_time->textfont(font); +} + + +void TimeBox::labelfont(fltk::Font* font) +{ + button_decrease_hour->labelfont(font); + button_decrease_minute->labelfont(font); + button_increase_minute->labelfont(font); + button_increase_hour->labelfont(font); + fltk::Group::labelfont(font); +} + + +void TimeBox::textcolor(fltk::Color color) +{ + input_time->textcolor(color); +} + + +void TimeBox::labelcolor(fltk::Color color) +{ + button_decrease_hour->labelcolor(color); + button_decrease_minute->labelcolor(color); + button_increase_minute->labelcolor(color); + button_increase_hour->labelcolor(color); + fltk::Group::labelcolor(color); +} + + +int TimeBox::textsize() +{ + return (int)input_time->textsize(); +} + + +int TimeBox::labelsize() +{ + return (int)button_decrease_hour->labelsize(); +} + + +fltk::Font* TimeBox::labelfont() +{ + return button_decrease_hour->labelfont(); +} + + +fltk::Font* TimeBox::textfont() +{ + return input_time->textfont(); +} + + +fltk::Color TimeBox::labelcolor() +{ + return button_decrease_hour->labelcolor(); +} + + +fltk::Color TimeBox::textcolor() +{ + return input_time->textcolor(); +} diff --git a/etimedate/TimeBox.h b/etimedate/TimeBox.h new file mode 100644 index 0000000..3d5e6f6 --- /dev/null +++ b/etimedate/TimeBox.h @@ -0,0 +1,212 @@ +// TimeBox.h +// Class that displays a clock with ability to set time +// Part of Equinox Desktop Environment (EDE) +// +// Based on Fl_Time.h +// Copyright (C) 2000 Softfield Research Ltd. +// +// Changes 02/09/2001 by Martin Pekar +// Ported to FLTK2 and redesigned by Vedran Ljubovic , 2005. +// +// This program is licenced under terms of the +// GNU General Public Licence version 2 or newer. +// See COPYING for details. + + +#ifndef __TIME_WIDGET_H +#define __TIME_WIDGET_H + +#include "sys/time.h" + +#include +#include +#include +#include + +#include "../edelib2/NLS.h" + +#define TIMEBOX_24HOUR 0 +#define TIMEBOX_12HOUR 1 + +class TimeBox : public fltk::Group { + +public: + TimeBox(int x, int y, int w, int h, char *l=0); + ~TimeBox(); + + /** + * Gets the hour. + * + * @return The hour associated with this widget. + */ + int hour(); + + /** + * Sets the hour. + * + * @param hour The hour associated with this widget. + */ + void hour(int value); + + /** + * Gets the minute. + * + * @return The minute associated with this widget. + */ + int minute(); + + /** + * Sets the minute. + * + * @param minute The minute associated with this widget. + */ + void minute(int value); + + // Be sure to run this after using hour and min to change the clock value. + void redisplay(); + void move_hands(); + + /** + * Sets the minute and hour at the same time. + * + * @param minute The minute associated with this widget. + * @param hour The hour associated with this widget. + */ + void value(int h, int m); + + /** + * Sets the minute and hour to the system minute and hour. + */ + void current_time(); + + /** + * Refreshes the widget. + */ + void refresh(); + + /** + * Sets the size of the label text which is used for the M+, + * M-, Y+, and Y- labels. + * + * @param size The size of the label font. + */ + void labelsize(int size); + + /** + * Sets the label font which is used for the M+, + * M-, Y+, and Y- labels. + * + * @param font The label font. + */ + void labelfont(fltk::Font* font); + + /** + * Sets the label color which is used for the M+, + * M-, Y+, and Y- labels. + * + * @param font The label color. + */ + void labelcolor(fltk::Color color); + + /** + * Sets the size of the text which is used to display + * the set time. + * + * @param size The size of the text font. + */ + void textsize(int size); + + /** + * Sets the font of the text which is used to display + * the set time. + * + * @param font The font of the text font. + */ + void textfont(fltk::Font*); + + /** + * Sets the color of the text which is used to display + * the set time. + * + * @param color The color of the text font. + */ + void textcolor(fltk::Color); + + /** + * Gets the size of the label text which is used for the M+, + * M-, Y+, and Y- labels. + * + * @return The size of the label font. + */ + int labelsize(); + + /** + * Gets the label font which is used for the M+, + * M-, Y+, and Y- labels. + * + * @return The label font. + */ + fltk::Font* labelfont(); + + /** + * Gets the label color which is used for the M+, + * M-, Y+, and Y- labels. + * + * @return The label color. + */ + fltk::Color labelcolor(); + + /** + * Gets the size of the text which is used to display + * the set time. + * + * @return The size of the text font. + */ + int textsize(); + + /** + * Gets the font of the text which is used to display + * the set time. + * + * @return The font of the text font. + */ + fltk::Font* textfont(); + + /** + * Gets the color of the text which is used to display + * the set time. + * + * @return The color of the text font. + */ + fltk::Color textcolor(); + + /** + * Determines if the entered time is a recognized format. + * + * @return True if it is a valid time format, otherwise false. + */ + bool valid(); + + int handle(int); + void settime(); //just for superuser + +private: + fltk::ClockOutput *clock; + fltk::Button *button_decrease_hour; + fltk::Button *button_decrease_minute; + fltk::Input *input_time; + fltk::Button *button_increase_minute; + fltk::Button *button_increase_hour; + + struct timeval *current_tv; + struct timeval *display_tv; + char time_string[20]; + bool last_valid; + + int look_; + + static void input_changed_cb(fltk::Widget* widget, void* data); + static void button_cb(fltk::Widget* widget, void* data); +}; + +#endif diff --git a/etimedate/etimedate.cpp b/etimedate/etimedate.cpp new file mode 100644 index 0000000..0769f30 --- /dev/null +++ b/etimedate/etimedate.cpp @@ -0,0 +1,339 @@ +/* + * $Id$ + * + * Application for setting system date, time and local timezone + * Part of Equinox Desktop Environment (EDE). + * Copyright (c) 2000-2006 EDE Authors. + * + * This program is licenced under terms of the + * GNU General Public Licence version 2 or newer. + * See COPYING for details. + */ + +#include "etimedate.h" +//#include +#include +#include +#include +#include +#include + +#include "../edelib2/NLS.h" +#include "../edelib2/Run.h" + +// graphics +#include "icons/world2.xpm" + +using namespace fltk; +using namespace edelib; + + + +static Window* timedateWindow; +TimeBox* timeBox; +EDE_Calendar* calendar; +InputBrowser* timeZonesList; + +Button* applyButton; +bool time_changed = false; +bool date_changed = false; +bool tz_changed = false; + +int phour, pminute; + +// Constants + + + +// -------------------------------------------- +// timezone functions + +// From efltk/filename.h +#define FL_PATH_MAX 1024 +// end filename.h + + +// wait - whether to wait for process to finish + +// end Util.cpp +#include +#include +#include +#include +#include + +void getCurrentTimeZone() +{ + char szZone[100],tempstring[101]; + FILE *f; + + if(readlink("/etc/localtime", szZone, sizeof(szZone)-1)>0) { + char *tz = strstr(szZone, "/zoneinfo/") + strlen("/zoneinfo/"); +// timeZonesList->value(tz); + timeZonesList->text(tz); + } else { + // some distros just copy the file instead of symlinking + // But /etc/sysconfig/clock should contain ZONE=Continent/City + if((f = fopen("/etc/sysconfig/clock", "r")) != NULL) { + while (fgets(tempstring,100,f) != NULL) { + // last char is newline, let's strip that: + if (tempstring[strlen(tempstring)-1] == '\n') + tempstring[strlen(tempstring)-1] = '\0'; + if (strstr(tempstring,"ZONE=") == tempstring) { +// timeZonesList->value(tempstring+5); + timeZonesList->text(tempstring+5); + } + } + } else { +// timeZonesList->value(_("Zone information not found.")); + timeZonesList->text(_("Zone information not found.")); + } + } +} + +static char *zonetab_dir = 0; +void saveTimeZone() +{ +} + +/*int sort_f(const void *w1, const void *w2) { + Widget *widget1 = *(Widget**)w1; + Widget *widget2 = *(Widget**)w2; + return strcmp(widget1->label(), widget2->label()); +}*/ + +// wstrim() - for trimming characters (used in parser) +// parts of former fl_trimleft and fl_trimright from Fl_Util.cpp +#include +char* wstrim2(char *string) +{ + char *start; + + if(string == NULL ) + return NULL; + + if (*string) { + int len = strlen(string); + if (len) { + char *p = string + len; + do { + p--; + if ( !isspace(*p) ) break; + } while ( p != string ); + + if ( !isspace(*p) ) p++; + *p = 0; + } + } + + for(start = string; *start && isspace (*start); start++); + memmove(string, start, strlen(start) + 1); + + return string; +} + + +void fillTimeZones() +{ + // This funtion is very lame :) + + FILE *f; + char tempstring[101] = "Unknown"; + + struct stat s; + if(stat("/usr/share/zoneinfo/zone.tab",&s)==0) { + run_program("cat /usr/share/zoneinfo/zone.tab | grep -e ^[^#] | cut -f 3 |sort > /tmp/_tzone_.txt"); + zonetab_dir = "/usr/share/zoneinfo/"; + } + else if(stat("/usr/local/share/zoneinfo/zone.tab",&s)==0) { + run_program("cat /usr/local/share/zoneinfo/zone.tab | grep -e ^[^#] | cut -f 3 | sort > /tmp/_tzone_.txt"); + zonetab_dir = "/usr/local/share/zoneinfo/"; + } else { + Item *o = new Item(_("Zone information not found.")); + o->textcolor(RED); + return; + } + + if((f = fopen("/tmp/_tzone_.txt", "r")) != NULL) + { + while(fgets(tempstring, 100, f) != NULL) + { + Item *o = new Item(); + o->copy_label(wstrim2(tempstring)); + } + fclose(f); + } else { + Item *o = new Item(_("Zone information not found.")); + o->textcolor(RED); + return; + } + remove("/tmp/_tzone_.txt"); +// TODO: Group::current()->array().sort(sort_f); +} + + +// -------------------------------------------- +// Callback functions + +void applyAll() { + char cmd1[FL_PATH_MAX]; + char cmd2[FL_PATH_MAX]; + cmd1[0]='\0'; cmd2[0]='\0'; + + if (tz_changed) { + if(!zonetab_dir) { + alert(_("Zone information not found.")); + return; + } + + char tz[FL_PATH_MAX]; +// snprintf(tz, sizeof(tz)-1, "%s%s", zonetab_dir, timeZonesList->value()); + snprintf(tz, sizeof(tz)-1, "%s%s", zonetab_dir, timeZonesList->text()); + + snprintf(cmd1, sizeof(cmd1)-1, "rm /etc/localtime; ln -s %s /etc/localtime; ", tz); + + char val[FL_PATH_MAX]; + snprintf(val, sizeof(val)-1, "TZ=%s", tz); + putenv(val); + + tz_changed=false; + } + if (time_changed || date_changed) { + Fl_Date_Time date = calendar->date(); + int mmonth = date.month(); + int mday = date.day(); + int myear = date.year(); + int mhour = timeBox->hour(); + int mminute = timeBox->minute(); + + snprintf(cmd2, sizeof(cmd2)-1, "date %.2d%.2d%.2d%.2d%.2d", mmonth, mday, mhour, mminute, myear); + + time_changed=false; + date_changed = false; + } + char *cmd = (char*)malloc(FL_PATH_MAX*2); + + // Now run everything as root + strcpy(cmd,cmd1); + strcat(cmd,cmd2); + run_program(cmd, true, true, false); +} + +static void cb_OK(Button*, void*) { + applyAll(); + exit(0); +} + +static void cb_Apply(Button*, void*) { + const char *pwd = password(_("This program requires administrator privileges.\nPlease enter your password below:"),0,"somebody"); +printf ("Pwd: %s\n",pwd); +exit(0); + applyAll(); + applyButton->deactivate(); +} + +static void cb_Close(Button*, void*) { + if (date_changed || time_changed) { + int answer = choice_alert(_("You have unsaved changes in this window!\nDo you want to close it anyway?"), 0, _("Go &Back"), _("&Discard Changes")); + if (answer != 2) return; + } + exit(0); +} + +static void cb_tzChanged(Widget*, void*) { + if (tz_changed) return; + tz_changed=true; + applyButton->activate(); +} + +static void cb_dateChanged(Widget*, void*) { + if (date_changed) return; + date_changed=true; + applyButton->activate(); +} + +static void cb_timeChanged(TimeBox* w, void*) { + if (time_changed) return; + time_changed=true; + applyButton->activate(); +} + +// -------------------------------------------- +// Main window design + +int main (int argc, char **argv) { + Window* w; + //fl_init_locale_support("etimedate", PREFIX"/share/locale"); + {Window* o = timedateWindow = new Window(435, 300, _("Time and date")); + w = o; + o->begin(); + {TabGroup* o = new TabGroup(10, 10, 415, 245); + o->begin(); + {Group* o = new Group(0, 25, 415, 220, _("Time and date")); + o->begin(); + {Group* o = new Group(10, 10, 220, 200); + o->box(DOWN_BOX); + o->color((Color)7); + o->begin(); + {EDE_Calendar* o = calendar = new EDE_Calendar(10, 10, 200, 200); + //o->textfont(fonts+9); // TODO: what does this mean!? + o->color((Color)0xffffff00); + o->textcolor((Color)18); + o->labelsize(10); + o->textsize(14); + o->callback((Callback*)cb_dateChanged); + } + o->end(); + } + {TimeBox* o = timeBox = new TimeBox(240, 10, 165, 200); + timeBox->callback((Callback*)cb_timeChanged); + } + o->end(); + } + {Group* o = new Group(0, 25, 415, 220, _("Timezones")); + o->hide(); + o->begin(); + {Group* o = new Group(10, 10, 395, 170); + o->box(DOWN_BOX); + o->color((Color)0x7b00); + o->begin(); + {InvisibleBox* o = new InvisibleBox(0, 0, 395, 170); + xpmImage* i = new xpmImage((const char**)world2_xpm); +// i->draw(Rectangle(10,5,350,160)); +// i->over(Rectangle(0,0,i->w(),i->h()),*o); + o->image(i); + o->box(FLAT_BOX); + o->color((Color)0x8000); + } + o->end(); + } + {InputBrowser* o = timeZonesList = new InputBrowser(10, 185, 395, 25); o->begin(); + o->type(1); fillTimeZones(); + getCurrentTimeZone(); + o->end(); + o->callback((Callback*)cb_tzChanged); + } + o->end(); + } + o->end(); + } + {Group* o = new Group(0, 265, 415, 33); + o->begin(); +// {Button* o = new Button(154, 0, 90, 25, _("&OK")); +// o->callback((Callback*)cb_OK); +// } + {Button* o = applyButton = new Button(235, 0, 90, 25, _("&Apply")); + o->callback((Callback*)cb_Apply); +// o->tooltip(_("Set system time. ->Just root user!<-")); + o->deactivate(); + } + {Button* o = new Button(335, 0, 90, 25, _("&Close")); + o->callback((Callback*)cb_Close); + } + o->end(); + } + o->end(); + } + w->show(argc, argv); + return run(); +} diff --git a/etimedate/etimedate.fld b/etimedate/etimedate.fld new file mode 100644 index 0000000..7d9a21a --- /dev/null +++ b/etimedate/etimedate.fld @@ -0,0 +1,86 @@ +# data file for the FLTK User Interface Designer (FLUID) +version 2,0003 +images_dir ./ +i18n +header_name {.h} +code_name {.cpp} +gridx 5 +gridy 5 +snap 3 +decl {// Time and date for EDE is (C) Copyright 2001-2002 by Martin Pekar, this program is provided under the terms of GNU GPL v.2, see file COPYING for more information.} {} + +decl {\#include } {} + +Function {} {open +} { + code {fl_init_locale_support("etimedate", PREFIX"/share/locale");} {} + Fl_Window timedateWindow { + label {Time and date} open + private xywh {21 381 413 279} visible + } { + Fl_Group {} {open + xywh {0 245 413 33} + } { + Fl_Button {} { + label {&OK} + callback {saveTimeZone(); +timeBox->settime(); +exit(0);} + private xywh {154 4 80 25} + } + Fl_Button {} { + label {&Apply} + callback {saveTimeZone(); +timeBox->settime();} + tooltip {Set system time. ->Just root user!<-} + xywh {241 4 80 25} + } + Fl_Button {} { + label {&Cancel} + callback {exit(0);} + private xywh {328 4 80 25} + } + } + Fl_Tabs {} {open + xywh {3 5 405 240} + } { + Fl_Group {} { + label {Time/date} open + xywh {0 20 405 220} + } { + Fl_Group {} {open + xywh {5 5 220 200} box DOWN_BOX color 7 + } { + Fl_Calendar {} {selected + xywh {10 5 200 190} text_font 9 color 0xffffff00 text_color 18 label_size 10 text_size 14 + } + } + Fl_Clock {} { + private xywh {235 5 165 165} + } + Fl_Input timeBox { + xywh {235 180 165 25} + extra_code {\#include "fl_time.h"} + class Fl_Time + } + } + Fl_Group {} { + label Timezones open + xywh {0 20 405 220} hide + } { + Fl_Group {} {open + xywh {10 5 385 170} box DOWN_BOX color 0x7b00 + } { + Fl_Box {} { + xywh {10 5 350 160} box FLAT_BOX image {icons/world.xpm} color 0x8000 + } + } + Fl_Input_Browser timeZonesList {open + xywh {12 185 383 25} + extra_code {o->type(1); fillTimeZones(); +getCurrentTimeZone();} + } {} + } + } + } +} diff --git a/etimedate/etimedate.h b/etimedate/etimedate.h new file mode 100644 index 0000000..c491c9b --- /dev/null +++ b/etimedate/etimedate.h @@ -0,0 +1,29 @@ +/* + * $Id$ + * + * Application for setting system date, time and local timezone + * Part of Equinox Desktop Environment (EDE). + * Copyright (c) 2000-2006 EDE Authors. + * + * This program is licenced under terms of the + * GNU General Public Licence version 2 or newer. + * See COPYING for details. + */ + + +#ifndef etimedate_h +#define etimedate_h + +#include "../edelib2/NLS.h" +#include +#include +#include +#include +#include +#include + +#include "EDE_Calendar.h" +//#include +#include "TimeBox.h" + +#endif diff --git a/etimedate/icons/world.xpm b/etimedate/icons/world.xpm new file mode 100644 index 0000000..a10a317 --- /dev/null +++ b/etimedate/icons/world.xpm @@ -0,0 +1,190 @@ +/* XPM */ +const char *world[] = { +"356 184 3 1", +". c #000078", +"# c #007800", +"a c #0000f8", +"....................................................................................................................................................................................................................................................................................................................................................................", +"....................................................................................................................................................................................................................................................................................................................................................................", +"....................................................................................................................................................................................................................................................................................................................................................................", +"....................................................................................................................................................................................................................................................................................................................................................................", +"...................................................................................................................................................................................................................................................................................................................................................############.....", +"................................................................................................................................................................................................................................................................................................................................................################....", +".........................................................................................................................................................................................................................................................................................................###############....................#######################.", +".......................................................................................................................................................................................................................................................................................................##################...............############################", +"..................................................................................................................................................................................................................................................................................................########################.......###################################", +"...####.....................................................................##...................................................................................................................................................................................................................########################...####################################.###", +".#######...................................................................###....##.............................#.............................................................................................................................................................................#########################..#########################################.", +"########.........................................................#####....###..#.###............................####........................................................................................................................................................................##..####.##################..###########################################", +"######................................###.###...................######...#..#.###.............................####.....................................................................................................................................................................#...####..####......##########..#############################################", +"#####..........................#....#.#########...................###..##..##..#..............................###..##.................................................................................................................................................................###..######.....##############...#############################################", +"####..........................########...####................................................................##..#####...........................................................................................................................................................####..##...#######..############.....##############################################", +"##.............................########...........................................................................####...##.....................................................................................................................................................######.......######..##########.....################################################", +"##.............................##.######..........................................................................###..#####...............................................................................................................................................##....######.##....#####..##########...##################################################", +"##................................#####.##.............................................................................####.............................................................................................................................................#####.....##########.#####.#.##########..###################################################", +"##...............................######.###...............................................................................#............................................................................................................................................######....#.###..#####.###..#.#########...###################################################", +"###................................###...##..........................................##................................#####......................................................................................................................................####....##......#........#......##.#######........################################################", +"###.................................#...............................................####...............................#######..................................................................................................................................#####..................#...##..#.###.#######.......#################################################", +"#...............................................................................##.#####.......................##.#..#############..............................................................................................................................#####...##..####.########.#######.###..####..........######.########################################", +"#.............................................................................######........................#########################......................#####...............................................................................................####....##########.#######....####...#.##..............##.....#######################################", +"##...........................................................................######.......................###########################.....................#######...###...............................................................................................###########..######.##.#######.#####.....................#####################################", +"#..........................................................................#####.........................##########################........................#####....###.................................................................................................######......###...###.######.####.......................####################################", +"##.........................................................................####..........................########################...........................##.................................................................................................#######.................#...........##............................###################################", +"#.........................................................................####.....................###.######################.#..##............................#..............................................................................................#########.........#...######..####.......##.###....................###################################", +".........................................................................####............#.........##########################...#########....###..............###.............................................................................................########.........###..#####..#####..##..########...................###################################", +"........................................................................####.............##..###...##########################.#############.#######.............#.............................................................................................######..############..######..###..##############..................##################################.", +"........................................................................###.............####.#####..#################################################.........###..#.........................................................................................######.##############..######......####..##########.................##################################.", +"........................................................................####...........############..################################################........##########.............................#..........................................................###################....###..##....###...###########................#################################.", +"............................................##.##.......................####..........#####.###############################################################.##############.........................####.......................###.##.............................###################......####...###.#.#############.................##############################.", +"........................................##########.........................##.##.....#######.####################################################################################...................##.....................############..............................################.....#####..###.##.##############.............###############################..", +".....................................#############............................####...#######.######################################################################################.........#.............................##################...........##.##..........################..#######....##...###############............##############################...", +"...................................###################.#.......................#####..######..######################################################################################.#####.########...................###########################..################...##########.####..###.#####.....#.......##########............##############################...", +"...................................######################..............###..##.#####...#####..#######################################################################################################................##################################################.######..#.###..####.######...####.....########.................#########################....", +".................................##########################.....##...##################.####..############################################################################################################...........###################################################.##....###.#######.########..####....############...........########################.##.....", +"..................................###########################..###..########################.##############################################################################################################..........###################################################################################....####.#########.........######################.#.........", +".................................############################..###.##########################################################################################################################################...........#################################################################################...###.##########.#.......#####################............", +"...###...........................####################...####...##################################################################################################################################################....############################################.#.###################################........##############.......###################...........#.", +"#######.........................######################......######################################################################################################################################################..#############################################..##################################..........#######..####........##################...........###", +"########.......................##########..############.....######################################################################################################################################################..####################################################################################....############.#...........#############..#............###", +"#######........................##########...###########..############################################################################################################################################...#####.##.....####################################################################################..##############.............###########.................##", +"######.......................############...############..#########################################################################################################################################...................####################################################################################..##..#########.............###########..................#", +".##........................############...##########################################################################################################################################################..................##########################################################################....#...##........#####.#..............#########....................", +".............#............############...############################################################################################################################################################.................##########################################################################......##..#..........###................#######.....................", +"............##...........#############..###########################################################################################################################################################..................#####################################################.###################.......###..#.######....#.................#######.....................", +".........................############...##########.#################################################################################################################################..#########.......................#######################################################################...............#######......................######.....................", +".........................#############..######..##..###########################################################################################################################..##a#########.........................#######################################################################...............#########....#.................####.....................", +".........................##############..####..##############################################################################################################################.....#####..##............................################...##################################################................#########....#...................#......................", +".................#........############....#...#########################################################################################################################.#####....#####....................................########.##...........############################..##############...............###########.####.........................................", +".............#...#........##...#######......#######################################################################################################################.##...###....#####.....................................########...............#############################################.............#################........................................", +".............#.##...........##.######....#.#######################################################################################################################.............#####.........................................####.#...............############################################..............################........................................", +"..............###..........###.######...#######################################################################################################################.#.............#######.......................................####..#...............#################################################..........################.......................................", +"..............###..........####.####....#####################################################################################################################.................#######....................................#####...##.................#################################################....##.#################.......................................", +"...............###..........##..........####################################################################################################################.................#######....................................######........................##############################################.......##################.......................................", +"............###.###.........###.##..######################################################################################################################...................######....##..............................###.#...........................#################################################...#####################....................................", +"...........####..###........#############################################################################################################################....................######......#...........................#.##.............................#.################################################..#######################...................................", +"..........####..#####.....#################################################################################################################################..#..#............#####..................................##................................##################################################...#######################..................................", +"..........####..#####...#########################################################################################################################################.............###...............#.....................................................###################################################..#######################..................................", +"..........####.######..#########################################################################################################################################..............##.......................................................................#..################################################.########################.................................", +"...........##..######..##########################################################################################################################################.............#.............................................................................#############################################.#######################...................................", +".....................#############################################################################################################################################............#............................................................................####################################################################.....................................", +"..................################################################################################################################################################..........................................................................................###########################################################.....##...##.................................", +"...............##################################################################################################################################################..........#................................................................................###.##################################.##################.####.#....##..................................", +"................################################################################################################################################################..........##..................................................................................###################################...################.#####.....####.................................", +".................###############################################################################################################################################.......####...................................................................................####################################...###################......#####.................................", +"..................##########################################################################################################################################..........####....................................................................................#####################################...###############.#.......######................................", +"...................################################.#######################################################################################################..........####......................................................................................#####################################...#.############........#######................................", +"...................##############.################...##...#################################################################################################....##...###........................................................................................####################################.###..############............#.#................................", +".............####.##########..####.##############..........#############..#######.########################################################################.....###.............................................................................................####################################.###.###...######................................................", +"............#############.#....####.############............###########..#######..#######################################################################......####............................................................................................####################################.################................................................", +"............###########......#..####..#########.....###......##########.########..######################################################################......####.............................................................................................####################################.#####.##########................................................", +"............###########.....##...####..#########..#####################.#############################################################################.........###.............................................................................................######################################################................................................", +"............#########.......##.....###.########.#######################..###########################################################################..........#...............................................................................................###################################################...................................................", +"............#########.##.....#.....##...###############################..#########################################################################...........###...............................................................................................#################################################....................................................", +".............#######.............#.##....####.##########################..###############################################################...#..####..........###...............................................................................................################################################.............................................##......", +"..............#####.............##.......###..#########################...##############################################################.......####.........###.................................................................................................###############################################..............................................###....", +"...............###...#####.####.###......##.#..########################....#################################################################....####.......####.................................................................................................##############################################................................................##....", +"...................############............###..##...#.#####################################################################################....####....#######..................................................................................................##############################################.....................................................", +"...............#################............##....#.##.###################################################################################.......##..#########...................................................................................................##############################################.....................................................", +".............##################.............##...####..####################################################################################.....###..#######......................................................................................................###########################################.......................................................", +"............###################.........##........##..#####################################################################################.........#..####.........................................................................................................########################################........................................................", +"...........########################.....###..#........######################################################################################.......#######...........................................................................................................#####################################..........................................................", +"...........##########################..########.############################################################################################.......###.......##.......................................................................................................####################################..........................................................", +"...........#################################################################################################################################........#.........##......................................................................................................###.###############################...........................................................", +"...........###########################################.#####################################################################################..................#........................................................................................................######################.###...######..........................................................", +"..........############################################.#####################################################################################...................#........................................##..............................................................##.#################...#.......###..........................................................", +".........#############################################.##############.######################################################################.......#...........#.........................................###............................................................###.###############............###..#.......................................................", +".......###############################################..##############.###...##############################################################......#.............##........................................###..............................................................##.#############..............###.##......................................................", +"......#################################################.###############....#..############################################################......###.............##........................................................................................................###.############..............##...##.....................................................", +"......#################################################..##############...##...#.###########################..############################.##....#.............###...............................................####......................................................##.############..............##...###....................................................", +".....##################################################...#############..####.........#####################....##########################.###...................#..................................................###......................................................##.##########....................###....................................................", +".....###################################################..####################.........####################....#########################..##........................................................................####........................................................#########..............####....#....................................................", +"....#####################################################..####################.........###################....#######################....#............................................................................##.###.#...................................................########............######........................................................", +"....######################################################.###################..........###################...#################.###.......#.............................................................................####..###.................................................########.......###...########.....................................................", +"....#######################################################.##################...........#.##############.....################.##..............................................................................................##.................................................#########.....####........##...###................................................", +".....######################################################.#################..............#############.......###################..............................................................................................##.................................................#########...####..............####...............................................", +".....#######################################################.###############...............#############........#############..##.........#..........................................................................................................................................##############........####.######.##...........................................", +".....######################################################...##############...............###########...........############............###.......................#...................................................................................................................############..........#.........#..##........................................", +".....#######################################################..###########...................#########............#############...........###.......................#.....................................................................................................................########...##....................#.#.....................................#.", +".....########################################################.########......................#######..............#..###########...........##..............................................................................................................................................#.###########.....................##...................................##.", +".....########################################################..####..........................######............##...###########............##................................................................................................................................................##########......................#....................................#.", +".....##########################################################.##...........................#######..........###...############............#......................#...........................................................................................................................########......................#......................................", +".....###########################################################.............................#######...........##...###..#######...........#.#.....................#...............................................................................................................................###............###........#......................................", +"......#############################################################.####......................######..........##....###..######..........#..#.##....................................................................................................................................................###.........#######......#......................................", +"......#################################################################.......................####.............#...####...###...........##.#.#...........#..........................................................................................................................................###....#..###############.......................................", +".......################################################################........................##..#................###....##...........#...............##............................................................................................................................................#########################.....................................", +".......###############################################################............................###...............###................#....####.......###............................................................................................................................................#####.###################.....................................", +"........##############################################################............................####...............###.....................####......##........................#..........................................................................................................................###################.....................................", +".........##############.#############################################.............................###.................##..............##......###......#........................###.........................................................................................................................####################....................................", +"............########.....###########################################...............................#.............###..###...........#####........................................##.........................................................................................................................##########################..............................", +"...........................########################################...............................................#####.##.........######........................................##.........................................................................................................................###########################.............................", +"............................#######################################................................................####..##.......######..........................................#.........................................................................................................................###########################.............................", +".............................####################################...................................................###..###.....########......................................................................................................................................................#...........############################.............................", +"..............................###################################....................................................###..##....##########..###............................................................##..................................................................................##..........############################.............................", +".............................##################################......................................................####.......#########.####.......##....................................................##.................................................................................###.........#############################.............................", +"............................##################################........................................................######....#######..####.......####...................................................##..................................................................................##........###################################........................", +".............................################################..........................................................######...#######..####...##...####.###..................................................................................................................................##........####################################.......................", +"..............................###############################.............##...........................................######....######.#####.....##..########............................................................................................................................................#####################################.....................", +"...............................#############################.............###............................................#####......####..###...##.###.##########........##...............................................................................................................................##########################################.................", +"................................###########################.............###...............................................###............###.......#....############...####..........................##........###.......................................................................................##########################################.................", +".................................##########################.............##.................................................####........................###.##########.####.##........................##........###........................................................................................############################################..............", +"................................###########################.................................................................######..................#..##...#########.......#.........................##......####.........................................................................................###########################################..............", +".................................##########################..................................................................########.#....###.##...##......#########........####......................#.......##..........................................................................................###########################################..............", +".................................###########################...................................................................######.#######..#..............###..###........####.........................................................................................................................##########################################...............", +".................................############################..##.....................................................................#..###.###....................###..........###........................................................................................................................#########################################...............", +"..................................###########################..##................................................................................................................###.........................................................................................................................#######################################................", +"..................................###########################.......#................................................................................###........#...............................................###..........................................................................................######################################.................", +".................................############################.......###.............................................................................######.....###.....................................##......####...........................................................................................#####################################.................", +".................................############################......####............................................................................#######.....###......................................#.......##............................................................................................#####################################.................", +"................................#############################....#####.........................................................................############....####.....................#......................................................................................................................####################################.................", +"................................#############################...######........................................................................###############..#####...................###......................................................................................................................##################################..................", +"................................############################....######........................................................................###############.######.....................#.........#.#............................................................................................................################################..................", +".................................##########################....#######......................................................................########################..............................###...............................................................................................................###############################.................", +".................................########################......######........#.............................................................#########################..............................####..............................................................................................................###############################.................", +"..................................######################........#####.....##.#...........................................................#############################............................................................................#.................................................................##############################..................", +"..................................#####################........######.....##...........................................................################################..............##..........................................................####...............................................................#############################...................", +"..................................######################.......#####..................................................................##################################..............##..........................................................####..............................................................#############################...................", +"...................................#####################.......#####.................................................................###################################..............###...........................................................#...............................................................###########################.....................", +"...................................#####################.......#####................................................................#####################################..............................................................................##...........................................................#########################.......................", +"...................................####################..........##.................................................................######################################............................................................................####.........................................................##########################.......................", +"...................................###################..............................................................................#######################################.............................................................................##.........................................................#######################..........................", +"...................................##################..............................................................................########################################........................................................................................................................................#######################..........................", +"...................................##################...............................................................................########################################.......................................................................................................................................#######################..........................", +"....................................#################...............................................................................########################################.......................................................................................................................................######################...........................", +"....................................################.................................................................................#######################################.......................................................................................................................................#####################............................", +"....................................###############...................................................................................#####################################........................................................................................................................................#####################............................", +".....................................##############...................................................................................#####################################........................................................................................................................................####################.............................", +"......................................#############...................................................................................############....####################.........................................................................................................................................##################...............................", +"......................................###########.....................................................................................############......###.##############.........................................................................................................................................##################...............................", +"......................................#########.......................................................................................#######............#..#############..........................................................................................................................................###############.#................................", +"........................................####.........................................................................................####..................##############.....................#....................................................................................................................##############...................................", +"......................................................................................................................................##..................###############.....................##..................................................................................................................###############...................................", +".............................................................................................................................................................###########......................###.................................................................................................................###############...................................", +"..............................................................................................................................................................##########.......................###...............................................................................................................###############....................................", +"...............................................................................................................................................................#..###.#.........................####.............................................................................................................##############.....................................", +"...................................................................................................................................................................##..........................#####.............................................................................................................############.......................................", +"...............................................................................................................................................................................................####..............................................................................................................###########........................................", +"...................................................................................................................................................................#............................##..............................................................................................................###########.........................................", +"..................................................................................................................................................................###........................###.#................................................................................................................########..........................................", +"...................................................................................................................................................................####......................###..................................................................................................................#######...........................................", +"....................................................................................................................................................................##.....................####...................................................................................................................#######...........................................", +"..........................................................................................................................................................................................#####..................................................................................................................########...........................................", +".........................................................................................................................................................................................#####..................................................................................................................########............................................", +"........................................................................................................................................................................................#####...................................................................................................................#######.............................................", +"........................................................................................................................................................................................####....................................................................................................................#########...........................................", +"........................................................................................................................................................................................###.....................................................................................................................#########...........................................", +"................................................................................................................................................................................................................................................................................................................#########...........................................", +".......................................................................................##.......................................................................................................................................................................................................................########............................................", +"........................................................................................#.......................................................................................................................................................................................................................#######.............................................", +"................................................................................................................................................................................................................................................................................................................######.......####...................................", +".................................................................................................................................................................................................................................................................................................................#####......#####...................................", +"..........................................................................................#......................................................................................................................................................................................................................######......#......................................", +".........................................................................................###......................................................................................................................................................................................................................######............................................", +"..........................................................................................##.......................................................................................................................................................................................................................######...........................................", +"...................................................................................................................................................................................................................................................................................................................#######..........................................", +".....................................................................................................................................................................................................................................................................................................................####...........................................", +"......................................................................................................................................................................................................................................................................................................................##............................................", +"....................................................................................................................................................................................................................................................................................................................................................................", +"....................................................................................................................................................................................................................................................................................................................................................................", +"....................................................................................................................................................................................................................................................................................................................................................................", +"....................................................................................................................................................................................................................................................................................................................................................................", +"...................................................................................................................................................................................................................................................................................................................................................................."}; diff --git a/etimedate/icons/world2.xpm b/etimedate/icons/world2.xpm new file mode 100644 index 0000000..d2e9353 --- /dev/null +++ b/etimedate/icons/world2.xpm @@ -0,0 +1,176 @@ +/* XPM */ +static char * world2_xpm[] = { +"395 170 3 1", +" c None", +". c #00017A", +"+ c #007900", +"...........................................................................................................................................................................................................................................................................................................................................................................................................", +"...........................................................................................................................................................................................................................................................................................................................................................................................................", +"...........................................................................................................................................................................................................................................................................................................................................................................................................", +"...........................................................................................................................................................................................................................................................................................................................................................................................................", +"........................................................................................................................................................................................................................................................................................................................................................................................+++++++++++++......", +".....................................................................................................................................................................................................................................................................................................................................................................................++++++++++++++++++....", +".......................................................................................................................................................................................................................................................................................................................................++++++++++++++++++++.................+++++++++++++++++++++++++++++++", +"..................................................................................................................................................................................................................................................................................................................................++++++++++++++++++++++++++........+++++++++++++++++++++++++++++++++++++++", +"...+++++............................................................................+++..........................................................................................................................................................................................................................................++++++++++++++++++++++++++....++++++++++++++++++++++++++++++++++++++++.+++", +".++++++++..........................................................................++++....++................................+................................................................................................................................................................................................++++++++++++++++++++++++++++..++++++++++++++++++++++++++++++++++++++++++++++.", +"+++++++++...............................................................++++++....+++...+.+++...............................+++++..........................................................................................................................................................................................++...++++.++++++++++++++++++++..++++++++++++++++++++++++++++++++++++++++++++++++", +"+++++++...................................+++..+++.....................+++++++...+..+..+++................................++++........................................................................................................................................................................................+...++++...++++.......+++++++++++..++++++++++++++++++++++++++++++++++++++++++++++++++", +"++++++............................++....+.++++++++++.....................++++..++..++...+.................................+++...++..................................................................................................................................................................................++++..+++++++.....++++++++++++++++...++++++++++++++++++++++++++++++++++++++++++++++++++", +"++++.............................+++++++++...+++++.......................................................................++..++++++............................................................................................................................................................................++++...++...++++++++..+++++++++++++......+++++++++++++++++++++++++++++++++++++++++++++++++++", +"++................................+++++++++...................................................................................+++++...++......................................................................................................................................................................++++++........+++++++..+++++++++++......+++++++++++++++++++++++++++++++++++++++++++++++++++++", +"++................................+++.++++++..................................................................................++++..++++++..............................................................................................................................................................++.....+++++++.++....++++++..+++++++++++....+++++++++++++++++++++++++++++++++++++++++++++++++++++++", +"++....................................+++++.+++.....................................................................................++++.............................................................................................................................................................+++++......+++++++++++.++++++.+.+++++++++++..+++++++++++++++++++++++++++++++++++++++++++++++++++++++++", +"++...................................++++++.++++.......................................................................................+............................................................................................................................................................++++++.....+.+++...+++++.++++..+.++++++++++...+++++++++++++++++++++++++++++++++++++++++++++++++++++++++", +"+++.....................................+....................................................+++++..................................++++++++................................................................................................................................................++++++....................+...++..++.+++.++++++++........++++++++++++++++++++++++++++++++++++++++++++++++++++++", +"+........................................................................................++.++++++.........................++.++..++++++++++++++............................................................................................................................................++++++...++..+++++.+++++++++.++++++++.+++..+++++...........+++++++.++++++++++++++++++++++++++++++++++++++++++++", +"+......................................................................................++++++...........................++++++++++++++++++++++++++++........................++++++.........................................................................................................++++.....+++++++++++.++++++++....+++++...+.++................++......+++++++++++++++++++++++++++++++++++++++++++", +"++...................................................................................+++++++..........................++++++++++++++++++++++++++++++.......................++++++++...+++..........................................................................................................++++++++++++..+++++++.++.++++++++.++++++.......................+++++++++++++++++++++++++++++++++++++++++", +"+..................................................................................++++++............................++++++++++++++++++++++++++++...........................++++++....+++............................................................................................................+++++++......++++...+++.+++++++.+++++.........................++++++++++++++++++++++++++++++++++++++++", +"++.................................................................................+++++.............................++++++++++++++++++++++++++..............................++............................................................................................................++++++++...................+............++...............................+++++++++++++++++++++++++++++++++++++++", +"+.................................................................................+++++.......................+++.+++++++++++++++++++++++++.+..++...............................++........................................................................................................++++++++++..........+...+++++++..+++++.......+++.+++......................+++++++++++++++++++++++++++++++++++++++", +".................................................................................++++..............+..........+++++++++++++++++++++++++++++...++++++++++....++++...............++++.......................................................................................................+++++++++..........+++..++++++..++++++..++..+++++++++.....................+++++++++++++++++++++++++++++++++++++++", +"................................................................................++++...............++..++++...+++++++++++++++++++++++++++++.++++++++++++++.++++++++...............+.......................................................................................................++++++...+++++++++++++..+++++++..+++...+++++++++++++++....................++++++++++++++++++++++++++++++++++++++.", +"................................................................................+++...............++++.++++++..++++++++++++++++++++++++++++++++++++++++++++++++++++++..........++++..+...................................................................................................++++++.++++++++++++++++..+++++++.......++++..+++++++++++...................++++++++++++++++++++++++++++++++++++++.", +"................................................................................++++.............+++++++++++++..+++++++++++++++++++++++++++++++++++++++++++++++++++++.........+++++++++++................................++................................................................+++++++++++++++++++++....++++..++.....+++...+++++++++++++.................+++++++++++++++++++++++++++++++++++++.", +".................................................++.++..........................++++...........++++++.++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++.++++++++++++++++...........................+++++.........................++++.++................................+++++++++++++++++++++.......++++....+++.+.+++++++++++++++...................+++++++++++++++++++++++++++++++++.", +".........................................++++++++++++++................................++++...++++++++.++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++..........+................................++++++++++++++++++++............++.+++...........+++++++++++++++++...+++++++.....++...+++++++++++++++++.............++++++++++++++++++++++++++++++++++...", +".......................................+++++++++++++++++++++.+..........................+++++..+++++++..++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++.+++++.+++++++++.....................++++++++++++++++++++++++++++++...+++++++++++++++++....+++++++++++.++++...+++.++++++.....+........+++++++++++.............++++++++++++++++++++++++++++++++++...", +".......................................++++++++++++++++++++++++................+++..+++.+++++....+++++..+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++.................++++++++++++++++++++++++++++++++++++++++++++++++++++++++.+++++++..+.+++...++++.+++++++...+++++.....+++++++++...................++++++++++++++++++++++++++++....", +".....................................++++++++++++++++++++++++++++......++....++++++++++++++++++++.++++..++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++............+++++++++++++++++++++++++++++++++++++++++++++++++++++++++.++.....+++.++++++++.+++++++++..+++++....+++++++++++++............+++++++++++++++++++++++++++.++......", +"......................................++++++++++++++++++++++++++++++..+++..+++++++++++++++++++++++++++.++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++...........++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++.....++++.++++++++++..........+++++++++++++++++++++++++.+..........", +".....................................+++++++++++++++++++++++++++++++..+++.+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++.............++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++...+++.+++++++++++..+.......++++++++++++++++++++++++.............", +"...++++..............................++++++++++++++++++++++...+++++...++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++....+++++++++++++++++++++++++++++++++++++++++++++++++.+.+++++++++++++++++++++++++++++++++++++++.........++++++++++++++++.......++++++++++++++++++++++............+.", +"++++++++............................++++++++++++++++++++++++.......++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++..++++++++++++++++++++++++++++++++++++++++++++++++++..++++++++++++++++++++++++++++++++++++++...........++++++++..+++++........++++++++++++++++++++.............+++", +"+++++++++.........................+++++++++++...+++++++++++++......++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++..+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++.....+++++++++++++.+.............++++++++++++++..+..............+++", +"++++++++..........................+++++++++++....++++++++++++..++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++...+++++..++.....++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++..+++++++++++++++...............++++++++++++...................++", +"+++++++.........................+++++++++++++....+++++++++++++..++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++.....................++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++..++..++++++++++...............++++++++++++....................+", +".++...........................+++++++++++++....++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++....................+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++....+...+++.........+++++.+................++++++++++......................", +".............+++............++++++++++++++..++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++....................+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++.+++++++++++++++++++++........+++...+.+++++++....+...................++++++++.......................", +"............................+++++++++++++...+++++++++++..+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++..++++++++++.........................+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++.................++++++++........................+++++++.......................", +"............................++++++++++++++..+++++++..++...++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++..+++.++++++++++...........................+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++.................++++++++++....+...................+++++.......................", +"............................+++++++++++++++..+++++..++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++.....++++++..++................................+++++++++++++++++....+++++++++++++++++++++++++++++++++++++++++++++++++++++++..................++++++++++....+.....................++........................", +"...................+.........+++++++++++++.....+...++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++.++++++....++++++........................................+++++++++.++............+++++++++++++++++++++++++++++++...+++++++++++++++.................++++++++++++.+++++.............................................", +"..............++...+.........++...++++++++.......++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++.++....+++....++++++.........................................+++++++++................++++++++++++++++++++++++++++++++++++++++++++++++++...............+++++++++++++++++++............................................", +"..............++.++............++.+++++++....++.++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++..............++++++.............................................+++++.+.................++++++++++++++++++++++++++++++++++++++++++++++++................++++++++++++++++++............................................", +"................+++...........+++.+++++++...++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++..+..............++++++++...........................................+++++..+.................++++++++++++++++++++++++++++++++++++++++++++++++++++++...........++++++++++++++++++...........................................", +"................+++...........++++..++++....++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++...................++++++++........................................+++++....++...................++++++++++++++++++++++++++++++++++++++++++++++++++++++.....++.+++++++++++++++++++...........................................", +".................+++...........++...........+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++...................++++++++........................................++++++...........................+++++++++++++++++++++++++++++++++++++++++++++++++++........++++++++++++++++++++...........................................", +".............++++.+++..........+++..++..+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++.....................+++++++....++..................................+++.+..............................++++++++++++++++++++++++++++++++++++++++++++++++++++++....+++++++++++++++++++++++........................................", +"............+++++..+++.........+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++......................+++++++......+..............................+..++................................+.+++++++++++++++++++++++++++++++++++++++++++++++++++++...+++++++++++++++++++++++++.......................................", +"...........+++++..+++++......+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++..+...+.............+++++......................................++....................................+++++++++++++++++++++++++++++++++++++++++++++++++++++++....+++++++++++++++++++++++++......................................", +"...........+++++.++++++...++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++...............++...............................................................................+..++++++++++++++++++++++++++++++++++++++++++++++++++++++.++++++++++++++++++++++++++.....................................", +"............++...++++++...+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++..............+......................................................................................++++++++++++++++++++++++++++++++++++++++++++++++++.+++++++++++++++++++++++++.......................................", +".......................+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++.............+....................................................................................++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++.........................................", +"....................++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++....................................................................................................+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++......++...++.....................................", +".................++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++...........+.........................................................................................+++.++++++++++++++++++++++++++++++++++++++.++++++++++++++++++++.++++..+....++......................................", +"..................++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++...........++...........................................................................................+++++++++++++++++++++++++++++++++++++++...++++++++++++++++++.+++++......++++.....................................", +"...................+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++.......+++++............................................................................................++++++++++++++++++++++++++++++++++++++++...+++++++++++++++++++++.......+++++.....................................", +"....................+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++...........+++++.............................................................................................+++++++++++++++++++++++++++++++++++++++++...+++++++++++++++++.+........++++++....................................", +".....................++++++++++++++++++++++++++++++++++++.++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++...........+++++...............................................................................................+++++++++++++++++++++++++++++++++++++++++...+..+++++++++++++.........+++++++....................................", +".....................++++++++++++++++.+++++++++++++++++....++...++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++....+++...+++..................................................................................................++++++++++++++++++++++++++++++++++++++++.+++...+++++++++++++.............+.+....................................", +"..............+++++.+++++++++++..+++++.+++++++++++++++...........+++++++++++++++..++++++++.++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++.....++++.......................................................................................................++++++++++++++++++++++++++++++++++++++++.+++.++++...+++++++.....................................................", +".............+++++++++++++++.+....+++++.+++++++++++++..............++++++++++++..++++++++..+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++......+++++......................................................................................................++++++++++++++++++++++++++++++++++++++++.++++++++++++++++++.....................................................", +".............+++++++++++++.....++....++++..++++++++++..++++++++++++++++++++++++.+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++..........++++.......................................................................................................++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++.....................................................", +".............++++++++++........++......+++.+++++++++.++++++++++++++++++++++++++..+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++...........+..........................................................................................................++++++++++++++++++++++++++++++++++++++++++++++++++++++++.........................................................", +".............++++++++++.+++.....+......++...+++++++++++++++++++++++++++++++++++..+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++............++++.........................................................................................................++++++++++++++++++++++++++++++++++++++++++++++++++++++..........................................................", +"..............++++++++...............+.++....+++++.+++++++++++++++++++++++++++++..++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++...+...++++...........++++.........................................................................................................+++++++++++++++++++++++++++++++++++++++++++++++++++++..................................................++.......", +"................+++++...............++.......++++..++++++++++++++++++++++++++++...+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++........++++..........+++............................................................................................................++++++++++++++++++++++++++++++++++++++++++++++++++++...................................................++++....", +".................+++...++++++.++++..+++......+++.+..+++++++++++++++++++++++++++....++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++.....++++........++++............................................................................................................+++++++++++++++++++++++++++++++++++++++++++++++++++.....................................................+++....", +".....................+++++++++++++..............+++..++....+.++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++.....++++.....+++++++.............................................................................................................+++++++++++++++++++++++++++++++++++++++++++++++++++...........................................................", +".................+++++++++++++++++++.............++....++.++.++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++........++..++++++++++..............................................................................................................+++++++++++++++++++++++++++++++++++++++++++++++++++...........................................................", +"..............++++++++++++++++++++...............++...+++++..+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++......+++..++++++++.................................................................................................................++++++++++++++++++++++++++++++++++++++++++++++++.............................................................", +".............+++++++++++++++++++++..........+++........+++..++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++..........+...++++....................................................................................................................+++++++++++++++++++++++++++++++++++++++++++++..............................................................", +"............+++++++++++++++++++++++++++.....++++..+.........+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++........++++++++.......................................................................................................................+++++++++++++++++++++++++++++++++++++++++................................................................", +"............+++++++++++++++++++++++++++++..+++++++++.++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++........+++........++...................................................................................................................++++++++++++++++++++++++++++++++++++++++................................................................", +"............++++++++++++++++++++++++++++++++++++++++++++++++.++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++....................+....................................................................................................................++++++++++++++++++++++++.++++...+++++++................................................................", +"...........+++++++++++++++++++++++++++++++++++++++++++++++++.++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++.....................++............................................++.....................................................................++.+++++++++++++++++++...++.......++++................................................................", +"..........++++++++++++++++++++++++++++++++++++++++++++++++++.++++++++++++++++.+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++........+............++.............................................+++...................................................................+++.+++++++++++++++++.............++++..+.............................................................", +"........++++++++++++++++++++++++++++++++++++++++++++++++++++..++++++++++++++++.+++...+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++.......+..............+++............................................+++.....................................................................++.+++++++++++++++...............++++.++............................................................", +".......++++++++++++++++++++++++++++++++++++++++++++++++++++++.+++++++++++++++++....+...++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++.......+++...............++...................................................................................................................+++..+++++++++++++...............+++...++...........................................................", +".......++++++++++++++++++++++++++++++++++++++++++++++++++++++..++++++++++++++++...++....+.++++++++++++++++++++++++++++++..+++++++++++++++++++++++++++++++.++.....+..............++++....................................................++++............................................................++..+++++++++++++...............+++...+++..........................................................", +"......+++++++++++++++++++++++++++++++++++++++++++++++++++++++...+++++++++++++++..++++..........++++++++++++++++++++++++....+++++++++++++++++++++++++++++.+++......................+.......................................................+++............................................................+++.+++++++++++......................+++..........................................................", +"......++++++++++++++++++++++++++++++++++++++++++++++++++++++++..+++++++++++++++++++++++..........++++++++++++++++++++++....++++++++++++++++++++++++++++..++................................................................................+++++..............................................................++++++++++...............+++++....+..........................................................", +"....+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++..+++++++++++++++++++++++..........+++++++++++++++++++++....++++++++++++++++++++++++++....+.....................................................................................++.+++.+.........................................................+++++++++.............+++++++..............................................................", +"....++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++.++++++++++++++++++++++...........+++++++++++++++++++++...+++++++++++++++++++.+++........+......................................................................................++++..++++......................................................+++++++++........+++...+++++++++...........................................................", +"....+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++..++++++++++++++++++++............+.++++++++++++++++.....++++++++++++++++++.++........................................................................................................+++......................................................++++++++++......++++.........++...++++.....................................................", +"......+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++..++++++++++++++++++................++++++++++++++........+++++++++++++++++++++.........................................................................................................++......................................................++++++++++...+++++...............+++++....................................................", +"......+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++....+++++++++++++++.................++++++++++++............++++++++++++++.............+++..........................+................................................................................................................................+++++++++++++...........+..........+..+++............................................", +"......+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++..++++++++++++.....................++++++++++.............+++++++++++++++............+++..........................+..................................................................................................................................+++++++++...++......................++.+.........................................+.", +"......++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++.+++++++++........................++++++++...............+...++++++++++++............++..............................................................................................................................................................+.++++++++++++........................++.......................................++.", +"......++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++..++++.............................+++++++.............++....++++++++++++.............++................................................................................................................................................................+++++++++++.........................+........................................+.", +"......++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++.++..............................++++++++...........+++....+++++++++++++.............+.........................+........................................................................................................................................+++++++++.........................+..........................................", +"......+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++................................++++++++............++....+++..++++++++............+.++.......................+.............................................................................................................................................+++..............+++.........+..........................................", +".......+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++.+++++........................+++++++...........++.....+++..+++++++...........+..+..++....................................................................................................................................................................+++..........++++++++.......+..........................................", +".......++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++.........................+++++..............+....++++...++++............++.+.++............+.........................................................................................................................................................+++.....+..+++++++++++++++++...........................................", +"........+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++..........................+++..+..................+++....+++............+.................++...........................................................................................................................................................++++++++++++++++++++++++++++.........................................", +"........++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++...............................+++.................+++..................+....+++++........+++...........................................................................................................................................................++++++.+++++++++++++++++++++.........................................", +".........+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++...............................++++.................+++.......................+++++.......++..........................+........................................................................................................................................+++++++++++++++++++++.........................................", +"..........++++++++++++++++.++++++++++++++++++++++++++++++++++++++++++++++++++................................+++...................++................++.......+++.......+..........................++++......................................................................................................................................++++++++++++++++++++++........................................", +"..............................++++++++++++++++++++++++++++++++++++++++++++....................................................++++++.++..........+++++++............................................+++......................................................................................................................................++++++++++++++++++++++++++++++................................", +"...............................+++++++++++++++++++++++++++++++++++++++++++......................................................++++..++........+++++++..............................................++......................................................................................................................................++++++++++++++++++++++++++++++................................", +"................................++++++++++++++++++++++++++++++++++++++++.........................................................+++..++++.....+++++++++......................................................................................................................................................................++............+++++++++++++++++++++++++++++++................................", +".................................+++++++++++++++++++++++++++++++++++++++..........................................................+++..+++....+++++++++++..++++..................................................................++...........................................................................................+++...........+++++++++++++++++++++++++++++++................................", +"................................++++++++++++++++++++++++++++++++++++++............................................................++++........++++++++++.+++++.......+++.........................................................++..........................................................................................++++..........++++++++++++++++++++++++++++++++................................", +"...............................++++++++++++++++++++++++++++++++++++++..............................................................+++++++....++++++++..++++........+++++........................................................++...........................................................................................+++.........++++++++++++++++++++++++++++++++++++++...........................", +"................................++++++++++++++++++++++++++++++++++++................................................................+++++++...++++++++..++++....++...+++++.+++................................................................................................................................................+++.........+++++++++++++++++++++++++++++++++++++++..........................", +".................................+++++++++++++++++++++++++++++++++++..............++................................................+++++++....+++++++.+++++......++..+++++++++............................................................................................................................................................+++++++++++++++++++++++++++++++++++++++++.......................", +"..................................+++++++++++++++++++++++++++++++++..............+++.................................................++++++......+++++..+++....++.+++.++++++++++++........+++.............................................................................................................................................++++++++++++++++++++++++++++++++++++++++++++++...................", +"....................................+++++++++++++++++++++++++++++...............+++....................................................++++.............+++........+.....+++++++++++++...+++++.............................++.........+++.................................................................................................++++++++++++++++++++++++++++++++++++++++++++++...................", +".....................................++++++++++++++++++++++++++++...............++......................................................+++++...........................+++.+++++++++++.+++++.++...........................++.........+++..................................................................................................++++++++++++++++++++++++++++++++++++++++++++++++................", +"....................................+++++++++++++++++++++++++++++.........................................................................++++++....................+...++...++++++++++........+............................++.......++++...................................................................................................+++++++++++++++++++++++++++++++++++++++++++++++................", +".....................................++++++++++++++++++++++++++++++..........................................................................+++++++.+++++++...+...............++++..+++.........++++.......................................................................................................................................++++++++++++++++++++++++++++++++++++++++++++++.................", +".....................................+++++++++++++++++++++++++++++++..++.............................................................................+..+++.++++......................+++...........++++.....................................................................................................................................+++++++++++++++++++++++++++++++++++++++++++++.................", +"......................................++++++++++++++++++++++++++++++..++............................................................................................................................++++......................................................................................................................................+++++++++++++++++++++++++++++++++++++++++++..................", +"......................................++++++++++++++++++++++++++++++.......++........................................................................................++++.........+....................................................+++....................................................................................................++++++++++++++++++++++++++++++++++++++++++...................", +".....................................+++++++++++++++++++++++++++++++.......++++.....................................................................................+++++++.....++++.........................................++.......++++.....................................................................................................+++++++++++++++++++++++++++++++++++++++++...................", +".....................................+++++++++++++++++++++++++++++++......+++++....................................................................................++++++++.....++++..........................................+........++......................................................................................................+++++++++++++++++++++++++++++++++++++++++...................", +"....................................++++++++++++++++++++++++++++++++....++++++.................................................................................+++++++++++++....+++++.......................+...................................................................................................................................++++++++++++++++++++++++++++++++++++++++...................", +"....................................++++++++++++++++++++++++++++++++...+++++++................................................................................++++++++++++++++..++++++.....................+++...................................................................................................................................++++++++++++++++++++++++++++++++++++++....................", +"....................................+++++++++++++++++++++++++++++++....+++++++................................................................................++++++++++++++++.+++++++.......................+..........+..+........................................................................................................................+++++++++++++++++++++++++++++++++++....................", +".....................................++++++++++++++++++++++++++++.....++++++++.............................................................................+++++++++++++++++++++++++++.................................++++...........................................................................................................................++++++++++++++++++++++++++++++++++...................", +".....................................++++++++++++++++++++++++++.......+++++++........++...................................................................++++++++++++++++++++++++++++.................................+++++..........................................................................................................................++++++++++++++++++++++++++++++++++...................", +"......................................++++++++++++++++++++++++.........++++++.....++.++.................................................................++++++++++++++++++++++++++++++++.....................................................................................+........................................................................+++++++++++++++++++++++++++++++++....................", +"......................................++++++++++++++++++++++++........+++++..........................................................................+++++++++++++++++++++++++++++++++++++................++.................................................................++++.....................................................................++++++++++++++++++++++++++++++++.....................", +".......................................+++++++++++++++++++++++........+++++.........................................................................++++++++++++++++++++++++++++++++++++++................+++..................................................................+......................................................................++++++++++++++++++++++++++++++.......................", +".......................................+++++++++++++++++++++++........+++++.......................................................................++++++++++++++++++++++++++++++++++++++++++......................................................................................++..................................................................+++++++++++++++++++++++++++..........................", +".......................................++++++++++++++++++++++...........++........................................................................+++++++++++++++++++++++++++++++++++++++++++....................................................................................++++................................................................++++++++++++++++++++++++++++..........................", +".......................................+++++++++++++++++++++......................................................................................++++++++++++++++++++++++++++++++++++++++++++.....................................................................................++................................................................+++++++++++++++++++++++++.............................", +".......................................++++++++++++++++++++......................................................................................+++++++++++++++++++++++++++++++++++++++++++++.......................................................................................................................................................+++++++++++++++++++++++++.............................", +".......................................++++++++++++++++++++.......................................................................................+++++++++++++++++++++++++++++++++++++++++++++......................................................................................................................................................+++++++++++++++++++++++++.............................", +"........................................+++++++++++++++++++.......................................................................................+++++++++++++++++++++++++++++++++++++++++++++......................................................................................................................................................++++++++++++++++++++++++..............................", +"........................................++++++++++++++++++..........................................................................................+++++++++++++++++++++++++++++++++++++++++++......................................................................................................................................................+++++++++++++++++++++++...............................", +"........................................+++++++++++++++++............................................................................................+++++++++++++++++++++++++++++++++++++++++.......................................................................................................................................................+++++++++++++++++++++++...............................", +".........................................++++++++++++++++............................................................................................+++++++++++++++++++++++++++++++++++++++++.......................................................................................................................................................++++++++++++++++++++++................................", +"..........................................+++++++++++++++............................................................................................+++++++++++++....+++++++++++++++++++++++........................................................................................................................................................++++++++++++++++++++..................................", +"..........................................++++++++++++...............................................................................................+++++++++++++.......+++.++++++++++++++++........................................................................................................................................................++++++++++++++++++++..................................", +"............................................+++++...................................................................................................++++....................++++++++++++++++.......................+.................................................................................................................................+++++++++++++++.......................................", +".....................................................................................................................................................++....................+++++++++++++++++.......................++...............................................................................................................................++++++++++++++++.......................................", +"..............................................................................................................................................................................++++++++++++.........................+++..............................................................................................................................++++++++++++++++.......................................", +"...............................................................................................................................................................................+++++++++++..........................+++...........................................................................................................................+++++++++++++++++........................................", +"................................................................................................................................................................................++..+++.+............................++++.........................................................................................................................++++++++++++++++.........................................", +".....................................................................................................................................................................................++.............................+++++.........................................................................................................................++++++++++++++...........................................", +"....................................................................................................................................................................................................................++++..........................................................................................................................+++++++++++++............................................", +".....................................................................................................................................................................................+...............................++..........................................................................................................................+++++++++++++.............................................", +"....................................................................................................................................................................................+++...........................+++.+.............................................................................................................................++++++++...............................................", +".....................................................................................................................................................................................++++.........................+++...............................................................................................................................+++++++................................................", +"......................................................................................................................................................................................++.......................+++++................................................................................................................................+++++++................................................", +"..............................................................................................................................................................................................................++++++..............................................................................................................................+++++++++................................................", +"............................................................................................................................................................................................................++++++...............................................................................................................................++++++++..................................................", +"............................................................................................................................................................................................................+++++................................................................................................................................++++++++++................................................", +"............................................................................................................................................................................................................+++..................................................................................................................................++++++++++................................................", +".................................................................................................................................................................................................................................................................................................................................................++++++++++................................................", +".................................................................................................++..............................................................................................................................................................................................................................................+++++++++.................................................", +"..................................................................................................+..............................................................................................................................................................................................................................................++++++++..................................................", +".................................................................................................................................................................................................................................................................................................................................................+++++++........++++.......................................", +"..................................................................................................................................................................................................................................................................................................................................................++++++.......+++++.......................................", +"....................................................................................................+.............................................................................................................................................................................................................................................+++++++.......+..........................................", +"...................................................................................................+++..............................................................................................................................................................................................................................................++++++.................................................", +"....................................................................................................++...............................................................................................................................................................................................................................................++++++................................................", +".....................................................................................................................................................................................................................................................................................................................................................+++++++...............................................", +"........................................................................................................................................................................................................................................................................................................................................................++.................................................", +"...........................................................................................................................................................................................................................................................................................................................................................................................................", +"...........................................................................................................................................................................................................................................................................................................................................................................................................", +"...........................................................................................................................................................................................................................................................................................................................................................................................................", +"...........................................................................................................................................................................................................................................................................................................................................................................................................", +"..........................................................................................................................................................................................................................................................................................................................................................................................................."}; diff --git a/etimedate/locale/hu.po b/etimedate/locale/hu.po new file mode 100644 index 0000000..e66cdad --- /dev/null +++ b/etimedate/locale/hu.po @@ -0,0 +1,53 @@ +msgid "" +msgstr "" +"Project-Id-Version: \n" +"POT-Creation-Date: \n" +"PO-Revision-Date: 2005-02-09 11:22+0100\n" +"Last-Translator: Nemeth Otto \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: etimedate.cpp:227 +msgid "Time and date" +msgstr "Dátum és Idő" + +#: etimedate.cpp:230 +msgid "&OK" +msgstr "&OK" + +#: etimedate.cpp:233 +msgid "&Apply" +msgstr "&Alkalmaz" + +#: etimedate.cpp:235 +msgid "Set system time. ->Just root user!<-" +msgstr "Rendszeridő beállítása. ->Csak rendszergazdának!<-" + +#: etimedate.cpp:237 +msgid "&Cancel" +msgstr "Mégs&em" + +#: etimedate.cpp:243 +msgid "Time/date" +msgstr "Dátum/idő" + +#: etimedate.cpp:261 +msgid "Timezones" +msgstr "Időzónák" + +#: fl_time.cpp:189 +msgid "Error setting time. You are probably not superuser!" +msgstr "Hiba az idő beállítása közben. Valószínűleg nem vagy rendszergazda!" + +#: fl_time.cpp:397 +#: fl_time.cpp:405 +#: fl_time.cpp:442 +msgid "Zone information not found." +msgstr "A zóna információkat nem találom." + +#: fl_time.cpp:414 +msgid "Cannot setup timezone!" +msgstr "Időzóna beállítása sikertelen!" + diff --git a/etimedate/locale/id.po b/etimedate/locale/id.po new file mode 100644 index 0000000..b3b2667 --- /dev/null +++ b/etimedate/locale/id.po @@ -0,0 +1,146 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR Free Software Foundation, Inc. +# FIRST AUTHOR , YEAR. +# +msgid "" +msgstr "" +"Project-Id-Version: etimedate\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2005-02-04 12:00+0100\n" +"PO-Revision-Date: 2002-11-29 15:44+0700\n" +"Last-Translator: Bambang Purnomosidi D. P. \n" +"Language-Team: id \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=iso-8859-2\n" +"Content-Transfer-Encoding: 8bit\n" + +#: etimedate.cpp:227 +msgid "Time and date" +msgstr "Jam dan tanggal" + +#: etimedate.cpp:230 +msgid "&OK" +msgstr "&OK" + +#: etimedate.cpp:233 +msgid "&Apply" +msgstr "&Terapkan" + +#: etimedate.cpp:235 +msgid "Set system time. ->Just root user!<-" +msgstr "Set waktu sistem. ->Hanya root!<-" + +#: etimedate.cpp:237 +msgid "&Cancel" +msgstr "&Batal" + +#: etimedate.cpp:243 +msgid "Time/date" +msgstr "Jam/tanggal" + +#: etimedate.cpp:261 +msgid "Timezones" +msgstr "Zone waktu" + +#: fl_time.cpp:189 +msgid "Error setting time. You are probably not superuser!" +msgstr "Salah seting jam. Anda mungkin bukan superuser!" + +#: fl_time.cpp:397 fl_time.cpp:405 fl_time.cpp:442 +msgid "Zone information not found." +msgstr "" + +#: fl_time.cpp:414 +msgid "Cannot setup timezone!" +msgstr "Tidak bisa mensetup zone waktu!" + +#~ msgid "H-" +#~ msgstr "H-" + +#~ msgid "H+" +#~ msgstr "H+" + +#~ msgid "M-" +#~ msgstr "M-" + +#~ msgid "M+" +#~ msgstr "M+" + +#~ msgid "Su" +#~ msgstr "Mg" + +#~ msgid "Mo" +#~ msgstr "Sn" + +#~ msgid "Tu" +#~ msgstr "Sl" + +#~ msgid "We" +#~ msgstr "Rb" + +#~ msgid "Th" +#~ msgstr "Km" + +#~ msgid "Fr" +#~ msgstr "Jm" + +#~ msgid "St" +#~ msgstr "St" + +#~ msgid "Y-" +#~ msgstr "Y-" + +#~ msgid "Previous year." +#~ msgstr "Tahun sebelumnya." + +# msgid "M-" +# msgstr "M-" +#~ msgid "Previous month." +#~ msgstr "Bulan sebelumnya." + +# msgid "M+" +# msgstr "M+" +#~ msgid "Next month." +#~ msgstr "Bulan berikutnya." + +#~ msgid "Y+" +#~ msgstr "Y+" + +#~ msgid "Next year." +#~ msgstr "Tahun berikutnya." + +#~ msgid "January" +#~ msgstr "Januari" + +#~ msgid "Febuary" +#~ msgstr "Februari" + +#~ msgid "March" +#~ msgstr "Maret" + +#~ msgid "April" +#~ msgstr "April" + +#~ msgid "May" +#~ msgstr "Mei" + +#~ msgid "June" +#~ msgstr "Juni" + +#~ msgid "July" +#~ msgstr "Juli" + +#~ msgid "August" +#~ msgstr "Agustus" + +#~ msgid "September" +#~ msgstr "September" + +#~ msgid "October" +#~ msgstr "Oktober" + +#~ msgid "November" +#~ msgstr "November" + +#~ msgid "December" +#~ msgstr "Desember" diff --git a/etimedate/locale/messages.pot b/etimedate/locale/messages.pot new file mode 100644 index 0000000..a9e5707 --- /dev/null +++ b/etimedate/locale/messages.pot @@ -0,0 +1,57 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2005-02-04 12:00+0100\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=CHARSET\n" +"Content-Transfer-Encoding: 8bit\n" + +#: etimedate.cpp:227 +msgid "Time and date" +msgstr "" + +#: etimedate.cpp:230 +msgid "&OK" +msgstr "" + +#: etimedate.cpp:233 +msgid "&Apply" +msgstr "" + +#: etimedate.cpp:235 +msgid "Set system time. ->Just root user!<-" +msgstr "" + +#: etimedate.cpp:237 +msgid "&Cancel" +msgstr "" + +#: etimedate.cpp:243 +msgid "Time/date" +msgstr "" + +#: etimedate.cpp:261 +msgid "Timezones" +msgstr "" + +#: fl_time.cpp:189 +msgid "Error setting time. You are probably not superuser!" +msgstr "" + +#: fl_time.cpp:397 fl_time.cpp:405 fl_time.cpp:442 +msgid "Zone information not found." +msgstr "" + +#: fl_time.cpp:414 +msgid "Cannot setup timezone!" +msgstr "" diff --git a/etimedate/locale/ru.po b/etimedate/locale/ru.po new file mode 100644 index 0000000..da4d225 --- /dev/null +++ b/etimedate/locale/ru.po @@ -0,0 +1,147 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR Free Software Foundation, Inc. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2005-02-04 12:00+0100\n" +"PO-Revision-Date: 2002-11-28 HO:MI+ZONE\n" +"Last-Translator: aabbvv \n" +"Language-Team: RUSSIAN \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=koi8-r\n" +"Content-Transfer-Encoding: 8bit\n" + +#: etimedate.cpp:227 +msgid "Time and date" +msgstr " " + +#: etimedate.cpp:230 +msgid "&OK" +msgstr "&OK" + +#: etimedate.cpp:233 +msgid "&Apply" +msgstr "" + +#: etimedate.cpp:235 +msgid "Set system time. ->Just root user!<-" +msgstr " . -> root!<-" + +#: etimedate.cpp:237 +msgid "&Cancel" +msgstr "" + +#: etimedate.cpp:243 +msgid "Time/date" +msgstr "/" + +#: etimedate.cpp:261 +msgid "Timezones" +msgstr " " + +#: fl_time.cpp:189 +msgid "Error setting time. You are probably not superuser!" +msgstr " . root ;-)" + +#: fl_time.cpp:397 fl_time.cpp:405 fl_time.cpp:442 +msgid "Zone information not found." +msgstr "" + +#: fl_time.cpp:414 +msgid "Cannot setup timezone!" +msgstr " !" + +#~ msgid "H-" +#~ msgstr "-" + +#~ msgid "H+" +#~ msgstr "+" + +#~ msgid "M-" +#~ msgstr "-" + +#~ msgid "M+" +#~ msgstr "+" + +#~ msgid "Su" +#~ msgstr "" + +#~ msgid "Mo" +#~ msgstr "" + +#~ msgid "Tu" +#~ msgstr "" + +#~ msgid "We" +#~ msgstr "" + +#~ msgid "Th" +#~ msgstr "" + +#~ msgid "Fr" +#~ msgstr "" + +#~ msgid "St" +#~ msgstr "" + +#~ msgid "Y-" +#~ msgstr "-" + +#~ msgid "Previous year." +#~ msgstr "+" + +# msgid "M-" +# msgstr "-" +#~ msgid "Previous month." +#~ msgstr " ." + +# msgid "M+" +# msgstr "+" +#~ msgid "Next month." +#~ msgstr " ." + +#~ msgid "Y+" +#~ msgstr "+" + +#~ msgid "Next year." +#~ msgstr " ." + +#~ msgid "January" +#~ msgstr "" + +#~ msgid "Febuary" +#~ msgstr "" + +#~ msgid "March" +#~ msgstr "" + +#~ msgid "April" +#~ msgstr "" + +#~ msgid "May" +#~ msgstr "" + +#~ msgid "June" +#~ msgstr "" + +#~ msgid "July" +#~ msgstr "" + +#~ msgid "August" +#~ msgstr "" + +#~ msgid "September" +#~ msgstr "" + +#~ msgid "October" +#~ msgstr "" + +#~ msgid "November" +#~ msgstr "" + +#~ msgid "December" +#~ msgstr "" diff --git a/etimedate/locale/sk.po b/etimedate/locale/sk.po new file mode 100644 index 0000000..2b34a60 --- /dev/null +++ b/etimedate/locale/sk.po @@ -0,0 +1,147 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR Free Software Foundation, Inc. +# FIRST AUTHOR , YEAR. +# +msgid "" +msgstr "" +"Project-Id-Version: etimedate 1.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2005-02-04 12:00+0100\n" +"PO-Revision-Date: 2002-04-21 14:50+0200\n" +"Last-Translator: Martin Pekar \n" +"Language-Team: Slovak \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: etimedate.cpp:227 +msgid "Time and date" +msgstr "Čas a dátum" + +#: etimedate.cpp:230 +msgid "&OK" +msgstr "&OK" + +#: etimedate.cpp:233 +msgid "&Apply" +msgstr "&Použiť" + +#: etimedate.cpp:235 +msgid "Set system time. ->Just root user!<-" +msgstr "Nastaviť systémový čas. ->Iba root užívateľ!<-" + +#: etimedate.cpp:237 +msgid "&Cancel" +msgstr "&Zrušiť" + +#: etimedate.cpp:243 +msgid "Time/date" +msgstr "Čas/dátum" + +#: etimedate.cpp:261 +msgid "Timezones" +msgstr "Časové zóny" + +#: fl_time.cpp:189 +msgid "Error setting time. You are probably not superuser!" +msgstr "" +"Nastala chyba pri nastavovaní času. Pravdepodobne nie ste superužívateľ!" + +#: fl_time.cpp:397 fl_time.cpp:405 fl_time.cpp:442 +msgid "Zone information not found." +msgstr "" + +#: fl_time.cpp:414 +msgid "Cannot setup timezone!" +msgstr "Nemôžem nastaviť časovú zónu!" + +#~ msgid "H-" +#~ msgstr "H-" + +#~ msgid "H+" +#~ msgstr "H+" + +#~ msgid "M-" +#~ msgstr "M-" + +#~ msgid "M+" +#~ msgstr "M+" + +#~ msgid "Su" +#~ msgstr "Ne" + +#~ msgid "Mo" +#~ msgstr "Po" + +#~ msgid "Tu" +#~ msgstr "Ut" + +#~ msgid "We" +#~ msgstr "St" + +#~ msgid "Th" +#~ msgstr "Št" + +#~ msgid "Fr" +#~ msgstr "Pi" + +#~ msgid "St" +#~ msgstr "So" + +#~ msgid "Y-" +#~ msgstr "R-" + +#~ msgid "Previous year." +#~ msgstr "Predchádzajúci rok." + +# msgid "M-" +# msgstr "M-" +#~ msgid "Previous month." +#~ msgstr "Predchádzajúci mesiac." + +# msgid "M+" +# msgstr "M+" +#~ msgid "Next month." +#~ msgstr "Nasledujúci mesiac." + +#~ msgid "Y+" +#~ msgstr "R+" + +#~ msgid "Next year." +#~ msgstr "Nasledujúci rok." + +#~ msgid "January" +#~ msgstr "Január" + +#~ msgid "Febuary" +#~ msgstr "Február" + +#~ msgid "March" +#~ msgstr "Marec" + +#~ msgid "April" +#~ msgstr "Apríl" + +#~ msgid "May" +#~ msgstr "Máj" + +#~ msgid "June" +#~ msgstr "Jún" + +#~ msgid "July" +#~ msgstr "Júl" + +#~ msgid "August" +#~ msgstr "August" + +#~ msgid "September" +#~ msgstr "September" + +#~ msgid "October" +#~ msgstr "Október" + +#~ msgid "November" +#~ msgstr "November" + +#~ msgid "December" +#~ msgstr "December" diff --git a/etimedate/locale/sr.po b/etimedate/locale/sr.po new file mode 100644 index 0000000..2c3398c --- /dev/null +++ b/etimedate/locale/sr.po @@ -0,0 +1,146 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR Free Software Foundation, Inc. +# FIRST AUTHOR , YEAR. +# +msgid "" +msgstr "" +"Project-Id-Version: etimedate 1.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2005-02-04 12:00+0100\n" +"PO-Revision-Date: 2002-12-02 04:11+0100\n" +"Last-Translator: Dejan Lekic \n" +"Language-Team: LINUKS.org T.T. \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: etimedate.cpp:227 +msgid "Time and date" +msgstr "Време и датум" + +#: etimedate.cpp:230 +msgid "&OK" +msgstr "&ОК" + +#: etimedate.cpp:233 +msgid "&Apply" +msgstr "&Примени" + +#: etimedate.cpp:235 +msgid "Set system time. ->Just root user!<-" +msgstr "Системско време. -> Морате бити суперкорисник! <-" + +#: etimedate.cpp:237 +msgid "&Cancel" +msgstr "&Одустани" + +#: etimedate.cpp:243 +msgid "Time/date" +msgstr "Време/датум" + +#: etimedate.cpp:261 +msgid "Timezones" +msgstr "Временске зоне" + +#: fl_time.cpp:189 +msgid "Error setting time. You are probably not superuser!" +msgstr "Грешка у сетовању времена. Вероватно нисте суперкорисник!" + +#: fl_time.cpp:397 fl_time.cpp:405 fl_time.cpp:442 +msgid "Zone information not found." +msgstr "" + +#: fl_time.cpp:414 +msgid "Cannot setup timezone!" +msgstr "Не могу да сетујем временску зону!" + +#~ msgid "H-" +#~ msgstr "С-" + +#~ msgid "H+" +#~ msgstr "С+" + +#~ msgid "M-" +#~ msgstr "М-" + +#~ msgid "M+" +#~ msgstr "М+" + +#~ msgid "Su" +#~ msgstr "Не" + +#~ msgid "Mo" +#~ msgstr "По" + +#~ msgid "Tu" +#~ msgstr "Ут" + +#~ msgid "We" +#~ msgstr "Ср" + +#~ msgid "Th" +#~ msgstr "Че" + +#~ msgid "Fr" +#~ msgstr "Пе" + +#~ msgid "St" +#~ msgstr "Су" + +#~ msgid "Y-" +#~ msgstr "Г-" + +#~ msgid "Previous year." +#~ msgstr "Претходна година." + +# msgid "M-" +# msgstr "" +#~ msgid "Previous month." +#~ msgstr "Претходни месец." + +# msgid "M+" +# msgstr "" +#~ msgid "Next month." +#~ msgstr "Следеђи месец." + +#~ msgid "Y+" +#~ msgstr "Г+" + +#~ msgid "Next year." +#~ msgstr "Следећа година." + +#~ msgid "January" +#~ msgstr "Јануар" + +#~ msgid "Febuary" +#~ msgstr "Фебруар" + +#~ msgid "March" +#~ msgstr "Март" + +#~ msgid "April" +#~ msgstr "Април" + +#~ msgid "May" +#~ msgstr "Мај" + +#~ msgid "June" +#~ msgstr "Јун" + +#~ msgid "July" +#~ msgstr "Јул" + +#~ msgid "August" +#~ msgstr "Август" + +#~ msgid "September" +#~ msgstr "Септембар" + +#~ msgid "October" +#~ msgstr "Октобар" + +#~ msgid "November" +#~ msgstr "Новембар" + +#~ msgid "December" +#~ msgstr "Децембар" diff --git a/etip/Jamfile b/etip/Jamfile new file mode 100644 index 0000000..577ddd0 --- /dev/null +++ b/etip/Jamfile @@ -0,0 +1,14 @@ +# +# $Id$ +# +# Part of Equinox Desktop Environment (EDE). +# Copyright (c) 2000-2007 EDE Authors. +# +# This program is licenced under terms of the +# GNU General Public Licence version 2 or newer. +# See COPYING for details. + +SubDir TOP etip ; + +MakeProgram etip : etip.cpp ; +ExtractStrings locale : etip.cpp ; diff --git a/etip/Makefile b/etip/Makefile new file mode 100644 index 0000000..d7e1f0f --- /dev/null +++ b/etip/Makefile @@ -0,0 +1,21 @@ + +CPPFILES = etip.cpp ../edelib2/Util.cpp ../edelib2/Config.cpp +TARGET = etip + +POFILES = locale/ru.po\ + locale/sr.po\ + locale/sk.po\ + +include ../makeinclude + +install: + $(INSTALL_PROGRAM) $(TARGET) $(bindir) + $(INSTALL_LOCALE) + +uninstall: + $(RM) $(bindir)/$(TARGET) + +clean: + $(RM) $(TARGET) + $(RM) *.o + diff --git a/etip/etip.cpp b/etip/etip.cpp new file mode 100644 index 0000000..29cb82c --- /dev/null +++ b/etip/etip.cpp @@ -0,0 +1,136 @@ +/* + * $Id$ + * + * Part of Equinox Desktop Environment (EDE). + * Copyright (c) 2000-2006 EDE Authors. + * + * This program is licenced under terms of the + * GNU General Public Licence version 2 or newer. + * See COPYING for details. + */ + +#include +#include +#include +#include +#include +#include + +#include +#include + +#include "icons/hint.xpm" + +// TODO: should be replaced with NLS from edelib +#define _(s) s + +#define TIPS_NUM 7 +#define TITLE_TIPS_NUM 9 + +using namespace fltk; + +unsigned int curr_tip = 0; +const char* tiplist[TIPS_NUM] = +{ +_("To start any application is simple. Press on the button with your user name, go\ + to the Programs menu, select category and click on the wished program."), + +_("To exit the EDE, press button with your user name and then Logout."), + +_("To lock the computer, press button with your user name and then choose Lock."), + +_("To setup things on the computer, press button with your user name, Panel menu and then the Control panel."), + +_("To add a program that is not in the Programs menu, click on the button with your user,\ + Panel menu, and then Menu editor."), + +_("Notice that this is still development version, so please send your bug reports or\ + comments on EDE forum, EDE bug reporting system (on project's page), or check mails of current\ + maintainers located in AUTHORS file."), + +_("You can download latest release on http://sourceforge.net/projects/ede.") +}; + +const char* title_tips[TITLE_TIPS_NUM] = +{ +_("Boring \"Did you know...\""), +_("How about this..."), +_("Smart idea..."), +_("Really smart idea..."), +_("Really really smart idea..."), +_("Uf..."), +_("Something new..."), +_("Or maybe this..."), +_("...") +}; + +const char* random_txt(const char** lst, unsigned int max) +{ + unsigned int val = rand() % max; + curr_tip = val; + return lst[val]; +} + +void close_cb(Widget*, void* w) +{ + Window* win = (Window*)w; + win->hide(); +} + +void next_cb(Widget*, void* tb) +{ + InvisibleBox* tipbox = (InvisibleBox*)tb; + curr_tip++; + if(curr_tip >= TIPS_NUM) + curr_tip = 0; + tipbox->label(tiplist[curr_tip]); + tipbox->redraw_label(); +} + +void prev_cb(Widget*, void* tb) +{ + InvisibleBox* tipbox = (InvisibleBox*)tb; + if(curr_tip == 0) + curr_tip = TIPS_NUM - 1; + else + curr_tip--; + tipbox->label(tiplist[curr_tip]); + tipbox->redraw_label(); +} + +int main(int argc, char** argv) +{ + srand(time(NULL)); + + Window* win = new Window(460, 200, _("Tips...")); + win->begin(); + + InvisibleBox* img = new InvisibleBox(10, 10, 70, 65); + xpmImage pix(hint_xpm); + img->image(pix); + img->box(FLAT_BOX); + + InvisibleBox* title = new InvisibleBox(85, 15, 365, 25, random_txt(title_tips, TITLE_TIPS_NUM)); + title->box(fltk::FLAT_BOX); + title->labelfont(fltk::HELVETICA_BOLD); + title->align(fltk::ALIGN_LEFT|fltk::ALIGN_INSIDE); + + InvisibleBox* tiptxt = new InvisibleBox(85, 45, 365, 110, random_txt(tiplist, TIPS_NUM)); + tiptxt->box(fltk::FLAT_BOX); + tiptxt->align(fltk::ALIGN_TOP|fltk::ALIGN_LEFT|fltk::ALIGN_INSIDE|fltk::ALIGN_WRAP); + + new fltk::CheckButton(10, 165, 155, 25, _("Do not bother me")); + + Button* prev = new Button(170, 165, 90, 25, _("@< Previous")); + prev->callback(prev_cb, tiptxt); + Button* next = new Button(265, 165, 90, 25, _("Next @>")); + next->callback(next_cb, tiptxt); + + Button* close = new Button(360, 165, 90, 25, _("&Close")); + close->callback(close_cb, win); + win->end(); + + win->set_modal(); + win->show(); + return run(); +} diff --git a/etip/etip.fl b/etip/etip.fl new file mode 100644 index 0000000..8408a93 --- /dev/null +++ b/etip/etip.fl @@ -0,0 +1,42 @@ +# data file for the FLTK User Interface Designer (FLUID) +version 2.1000 +header_name {.h} +code_name {.cxx} +gridx 5 +gridy 5 +snap 3 +Function {} {open +} { + {fltk::Window} {} {open + xywh {446 296 460 200} resizable visible + } { + {fltk::InvisibleBox} {} { + xywh {10 10 70 65} box FLAT_BOX + image {icons/hint.xpm} + } + {fltk::InvisibleBox} {} { + label {Did you know} + xywh {85 15 365 25} align 36 box FLAT_BOX labelfont 1 + } + {fltk::InvisibleBox} {} { + label {To start any application is simple. Press on the button with your user name, go to the Programs menu, select category and click on the wished program.} + xywh {85 45 365 110} align 165 box FLAT_BOX + } + {fltk::CheckButton} {} { + label {Do not bother me} + xywh {10 165 155 25} + } + {fltk::Button} {} { + label {@< Previous} + xywh {170 165 90 25} + } + {fltk::Button} {} { + label {Next @>} selected + xywh {265 165 90 25} + } + {fltk::Button} {} { + label {&Close} + xywh {360 165 90 25} + } + } +} diff --git a/etip/etip.fld b/etip/etip.fld new file mode 100644 index 0000000..bd5ae9c --- /dev/null +++ b/etip/etip.fld @@ -0,0 +1,100 @@ +# data file for the FLTK User Interface Designer (FLUID) +version 2.0100 +images_dir ./ +header_name {.h} +code_name {.cpp} +gridx 5 +gridy 5 +snap 3 +decl {// Tips for EDE is (C) Copyright 2001-2002 by Martin Pekar, this program is provided under the terms of GNU GPL v.2, see file COPYING for more information.} {} + +decl {\#include } {} + +decl {\#include } {} + +decl {\#include "EDE_Config.h"} {} + +decl {\#include "NLS.h"} {} + +decl {char *tips[5];} {} + +decl {int activeTip = 0;} {} + +decl {EDE_Config conf("EDE Team", "etip");} {} + +Function {} {open +} { + code {//fl_init_locale_support("etip", PREFIX"/share/locale"); +bool show = true; +conf.set_section("Tips"); +conf.read("Show", show, true); +if (!show) + return 0; +tips[0]=_("To start any application is simple. Press on the EDE button, go to the Programs menu, select category and click on the wished program."); +tips[1]=_("To exit the Equinox Desktop environment, press EDE button and then logout."); +tips[2]=_("To lock the computer, press EDE button and then lock."); +tips[3]=_("To setup things on the computer, press EDE button, Panel menu and then the Control panel."); +tips[4]=_("To add a program that is not in the Programs menu, click on the EDE button, Panel menu, and then Edit panels menu.");} {} + {fltk::Window} {} { + label {Startup tips} open selected + xywh {394 319 400 205} resizable + extra_code {o->size_range(o->w(), o->h());} visible + } { + {fltk::InvisibleBox} {} { + xywh {10 15 60 145} image {/home/vedran/ede/ede2/etip/icons/hint.xpm} + } + {fltk::CheckButton} show_check { + label {Do not show this dialog next time} + xywh {77 145 313 20} align 148 + } + {fltk::Group} {} {open + xywh {80 15 310 125} align 209 resizable box BORDER_FRAME color 0xf4da1200 labelsize 18 + } { + {fltk::InvisibleBox} tipsBox { + xywh {1 46 308 74} align 144 resizable box FLAT_BOX color 7 + extra_code {o->label(tips[activeTip]); +o->window()->redraw();} + } + {fltk::InvisibleBox} {} { + label {Welcome to Equinox Desktop Environment} + xywh {5 5 300 45} align 144 box FLAT_BOX color 0xf4da1200 labelcolor 32 labelsize 18 + } + } + {fltk::Group} {} {open + xywh {0 165 400 40} + } { + {fltk::Button} {} { + label {<< &Previous} + callback {if (activeTip>0 && activeTip<=4) { +activeTip--; +tipsBox->label(tips[activeTip]); +tipsBox->window()->redraw(); +}} + xywh {125 7 90 23} align 128 + } + {fltk::Button} {} { + label {&Next >>} + callback {if (activeTip>=0 && activeTip<4) { +activeTip++; +tipsBox->label(tips[activeTip]); +tipsBox->window()->redraw(); +}} + xywh {215 7 90 23} + } + {fltk::InvisibleBox} {} { + xywh {0 5 157 30} + extra_code {// Fluid sucks in layouting... +o->parent()->resizable(o);} + } + {fltk::Button} {} { + label {&Close} + callback {//Fl_Config conf(fl_find_config_file("apps/etip.conf", 1)); +conf.set_section("Tips"); +conf.write("Show", !show_check->value()); +conf.flush(); +exit(0);} + xywh {320 7 70 23} + } + } + } +} diff --git a/etip/icons/hint.xpm b/etip/icons/hint.xpm new file mode 100644 index 0000000..68959a6 --- /dev/null +++ b/etip/icons/hint.xpm @@ -0,0 +1,820 @@ +/* XPM */ +static char * hint_xpm[] = { +"48 48 769 2", +" c None", +". c #C8BC92", +"+ c #E4DBAC", +"@ c #F3EBC2", +"# c #FAF5DF", +"$ c #FBF9ED", +"% c #FCF9F2", +"& c #FBF9EC", +"* c #F8F3DC", +"= c #F3EABB", +"- c #E1D290", +"; c #AA975E", +"> c #D9D2B3", +", c #EDE9D3", +"' c #F6F5F1", +") c #FAF8F3", +"! c #FEFCF4", +"~ c #FEFDF5", +"{ c #FEFDF3", +"] c #FEFCF3", +"^ c #FEFCF2", +"/ c #FEFCF1", +"( c #FDFBEF", +"_ c #FBF8EE", +": c #F1E9B9", +"< c #C3B47C", +"[ c #929292", +"} c #EAE5C8", +"| c #F8F6F2", +"1 c #FCFBF6", +"2 c #FEFDF8", +"3 c #FEFDF7", +"4 c #FEFDF2", +"5 c #FEFDF1", +"6 c #FEFCF0", +"7 c #FEFCEE", +"8 c #FAF9EE", +"9 c #EAE2B9", +"0 c #AAAAAA", +"a c #DBD6C7", +"b c #EEECE1", +"c c #FBFAF6", +"d c #FEFDFA", +"e c #FEFDFB", +"f c #FEFDF4", +"g c #FEFDF0", +"h c #FEFDEF", +"i c #FEFCEF", +"j c #FCF9EE", +"k c #F1EED6", +"l c #BEB49E", +"m c #DBD7C7", +"n c #EEEDE5", +"o c #F8F7F4", +"p c #FEFDF9", +"q c #FEFDFC", +"r c #FEFDFD", +"s c #FEFDEE", +"t c #FCF9ED", +"u c #F5F2DC", +"v c #AEA384", +"w c #EEECE0", +"x c #FAF9F6", +"y c #FEFDFE", +"z c #CCCBCB", +"A c #D1D0CF", +"B c #C7C6BE", +"C c #D8D7CD", +"D c #F3EFD5", +"E c #777777", +"F c #E9E7D7", +"G c #F7F7F4", +"H c #FDFCF8", +"I c #787878", +"J c #656564", +"K c #FEFDF6", +"L c #71716C", +"M c #6A6A65", +"N c #FDFCED", +"O c #FAF7EC", +"P c #EDE7B9", +"Q c #E3E0D2", +"R c #F2F2F0", +"S c #5A5A59", +"T c #4D4D4C", +"U c #545451", +"V c #41413E", +"W c #F9F7EC", +"X c #C5B582", +"Y c #EBE9DE", +"Z c #515150", +"` c #FFFEF7", +" . c #FFFEF6", +".. c #FFFEF5", +"+. c #4E4E4B", +"@. c #FEFDED", +"#. c #F3EDC0", +"$. c #6B6B6B", +"%. c #DBD3B8", +"&. c #F3F3F0", +"*. c #5B5B5A", +"=. c #4F4F4E", +"-. c #FFFFF9", +";. c #FFFFF8", +">. c #FFFEF8", +",. c #4F4E4B", +"'. c #FEFDEC", +"). c #FEFDEB", +"!. c #FCFAEC", +"~. c #917E4C", +"{. c #E8E4CE", +"]. c #FFFFFF", +"^. c #545453", +"/. c #FFFFFB", +"(. c #FFFFFA", +"_. c #4D4C4A", +":. c #FFFEF4", +"<. c #E8DA86", +"[. c #8E8E8E", +"}. c #EEEBD8", +"|. c #585857", +"1. c #4C4B49", +"2. c #535250", +"3. c #F5EFBC", +"4. c #9A9A9A", +"5. c #F3F0E3", +"6. c #FDFCF7", +"7. c #60605E", +"8. c #585856", +"9. c #4A4947", +"0. c #FFFEF2", +"a. c #F8F6D7", +"b. c #C9C7C5", +"c. c #B2B1B0", +"d. c #959494", +"e. c #B3B2B0", +"f. c #BCBCBB", +"g. c #F5F4EF", +"h. c #FFFFFC", +"i. c #DEDEDB", +"j. c #EEEEEA", +"k. c #D9D9D3", +"l. c #FFFEF3", +"m. c #FFFEEF", +"n. c #FEFDEA", +"o. c #FAF7E8", +"p. c #707070", +"q. c #B6B5B4", +"r. c #E6E3DF", +"s. c #DAD6D1", +"t. c #5A5551", +"u. c #C1BAB2", +"v. c #DCD8D5", +"w. c #B5B2AF", +"x. c #F7F5F2", +"y. c #FFFFFE", +"z. c #9C9B90", +"A. c #FCFAED", +"B. c #5A5A5A", +"C. c #C2BFBA", +"D. c #EAE6E2", +"E. c #D5C9BE", +"F. c #7B7268", +"G. c #E8E3DE", +"H. c #E8E1DA", +"I. c #968A7E", +"J. c #898583", +"K. c #F4F4ED", +"L. c #FDFCF6", +"M. c #D8D7D3", +"N. c #FFFFFD", +"O. c #FFFEE6", +"P. c #FFFEF0", +"Q. c #FEFDE9", +"R. c #6F6F66", +"S. c #FDF9E8", +"T. c #5E5E5E", +"U. c #8D8A88", +"V. c #E6E2DC", +"W. c #D9C9B9", +"X. c #9C8979", +"Y. c #B4A89B", +"Z. c #E7DED3", +"`. c #CBBBA7", +" + c #94887A", +".+ c #C6C0B8", +"++ c #A6A4A2", +"@+ c #F2EFE2", +"#+ c #FDFCF4", +"$+ c #848380", +"%+ c #D2D1CC", +"&+ c #FFFEE8", +"*+ c #C7C6B7", +"=+ c #7A7A70", +"-+ c #FCF8D9", +";+ c #626262", +">+ c #B3AFAB", +",+ c #E8E1D9", +"'+ c #CBB4A0", +")+ c #7C6C5B", +"!+ c #E1D8CC", +"~+ c #DFCFBD", +"{+ c #A69482", +"]+ c #C3BBB2", +"^+ c #EDE9E6", +"/+ c #CFC9C2", +"(+ c #949391", +"_+ c #EEEAD4", +":+ c #FCFBF3", +"<+ c #D8D7D1", +"[+ c #686865", +"}+ c #FFFEE7", +"|+ c #FFFEE4", +"1+ c #7E7E74", +"2+ c #D8D7C7", +"3+ c #F8F2B6", +"4+ c #807150", +"5+ c #CAC5B9", +"6+ c #B3B3B3", +"7+ c #DCD7D1", +"8+ c #DBCEC1", +"9+ c #AB9884", +"0+ c #9E8F81", +"a+ c #E7DDD1", +"b+ c #D2BFA9", +"c+ c #958475", +"d+ c #E2DCD5", +"e+ c #DED3C6", +"f+ c #B4A694", +"g+ c #83807D", +"h+ c #E5DFBF", +"i+ c #FAF8F2", +"j+ c #9D9C97", +"k+ c #858481", +"l+ c #FEFDCD", +"m+ c #FFFEDE", +"n+ c #FFFEF1", +"o+ c #A09F93", +"p+ c #8B8A7F", +"q+ c #FEFCEB", +"r+ c #E6D579", +"s+ c #B49E58", +"t+ c #D3CCB0", +"u+ c #C2C0B9", +"v+ c #B5B3B0", +"w+ c #E6DFD6", +"x+ c #C3B4A5", +"y+ c #917F70", +"z+ c #D2C5B8", +"A+ c #DECEBD", +"B+ c #AB9984", +"C+ c #B5A99C", +"D+ c #E8E0D8", +"E+ c #BEAE9D", +"F+ c #B6ADA3", +"G+ c #B6B2AE", +"H+ c #9A9997", +"I+ c #CDC3A5", +"J+ c #FDFCF2", +"K+ c #7B7B75", +"L+ c #B2B1AB", +"M+ c #FEFCBF", +"N+ c #FFFDD6", +"O+ c #FFFEEE", +"P+ c #E1E0CE", +"Q+ c #828177", +"R+ c #D1D0BF", +"S+ c #FEFBED", +"T+ c #8A722C", +"U+ c #C8B876", +"V+ c #DBD3BD", +"W+ c #CBC3B4", +"X+ c #6B6865", +"Y+ c #E9E4DD", +"Z+ c #EDE8E3", +"`+ c #D5CDC5", +" @ c #B2A69A", +".@ c #B4A493", +"+@ c #8D7D6E", +"@@ c #DCD4CC", +"#@ c #DBCEC0", +"$@ c #BAAA9B", +"%@ c #EAE4E0", +"&@ c #E2DCD6", +"*@ c #999794", +"=@ c #EBE8D5", +"-@ c #FAF8F0", +";@ c #74746E", +">@ c #A09F98", +",@ c #FEFDE3", +"'@ c #FEFBAC", +")@ c #DDDCCA", +"!@ c #78786E", +"~@ c #BEBDAD", +"{@ c #FEFDE8", +"]@ c #F7EFB6", +"^@ c #463814", +"/@ c #D3C693", +"(@ c #DAD2BB", +"_@ c #D9D4C6", +":@ c #917E6B", +"<@ c #B7A68F", +"[@ c #E2D3C2", +"}@ c #EDE4D9", +"|@ c #F1EEE9", +"1@ c #F1EEEB", +"2@ c #D7D1CA", +"3@ c #A39489", +"4@ c #DFD6CD", +"5@ c #B4A292", +"6@ c #C3B8AD", +"7@ c #E3DBD3", +"8@ c #C4B9AC", +"9@ c #888683", +"0@ c #D5CEB5", +"a@ c #F9F6EF", +"b@ c #7B7B73", +"c@ c #8E8D86", +"d@ c #C3C2B7", +"e@ c #FEFDC6", +"f@ c #FDFAA0", +"g@ c #BFBEAF", +"h@ c #727268", +"i@ c #CCCBBB", +"j@ c #FDFBED", +"k@ c #A58939", +"l@ c #675325", +"m@ c #D1C69E", +"n@ c #D9D4C2", +"o@ c #DFDBD3", +"p@ c #BDAE9B", +"q@ c #927F6A", +"r@ c #D5C4B1", +"s@ c #E9DFD2", +"t@ c #EEE7DF", +"u@ c #F2EEEB", +"v@ c #F1EFED", +"w@ c #D9D2CB", +"x@ c #C8BAAB", +"y@ c #A09183", +"z@ c #D5C8B8", +"A@ c #948C82", +"B@ c #E7DFB9", +"C@ c #FCFAF1", +"D@ c #B2B1A4", +"E@ c #818077", +"F@ c #A3A26A", +"G@ c #B9B8AB", +"H@ c #FEFCBE", +"I@ c #C3C297", +"J@ c #717167", +"K@ c #7F7E74", +"L@ c #D8D7C5", +"M@ c #FDFBEA", +"N@ c #EFE6A8", +"O@ c #3E3E3E", +"P@ c #807252", +"Q@ c #CBBEA1", +"R@ c #D9D2C4", +"S@ c #E4DED6", +"T@ c #DBD2C5", +"U@ c #897664", +"V@ c #A59584", +"W@ c #E7DED2", +"X@ c #ECE5DE", +"Y@ c #F0EBE8", +"Z@ c #F3F1EE", +"`@ c #BDB1A8", +" # c #B9AFA5", +".# c #E4DBCF", +"+# c #C1B3A1", +"@# c #7F7C78", +"## c #797979", +"$# c #F3EED4", +"%# c #FCF9EF", +"&# c #FEFCEA", +"*# c #EDECDB", +"=# c #A7A56B", +"-# c #8E8D82", +";# c #74746A", +"># c #747469", +",# c #747356", +"'# c #807F75", +")# c #EDECD9", +"!# c #F6F1D1", +"~# c #6F6F6F", +"{# c #848484", +"]# c #8C867C", +"^# c #B3AA93", +"/# c #DCD2C8", +"(# c #E7DFD4", +"_# c #E7E2DC", +":# c #C7B5A0", +"<# c #A79481", +"[# c #CEC2B6", +"}# c #EBE5DE", +"|# c #EFEBE7", +"1# c #F3F0EE", +"2# c #F0EDEA", +"3# c #E3DAD3", +"4# c #D2C1B3", +"5# c #D2C4B2", +"6# c #988E82", +"7# c #858584", +"8# c #ADA48D", +"9# c #F3EFDF", +"0# c #FAF9EF", +"a# c #FEFDBD", +"b# c #D0CD7C", +"c# c #F8F4DC", +"d# c #988D72", +"e# c #939393", +"f# c #B1ABA1", +"g# c #E0D2C4", +"h# c #E8DFD1", +"i# c #EBE3DA", +"j# c #DED2C5", +"k# c #CEBDAB", +"l# c #D0C4B8", +"m# c #EBE5DF", +"n# c #F0EEEB", +"o# c #F4F1EF", +"p# c #F1EDEA", +"q# c #EBE4DD", +"r# c #DDCEBF", +"s# c #C1B19F", +"t# c #8C8884", +"u# c #AFA896", +"v# c #F0EBD1", +"w# c #FEFBEE", +"x# c #FEFCE8", +"y# c #FDFA9D", +"z# c #FEFDCF", +"A# c #FEFDCB", +"B# c #FEFDE7", +"C# c #FDF996", +"D# c #FEFDE2", +"E# c #FEFCE7", +"F# c #FBF9EA", +"G# c #F3F0D4", +"H# c #9B9077", +"I# c #838383", +"J# c #B6B3B1", +"K# c #CEC3B4", +"L# c #E6DACC", +"M# c #E9DED1", +"N# c #E7DCD1", +"O# c #DECFBF", +"P# c #E0D5C8", +"Q# c #EFEDE9", +"R# c #EFECE8", +"S# c #E8DBCD", +"T# c #D3C4B2", +"U# c #A3988C", +"V# c #A4A3A2", +"W# c #858585", +"X# c #E4DBB2", +"Y# c #F9F6EC", +"Z# c #FCF8E4", +"`# c #FCF6B6", +" $ c #FCF8B1", +".$ c #FEFAB0", +"+$ c #FEFBB3", +"@$ c #FEFBB7", +"#$ c #FEFCB6", +"$$ c #FEFCB8", +"%$ c #FEFBB2", +"&$ c #FEFAC5", +"*$ c #FCFBDA", +"=$ c #F8F8EB", +"-$ c #EAE4C2", +";$ c #8B8B8B", +">$ c #8D8883", +",$ c #DDCCB8", +"'$ c #E7D9C8", +")$ c #E9DCCC", +"!$ c #E7DBCA", +"~$ c #E7DCCF", +"{$ c #EAE3DC", +"]$ c #E8DFD3", +"^$ c #E3D7C8", +"/$ c #DBCCBA", +"($ c #B9AA97", +"_$ c #8E8A83", +":$ c #6C6C6C", +"<$ c #948454", +"[$ c #F5EBA6", +"}$ c #F6EDB3", +"|$ c #F7F0B2", +"1$ c #F9F2B2", +"2$ c #FCF6B7", +"3$ c #FCF7B7", +"4$ c #FDF9B7", +"5$ c #FDFAB8", +"6$ c #FCF8B7", +"7$ c #FBF7B6", +"8$ c #FAF4B5", +"9$ c #F4EB92", +"0$ c #A69D6D", +"a$ c #959595", +"b$ c #B1B1B1", +"c$ c #969592", +"d$ c #B4ACA2", +"e$ c #DFD2C2", +"f$ c #E0D2C1", +"g$ c #E5D7C7", +"h$ c #E7DBCB", +"i$ c #E5D9CB", +"j$ c #E2D5C7", +"k$ c #DCCFBE", +"l$ c #D2C3B0", +"m$ c #B9A997", +"n$ c #A09485", +"o$ c #93918F", +"p$ c #F7F1C0", +"q$ c #F1E7A4", +"r$ c #F3EAA3", +"s$ c #F6EEB7", +"t$ c #F8F1BF", +"u$ c #F8F1BE", +"v$ c #F9F3BC", +"w$ c #F9F3B5", +"x$ c #F9F3AE", +"y$ c #F8EF9F", +"z$ c #F8F0AB", +"A$ c #F4EA99", +"B$ c #D9C14F", +"C$ c #938355", +"D$ c #918E8A", +"E$ c #AEACA9", +"F$ c #BDB6AF", +"G$ c #C8BBAD", +"H$ c #CCBCAB", +"I$ c #CDBFAE", +"J$ c #CFC1B1", +"K$ c #CEBFAD", +"L$ c #C1B09F", +"M$ c #B19F8D", +"N$ c #A49483", +"O$ c #A19A91", +"P$ c #F5E79A", +"Q$ c #F6F0C1", +"R$ c #FAF8E6", +"S$ c #FBFAEE", +"T$ c #FAF5CE", +"U$ c #F9F5CA", +"V$ c #FAF6CE", +"W$ c #FBF7D0", +"X$ c #F6EEB3", +"Y$ c #F0E59A", +"Z$ c #DDC862", +"`$ c #968336", +" % c #A18D4B", +".% c #948960", +"+% c #7D7D7C", +"@% c #9D9C9C", +"#% c #6F6E6A", +"$% c #72665C", +"%% c #A18F7D", +"&% c #AD9984", +"*% c #9E8C77", +"=% c #A1907B", +"-% c #9D8F7E", +";% c #A9A096", +">% c #A39F9C", +",% c #F3E3A6", +"'% c #EADB9B", +")% c #F4E7A8", +"!% c #F7E9A9", +"~% c #F7EAA9", +"{% c #F5E89B", +"]% c #F2E187", +"^% c #EDDB7A", +"/% c #E7D573", +"(% c #DFCB6B", +"_% c #D7C367", +":% c #BCA85A", +"<% c #9D8B47", +"[% c #6C612F", +"}% c #928349", +"|% c #B6A977", +"1% c #B1AB98", +"2% c #969696", +"3% c #919191", +"4% c #918A6F", +"5% c #49422C", +"6% c #3C3835", +"7% c #8C8278", +"8% c #ABA196", +"9% c #9F9891", +"0% c #A09E9B", +"a% c #F8F3DD", +"b% c #F8F0D5", +"c% c #E6D69B", +"d% c #DACC96", +"e% c #D4C68E", +"f% c #D6C686", +"g% c #CDBC70", +"h% c #CAB766", +"i% c #C3B064", +"j% c #C6B477", +"k% c #C9BE8F", +"l% c #D3C38A", +"m% c #A28E55", +"n% c #3B3B3B", +"o% c #BDB083", +"p% c #DAC88C", +"q% c #D5C692", +"r% c #968E72", +"s% c #6E6E6E", +"t% c #999999", +"u% c #8C8C8C", +"v% c #C1B693", +"w% c #9D9269", +"x% c #545454", +"y% c #F0DC96", +"z% c #F6EBC1", +"A% c #FBF8EA", +"B% c #FCFBF1", +"C% c #FDFBF2", +"D% c #F9F4DA", +"E% c #F3EAC3", +"F% c #F1E6BD", +"G% c #ECE2BA", +"H% c #EBE2BD", +"I% c #DFD4A9", +"J% c #BDAA64", +"K% c #8B8054", +"L% c #828282", +"M% c #A1A1A1", +"N% c #9F9F9F", +"O% c #464646", +"P% c #D7C37C", +"Q% c #E4CD7B", +"R% c #E4CF86", +"S% c #E4D393", +"T% c #DDCD93", +"U% c #DECD92", +"V% c #CFBF82", +"W% c #C3B377", +"X% c #505050", +"Y% c #F3E6B6", +"Z% c #E3D296", +"`% c #F1E1A8", +" & c #F4E7B9", +".& c #F2E4B1", +"+& c #EFDD9C", +"@& c #E7D288", +"#& c #DFC97A", +"$& c #D9C374", +"%& c #CCB76D", +"&& c #C4B069", +"*& c #A29565", +"=& c #948A62", +"-& c #878787", +";& c #696969", +">& c #424242", +",& c #ACA076", +"'& c #BFB077", +")& c #C7B572", +"!& c #C6B472", +"~& c #887D57", +"{& c #494949", +"]& c #F7EFD6", +"^& c #F4EAC7", +"/& c #E6D8AA", +"(& c #D4C697", +"_& c #D1C59C", +":& c #CEC190", +"<& c #C4B275", +"[& c #BDAA67", +"}& c #B6A361", +"|& c #AE9D5D", +"1& c #C8BD9A", +"2& c #D1C599", +"3& c #9A8D55", +"4& c #727272", +"5& c #717171", +"6& c #EBD792", +"7& c #F1E5BA", +"8& c #F9F5E6", +"9& c #FCFAF4", +"0& c #FBF9EE", +"a& c #F9F6EA", +"b& c #F5EED7", +"c& c #ECE3C0", +"d& c #EADFBC", +"e& c #E8E0C3", +"f& c #D2C492", +"g& c #B8A462", +"h& c #837646", +"i& c #434343", +"j& c #EFE6BF", +"k& c #DFD099", +"l& c #EDE0B1", +"m& c #EEE2B3", +"n& c #EBDCA7", +"o& c #E6D597", +"p& c #DDC982", +"q& c #D3BF72", +"r& c #CDB86D", +"s& c #C9B46A", +"t& c #BCAA65", +"u& c #9F8F55", +"v& c #72673C", +"w& c #484848", +"x& c #F1E9CB", +"y& c #E6DCB9", +"z& c #D4C9A3", +"A& c #CCC19A", +"B& c #C3B480", +"C& c #B9A86C", +"D& c #B2A060", +"E& c #AC9B5C", +"F& c #A59558", +"G& c #BFB38B", +"H& c #CCBF92", +"I& c #92824E", +"J& c #535353", +"K& c #ABA48D", +"L& c #E4D4A3", +"M& c #F0E9CE", +"N& c #F8F6EB", +"O& c #F8F5E9", +"P& c #EFE7CC", +"Q& c #EBE2C2", +"R& c #E7DEBC", +"S& c #E7DEC1", +"T& c #D9D0A9", +"U& c #C4B57F", +"V& c #AEA070", +"W& c #605F5A", +"X& c #868686", +"Y& c #B1B0AD", +"Z& c #DCD5B8", +"`& c #E0D4A4", +" * c #E0D2A1", +".* c #E0D19D", +"+* c #DAC98F", +"@* c #D0BC7A", +"#* c #C7B46C", +"$* c #C3B068", +"%* c #BEAA66", +"&* c #AB9C62", +"** c #898578", +"=* c #8E8D8C", +"-* c #B7B7B7", +";* c #A9A8A4", +">* c #B6B098", +",* c #AFA682", +"'* c #AA9E73", +")* c #928553", +"!* c #847847", +"~* c #6B6242", +"{* c #36311D", +"]* c #3E3A2C", +"^* c #696968", +"/* c #515151", +"(* c #767676", +"_* c #242424", +":* c #191919", +"<* c #1F1F1F", +"[* c #666666", +"}* c #676767", +"|* c #353535", +"1* c #3C3C3C", +"2* c #757575", +"3* c #4E4E4E", +"4* c #8D8D8D", +" ", +" ", +" . + @ # $ % & * = - ; ", +" > , ' ) ! ~ { ] ^ / / ( _ : < [ ", +" } | 1 2 2 3 3 ~ { { 4 5 5 6 7 8 9 0 ", +" a b c 2 d e e d 3 ~ f { { 4 5 g h i j k l ", +" m n o p q r r e p 3 ~ ~ f { { 5 g g s h t u v ", +" w x d q r y z A p 3 3 ~ ~ f B C 5 g h s s t D E ", +" F G H e r r r I J p 2 3 K ~ f L M 5 g h s s N O P I ", +" Q R H d q r r r S T p p 3 3 ~ ~ U V 4 g g s s s N W X ", +" Y o d e q q q q S Z d p 2 ` ...+.+.4 g g s @.@.@.N #.$. ", +" %.&.H d e q r r r *.=.d -.;.>.` .,.,.{ 5 g s '.).).s !.~. ", +" {.o p d e q r ].r S ^./.(.-.;.>.` _.,.:.4 h @.'.).).@.7 <.[. ", +" }.1 p d e q r r r |.Z /./.(.(.-.>.1.2...:.g s ).).).@.s 3.4. ", +" 5.6.p d e e q q r 7.8././.(.(.-.-.9.2. ...0.h @.).).).s a.[. b.c.d.e.f. ", +" g.3 p p d e e e h.i.j./.h././././.k.k.>. .l.m.@.n.).'.s o.p. q.r.s.t.u.v.w. ", +" x.3 2 p p e e e /././.y.y.h.]./.].-.(.>.` :.m.s n.z.).s A.B. C.D.E.F.G.H.I.J. ", +" K.L.K M.p p d d N.N.N./.N.(.N.(.N.N.;.O. .:.P.'.Q.R.'.@.S.T. U.V.W.X.Y.Z.`. +.+++ ", +" @+#+3 $+%+p d d &+(.(.y./.]./.].-.-.;.P. .0.m.).*+=+n.@.-+;+ >+,+'+)+!+~+{+]+^+/+(+ ", +" _+:+~ <+[+2 2 p ~ }+(.(.-.-.-.-.-.>.|+..l.m.'.Q.1+2+n.@.3+4+5+ 6+7+8+9+0+a+b+c+d+e+f+g+ ", +" h+i+f f j+k+3 2 2 l+;.-.;.>.>.` ` .m+l.n+@.n.o+p+Q.n.q+r+s+t+u+ v+w+x+y+z+A+B+C+D+E+F+G+H+", +" I+g.J+g 4 K+L+f ~ M+K . . .......:.N+O+).n.P+Q+R+n.).S+T+U+V+W+X+]+Y+Z+`+ @.@+@@@#@$@%@&@*@", +" =@-@h h g ;@>@4 ,@{ { l.l.l.l.n+P.'@).Q.)@!@~@{@Q.).]@^@/@(@_@:@<@[@}@|@1@2@3@4@5@6@7@8@9@", +" 0@a@^ s @.s b@c@d@e@5 g g P.P.m.@.f@{@g@h@i@Q.Q.'.j@k@l@m@n@o@p@q@r@s@t@u@v@w@x@y@7@z@A@ ", +" B@C@/ ).'.'.D@E@F@G@).).Q.Q.Q.H@I@J@K@L@Q.{@).M@N@O@P@Q@R@S@T@U@V@W@X@Y@Z@^+`@ #.#+#@# ", +" ##$#%#&#n.n.n.*#=#-#;#J@;#>#>#,#'#)#{@{@{@Q.M@!#~#{#]#^#/#(#_#:#<#[#}#|#1#2#3#4#5#6#7# ", +" 8#9#0#6 n.n.n.a#e@2+R+R+R+R+b#Q.Q.Q.{@'.M@c#d#e# f#g#h#i#j#k#l#m#n#o#p#q#r#s#t# ", +" u#v#t w#x#{@,@y#z#l+A#A#B#C#D#B#B#E#F#G#H#I# J#K#L#M#N#O#P#q#Q#R#i#S#T#U#V# ", +" W#X#Y#Z#`# $.$+$@$#$$$$$%$%$&$*$=$-$[ ;$ >$,$'$)$!$~${$}#]$^$/$($_$ ", +" :$<$[$}$|$1$2$3$4$5$5$6$7$8$9$0$a$b$ c$d$e$f$g$h$i$j$k$l$m$n$o$ ", +" p$q$r$s$t$u$v$w$x$y$z$A$B$C$D$ E$F$G$H$I$J$K$L$M$N$O$ ", +" P$Q$R$S$F#T$U$V$W$X$Y$Z$`$ %.%+% @%#%$%%%&%*%=%-%;%>% ", +" ,%'%)%!%~%{%]%^%/%(%_%:%<%[%}%|%1%2% 3%4%5%6%7%8%9%0% ", +" a%b%c%d%e%f%g%h%i%j%k%l%m%n%T.o%p%q%r%s%{#[ t%u%v%w%x%e# ", +" y%z%A%B%C%D%E%F%G%H%I%J%K%L%M%N%O%P%Q%R%S%T%U%V%W%X%2% ", +" Y%Z%`% &.&+&@&#&$&%&&&*&=&-& ;&>&,&'&)&!&~&{& ", +" ]&^&/&(&_&:&<&[&}&|&1&2&3&;+ I 4&5& ", +" 6&7&8&9&0&a&b&c&d&e&f&g&h&i& ", +" j&k&l&m&n&o&p&q&r&s&t&u&v&w& ", +" 9#x&y&z&A&B&C&D&E&F&G&H&I&J& ", +" K&L&M&N&O&P&Q&R&S&T&U&V&W&X& ", +" Y&Z&`& *.*+*@*#*$*%*&***=* ", +" -*;*>*,*'*)*!*~*{*]*^*-& ", +" N%/*I#(*_*:*<*[* ", +" }*;+4&|*1*2* ", +" 3*T.(*4* ", +" ", +" "}; diff --git a/etip/locale/id.po b/etip/locale/id.po new file mode 100644 index 0000000..ffba7b6 --- /dev/null +++ b/etip/locale/id.po @@ -0,0 +1,93 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR Free Software Foundation, Inc. +# FIRST AUTHOR , YEAR. +# +msgid "" +msgstr "" +"Project-Id-Version: emenueditor\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2005-02-04 11:58+0100\n" +"PO-Revision-Date: 2002-11-29 15:50+0700\n" +"Last-Translator: Bambang Purnomosidi D. P. \n" +"Language-Team: id \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=iso-8859-2\n" +"Content-Transfer-Encoding: 8bit\n" + +#: etip.cpp:809 +#, fuzzy +msgid "" +"To start any application is simple. Press on the button with your user name, " +"go to the Programs menu, select category and click on the wished program." +msgstr "" +"Untuk memulai suatu aplikasi, caranya sederhana. Tekan tombol EDE, gerakkan " +"ke menu Programs, pilih kategori dan klik pada program yang diinginkan." + +#: etip.cpp:810 +#, fuzzy +msgid "" +"To exit the Equinox Desktop environment, press button with your user name " +"and then logout." +msgstr "" +"Untuk keluar dari Equinox Desktop Environment, tekan tombol EDE dan kemudian " +"logout." + +#: etip.cpp:811 +#, fuzzy +msgid "To lock the computer, press button with your user name and then lock." +msgstr "Untuk mengunci komputer, tekan tombol EDE dan kemudian lock." + +#: etip.cpp:812 +#, fuzzy +msgid "" +"To setup things on the computer, press button with your user name, Panel " +"menu and then the Control panel." +msgstr "" +"Untuk mensetup hal-hal tertentu di komputer anda, tekan tombol EDE, menu " +"Panel dan kemudian Control panel." + +#: etip.cpp:813 +#, fuzzy +msgid "" +"To add a program that is not in the Programs menu, click on the button with " +"your user, Panel menu, and then Edit panels menu." +msgstr "" +"Untuk menambahkan suatu program yang tidak berada di menu Programs, klik " +"pada tombol EDE, menu Panel, dan kemudian menu Edit panel/" + +#: etip.cpp:814 +msgid "" +"Notice that this is still development version, so please send your bug " +"reports or comments on EDE forum, EDE bug reporting system (on project's " +"page), or karijes@users.sourceforge.net." +msgstr "" + +#: etip.cpp:815 +msgid "" +"You can download latest release on - http://sourceforge.net/projects/ede." +msgstr "" + +#: etip.cpp:820 +msgid "Startup tips" +msgstr "Tips startup" + +#: etip.cpp:825 +msgid "Do not show this dialog next time" +msgstr "Jangan perlihatkan dialog ini lain kali" + +#: etip.cpp:840 +#, fuzzy +msgid "Welcome to Equinox Desktop Environment version " +msgstr "Selamat datang di Equinox Desktop Environment" + +#: etip.cpp:850 +msgid "<< &Previous" +msgstr "<< &Sebelum" + +#: etip.cpp:854 +msgid "&Next >>" +msgstr "&Berikut >>" + +#: etip.cpp:859 +msgid "&Close" +msgstr "&Tutup" diff --git a/etip/locale/messages.pot b/etip/locale/messages.pot new file mode 100644 index 0000000..c653490 --- /dev/null +++ b/etip/locale/messages.pot @@ -0,0 +1,81 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2005-02-04 11:58+0100\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=CHARSET\n" +"Content-Transfer-Encoding: 8bit\n" + +#: etip.cpp:809 +msgid "" +"To start any application is simple. Press on the button with your user name, " +"go to the Programs menu, select category and click on the wished program." +msgstr "" + +#: etip.cpp:810 +msgid "" +"To exit the Equinox Desktop environment, press button with your user name " +"and then logout." +msgstr "" + +#: etip.cpp:811 +msgid "To lock the computer, press button with your user name and then lock." +msgstr "" + +#: etip.cpp:812 +msgid "" +"To setup things on the computer, press button with your user name, Panel " +"menu and then the Control panel." +msgstr "" + +#: etip.cpp:813 +msgid "" +"To add a program that is not in the Programs menu, click on the button with " +"your user, Panel menu, and then Edit panels menu." +msgstr "" + +#: etip.cpp:814 +msgid "" +"Notice that this is still development version, so please send your bug " +"reports or comments on EDE forum, EDE bug reporting system (on project's " +"page), or karijes@users.sourceforge.net." +msgstr "" + +#: etip.cpp:815 +msgid "" +"You can download latest release on - http://sourceforge.net/projects/ede." +msgstr "" + +#: etip.cpp:820 +msgid "Startup tips" +msgstr "" + +#: etip.cpp:825 +msgid "Do not show this dialog next time" +msgstr "" + +#: etip.cpp:840 +msgid "Welcome to Equinox Desktop Environment version " +msgstr "" + +#: etip.cpp:850 +msgid "<< &Previous" +msgstr "" + +#: etip.cpp:854 +msgid "&Next >>" +msgstr "" + +#: etip.cpp:859 +msgid "&Close" +msgstr "" diff --git a/etip/locale/ru.po b/etip/locale/ru.po new file mode 100644 index 0000000..ad59f13 --- /dev/null +++ b/etip/locale/ru.po @@ -0,0 +1,93 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR Free Software Foundation, Inc. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2005-02-04 11:58+0100\n" +"PO-Revision-Date: 2002-11-28 HO:MI+ZONE\n" +"Last-Translator: aabbvv \n" +"Language-Team: RUSSIAN \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=koi8-r\n" +"Content-Transfer-Encoding: 8bit\n" + +#: etip.cpp:809 +#, fuzzy +msgid "" +"To start any application is simple. Press on the button with your user name, " +"go to the Programs menu, select category and click on the wished program." +msgstr "" +" , EDE, " +", ݣ ." + +#: etip.cpp:810 +#, fuzzy +msgid "" +"To exit the Equinox Desktop environment, press button with your user name " +"and then logout." +msgstr " EDE EDE, ." + +#: etip.cpp:811 +#, fuzzy +msgid "To lock the computer, press button with your user name and then lock." +msgstr "" +" , EDE ." + +#: etip.cpp:812 +#, fuzzy +msgid "" +"To setup things on the computer, press button with your user name, Panel " +"menu and then the Control panel." +msgstr "" +" - EDE \"" +"\" ." + +#: etip.cpp:813 +#, fuzzy +msgid "" +"To add a program that is not in the Programs menu, click on the button with " +"your user, Panel menu, and then Edit panels menu." +msgstr "" +" EDE, ," +" , ." + +#: etip.cpp:814 +msgid "" +"Notice that this is still development version, so please send your bug " +"reports or comments on EDE forum, EDE bug reporting system (on project's " +"page), or karijes@users.sourceforge.net." +msgstr "" + +#: etip.cpp:815 +msgid "" +"You can download latest release on - http://sourceforge.net/projects/ede." +msgstr "" + +#: etip.cpp:820 +msgid "Startup tips" +msgstr " " + +#: etip.cpp:825 +msgid "Do not show this dialog next time" +msgstr " " + +#: etip.cpp:840 +#, fuzzy +msgid "Welcome to Equinox Desktop Environment version " +msgstr " Equinox Desktop Environment" + +#: etip.cpp:850 +msgid "<< &Previous" +msgstr "<< " + +#: etip.cpp:854 +msgid "&Next >>" +msgstr " >>" + +#: etip.cpp:859 +msgid "&Close" +msgstr "" diff --git a/etip/locale/sk.po b/etip/locale/sk.po new file mode 100644 index 0000000..dbc5079 --- /dev/null +++ b/etip/locale/sk.po @@ -0,0 +1,94 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR Free Software Foundation, Inc. +# FIRST AUTHOR , YEAR. +# +msgid "" +msgstr "" +"Project-Id-Version: etip 1.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2005-02-04 11:58+0100\n" +"PO-Revision-Date: 2002-04-21 14:50+0200\n" +"Last-Translator: Martin Pekar \n" +"Language-Team: Slovak \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: etip.cpp:809 +#, fuzzy +msgid "" +"To start any application is simple. Press on the button with your user name, " +"go to the Programs menu, select category and click on the wished program." +msgstr "" +"Spustiť aplikáciu je jednoduché. Stlačte EDE tlačidlo, chodte do ponuky " +"Programy, zvoľte kategóriu a kliknite na želaný program." + +#: etip.cpp:810 +#, fuzzy +msgid "" +"To exit the Equinox Desktop environment, press button with your user name " +"and then logout." +msgstr "" +"Ak chcete ukončiť prostredie Equinox Desktop environment, stlačte tlačidlo " +"EDE a potom odhlásenie." + +#: etip.cpp:811 +#, fuzzy +msgid "To lock the computer, press button with your user name and then lock." +msgstr "" +"Na zamknutie počitača, stlačte EDE tlačidlo a potom zablokovať obrazovku." + +#: etip.cpp:812 +#, fuzzy +msgid "" +"To setup things on the computer, press button with your user name, Panel " +"menu and then the Control panel." +msgstr "" +"Na nastavenie vecí na počítači, stlačte EDE tlačidlo, ponuku Panel a potom " +"Kontrólny panel." + +#: etip.cpp:813 +#, fuzzy +msgid "" +"To add a program that is not in the Programs menu, click on the button with " +"your user, Panel menu, and then Edit panels menu." +msgstr "" +"Na pridanie programu, ktorý nie je ponuke Programy, kliknite na EDE " +"tlačidlo, ponuku Panel a potom Editovať ponuku panelu." + +#: etip.cpp:814 +msgid "" +"Notice that this is still development version, so please send your bug " +"reports or comments on EDE forum, EDE bug reporting system (on project's " +"page), or karijes@users.sourceforge.net." +msgstr "" + +#: etip.cpp:815 +msgid "" +"You can download latest release on - http://sourceforge.net/projects/ede." +msgstr "" + +#: etip.cpp:820 +msgid "Startup tips" +msgstr "Úvodné typy" + +#: etip.cpp:825 +msgid "Do not show this dialog next time" +msgstr "Nabudúce už tento dialóg nezobrazovať" + +#: etip.cpp:840 +#, fuzzy +msgid "Welcome to Equinox Desktop Environment version " +msgstr "Vitajte v prostredí Equinox Desktop Environment" + +#: etip.cpp:850 +msgid "<< &Previous" +msgstr "<< &Späť" + +#: etip.cpp:854 +msgid "&Next >>" +msgstr "&Ďalej >>" + +#: etip.cpp:859 +msgid "&Close" +msgstr "&Zavrieť" diff --git a/etip/locale/sr.po b/etip/locale/sr.po new file mode 100644 index 0000000..f8862e9 --- /dev/null +++ b/etip/locale/sr.po @@ -0,0 +1,95 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR Free Software Foundation, Inc. +# Dejan Lekic , 2002. +# +msgid "" +msgstr "" +"Project-Id-Version: etip 1.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2005-02-04 11:58+0100\n" +"PO-Revision-Date: 2002-12-02 04:19+0100\n" +"Last-Translator: Dejan Lekic \n" +"Language-Team: LINUKS.org T.T. \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: etip.cpp:809 +#, fuzzy +msgid "" +"To start any application is simple. Press on the button with your user name, " +"go to the Programs menu, select category and click on the wished program." +msgstr "" +"Стартовање апликације је веома просто. Притисните ЕДЕ тастер \"Програми\", " +"селектујте категорију и кликните на жељени програм." + +#: etip.cpp:810 +#, fuzzy +msgid "" +"To exit the Equinox Desktop environment, press button with your user name " +"and then logout." +msgstr "" +"Да бисте изашли из ЕДЕ-а притисните ЕДЕ тастер и након тога кликните на " +"\"Излогуј ме\"." + +#: etip.cpp:811 +#, fuzzy +msgid "To lock the computer, press button with your user name and then lock." +msgstr "" +"Да бисте закључали рачунар притисните ЕДЕ тастер и након тога кликните на " +"\"закључај\"." + +#: etip.cpp:812 +#, fuzzy +msgid "" +"To setup things on the computer, press button with your user name, Panel " +"menu and then the Control panel." +msgstr "" +"Да бисте подесили разне ствари на вашем рачунару притисните ЕДЕ тастер, " +"након тога изаберите \"Панел\" мени и кликните на \"Контролни панел\" опцију." + +#: etip.cpp:813 +#, fuzzy +msgid "" +"To add a program that is not in the Programs menu, click on the button with " +"your user, Panel menu, and then Edit panels menu." +msgstr "" +"Да бисте додали програм који није у менију \"Програми\" кликните на ЕДЕ " +"тастер, \"Панел\" мени и онда на \"Едитовање панела\" опцију." + +#: etip.cpp:814 +msgid "" +"Notice that this is still development version, so please send your bug " +"reports or comments on EDE forum, EDE bug reporting system (on project's " +"page), or karijes@users.sourceforge.net." +msgstr "" + +#: etip.cpp:815 +msgid "" +"You can download latest release on - http://sourceforge.net/projects/ede." +msgstr "" + +#: etip.cpp:820 +msgid "Startup tips" +msgstr "Стартап савети" + +#: etip.cpp:825 +msgid "Do not show this dialog next time" +msgstr "Не желим приказивање овог дијалога у будуће" + +#: etip.cpp:840 +#, fuzzy +msgid "Welcome to Equinox Desktop Environment version " +msgstr "Добродошли у Иквинокс Десктоп Окружење :)" + +#: etip.cpp:850 +msgid "<< &Previous" +msgstr "<< &Претходни" + +#: etip.cpp:854 +msgid "&Next >>" +msgstr "&Следећи >>" + +#: etip.cpp:859 +msgid "&Close" +msgstr "&Затвори" diff --git a/evoke/EvokeService.cpp b/evoke/EvokeService.cpp new file mode 100644 index 0000000..80e0a8d --- /dev/null +++ b/evoke/EvokeService.cpp @@ -0,0 +1,138 @@ +/* + * $Id$ + * + * Evoke, head honcho of everything + * Part of Equinox Desktop Environment (EDE). + * Copyright (c) 2000-2007 EDE Authors. + * + * This program is licensed under terms of the + * GNU General Public License version 2 or newer. + * See COPYING for details. + */ + +#include "Log.h" +#include "EvokeService.h" +#include +#include +#include + +#include // getpid +#include // +#include // free +#include // strdup + + +EvokeService::EvokeService() : logfile(NULL), pidfile(NULL) { +} + +EvokeService::~EvokeService() { + if(logfile) + delete logfile; + + if(pidfile) { + edelib::file_remove(pidfile); + free(pidfile); + } +} + +EvokeService* EvokeService::instance(void) { + static EvokeService es; + return &es; +} + +bool EvokeService::setup_logging(const char* file) { + if(!file) + logfile = new DummyLog(); + else + logfile = new RealLog(); + + if(!logfile->open(file)) { + delete logfile; + return false; + } + + return true; +} + +bool EvokeService::setup_pid(const char* file) { + if(!file) + return false; + + if(edelib::file_exists(file)) + return false; + + FILE* f = fopen(file, "w"); + if(!f) + return false; + + fprintf(f, "%i", getpid()); + fclose(f); + + pidfile = strdup(file); + return true; +} + +bool EvokeService::setup_config(const char* config, bool do_startup) { + // for now if is not startup mode, ignore it + if(!do_startup) + return true; + + edelib::Config c; + if(!c.load(config)) + return false; + + char buff[1024]; + if(!c.get("evoke", "Startup", buff, sizeof(buff))) + return false; + + edelib::vector vs; + edelib::stringtok(vs, buff, ","); + + // nothing, fine, do nothing + unsigned int sz = vs.size(); + if(sz == 0) + return true; + + EvokeClient ec; + const char* key_name; + for(unsigned int i = 0; i < sz; i++) { + key_name = vs[i].c_str(); + edelib::str_trim((char*)key_name); + + // probably listed but not the same key; also Exec value must exists + if(!c.get(key_name, "Exec", buff, sizeof(buff))) + continue; + else + ec.exec = buff; + + if(c.get(key_name, "Message", buff, sizeof(buff))) + ec.message = buff; + // it is no EDE app untill say so + c.get(key_name, "Core", ec.core, false); + + if(c.get(key_name, "Icon", buff, sizeof(buff))) + ec.icon = buff; + + clients.push_back(ec); + } + + for(unsigned int i = 0; i < clients.size(); i++) { + printf("Exec: %s\n", clients[i].exec.c_str()); + printf("Message: %s\n", clients[i].message.c_str()); + printf("Icon: %s\n", clients[i].icon.c_str()); + printf("Core: %i\n\n", clients[i].core); + } + + return true; +} + +void EvokeService::setup_atoms(Display* d) { + _ede_shutdown_all = XInternAtom(d, "_EDE_EVOKE_SHUTDOWN_ALL", False); + _ede_spawn = XInternAtom(d, "_EDE_EVOKE_SPAWN", False); + _ede_shutdown_client = XInternAtom(d, "_EDE_SHUTDOWN", False); +} + +int EvokeService::handle(int event) { + logfile->printf("Got event %i\n", event); + return 0; +} diff --git a/evoke/EvokeService.h b/evoke/EvokeService.h new file mode 100644 index 0000000..9229818 --- /dev/null +++ b/evoke/EvokeService.h @@ -0,0 +1,57 @@ +/* + * $Id$ + * + * Evoke, head honcho of everything + * Part of Equinox Desktop Environment (EDE). + * Copyright (c) 2000-2007 EDE Authors. + * + * This program is licensed under terms of the + * GNU General Public License version 2 or newer. + * See COPYING for details. + */ + +#ifndef __EVOKESERVICE_H__ +#define __EVOKESERVICE_H__ + +#include "Log.h" +#include + +#include +#include + +struct EvokeClient { + edelib::String message; // message during startup + edelib::String icon; // icon for this client + edelib::String exec; // program name/path to run + bool core; // does understaind _EDE_SHUTDOWN_SELF (only ede apps) +}; + +class EvokeService { + private: + Log* logfile; + char* pidfile; + + Atom _ede_shutdown_all; + Atom _ede_shutdown_client; + Atom _ede_spawn; + + edelib::vector clients; + + public: + EvokeService(); + ~EvokeService(); + static EvokeService* instance(void); + + bool setup_logging(const char* file); + bool setup_pid(const char* file); + bool setup_config(const char* config, bool do_startup); + void setup_atoms(Display* d); + + int handle(int event); + + Log* log(void) { return logfile; } +}; + +#define EVOKE_LOG EvokeService::instance()->log()->printf + +#endif diff --git a/evoke/Jamfile b/evoke/Jamfile new file mode 100644 index 0000000..afd89f9 --- /dev/null +++ b/evoke/Jamfile @@ -0,0 +1,6 @@ + +LINKLIBS = -L/opt/ede/lib -ledelib -lao -lvorbis -lvorbisfile -lmad -L/usr/local/lib -L/usr/X11R6/lib -lfltk_images -lpng -lz -ljpeg -lfltk -ldl -lm -lXext -lX11 -lstdc++ ; + +C++FLAGS += -I/opt/ede/include -Wall -pedantic -D_DEBUG -g3 -I/usr/local/include -I/usr/X11R6/include ; + +Main evoke : evoke.cpp EvokeService.cpp Log.cpp ; diff --git a/evoke/Log.cpp b/evoke/Log.cpp new file mode 100644 index 0000000..1a833d6 --- /dev/null +++ b/evoke/Log.cpp @@ -0,0 +1,73 @@ +/* + * $Id$ + * + * Evoke, head honcho of everything + * Part of Equinox Desktop Environment (EDE). + * Copyright (c) 2000-2007 EDE Authors. + * + * This program is licensed under terms of the + * GNU General Public License version 2 or newer. + * See COPYING for details. + */ + +#include "Log.h" +#include +#include +#include +#include + +RealLog::RealLog() : f(NULL), buff(NULL), tbuff(NULL), bufflen(256), tbufflen(20), + to_stdout(false), to_stderr(false) { +} + +RealLog::~RealLog() { + if(f) { + puts("RealLog::~RealLog()\n"); + fclose(f); + } + + if(buff) + delete [] buff; + if(tbuff) + delete [] tbuff; +} + +bool RealLog::open(const char* file) { + EASSERT(file != NULL); + + if(strcmp(file, "stdout") == 0) + to_stdout = true; + else if(strcmp(file, "stderr") == 0) + to_stderr = true; + else { + f = fopen(file, "a"); + if(!f) + return false; + } + + buff = new char[bufflen]; + tbuff = new char[tbufflen]; + return true; +} + +void RealLog::printf(const char* fmt, ...) { + EASSERT(buff != NULL); + EASSERT(tbuff != NULL); + + va_list ap; + va_start(ap, fmt); + vsnprintf(buff, bufflen, fmt, ap); + va_end(ap); + + time_t t = time(NULL); + strftime(tbuff, tbufflen, "%F %T", localtime(&t)); + + if(to_stdout) + fprintf(stdout, "[%s] %s", tbuff, buff); + else if(to_stderr) + fprintf(stderr, "[%s] %s", tbuff, buff); + else { + fprintf(f, "[%s] %s", tbuff, buff); + fflush(f); + } +} diff --git a/evoke/Log.h b/evoke/Log.h new file mode 100644 index 0000000..16b4209 --- /dev/null +++ b/evoke/Log.h @@ -0,0 +1,51 @@ +/* + * $Id$ + * + * Evoke, head honcho of everything + * Part of Equinox Desktop Environment (EDE). + * Copyright (c) 2000-2007 EDE Authors. + * + * This program is licensed under terms of the + * GNU General Public License version 2 or newer. + * See COPYING for details. + */ + +#ifndef __LOG_H__ +#define __LOG_H__ + +#include + +class Log { + public: + Log() { } + virtual ~Log() { } + virtual bool open(const char* file) = 0; + virtual void printf(const char* fmt, ...) = 0; +}; + +class DummyLog : public Log { + public: + DummyLog() { } + virtual ~DummyLog() { } + virtual bool open(const char* file) { return true; } + virtual void printf(const char* fmt, ...) { } +}; + +class RealLog : public Log { + private: + FILE* f; + char* buff; + char* tbuff; + int bufflen; + int tbufflen; + bool to_stdout; + bool to_stderr; + + public: + RealLog(); + virtual ~RealLog(); + virtual bool open(const char* file); + virtual void printf(const char* fmt, ...); +}; + +#endif diff --git a/evoke/evoke.conf b/evoke/evoke.conf new file mode 100644 index 0000000..ad779be --- /dev/null +++ b/evoke/evoke.conf @@ -0,0 +1,29 @@ +# evoke configuration sample + +# main section +# must be present +[evoke] + Startup = edewm,eiconman,eworkpanel,xscreensaver + +[edewm] + Icon = wm.png + Exec = edewm + Core = True + Message = Starting window manager + +[eiconman] + Icon = desktop.png + Exec = eiconman + Core = True + Message = Starting desktop + +[eworkpanel] + Icon = workpanel.png + Exec = eworkpanel + Core = True + Message = Starting workpanel + +[xscreensaver] + Icon = xscreensaver.png + Exec = xscreensaver + Message = Starting screensaver diff --git a/evoke/evoke.cpp b/evoke/evoke.cpp new file mode 100644 index 0000000..f0c5043 --- /dev/null +++ b/evoke/evoke.cpp @@ -0,0 +1,183 @@ +/* + * $Id$ + * + * Evoke, head honcho of everything + * Part of Equinox Desktop Environment (EDE). + * Copyright (c) 2000-2007 EDE Authors. + * + * This program is licensed under terms of the + * GNU General Public License version 2 or newer. + * See COPYING for details. + */ + +#include "EvokeService.h" + +#include +#include + +#include +#include +#include + +#include +#include +#include +#include +#include + +#define FOREVER 1e20 +#define CONFIG_FILE "evoke.conf" +#define APPNAME "evoke" +#define DEFAULT_PID "/tmp/evoke.pid" + +#define CHECK_ARGV(argv, pshort, plong) ((strcmp(argv, pshort) == 0) || (strcmp(argv, plong) == 0)) + +bool running = false; + +void quit_signal(int sig) { + EVOKE_LOG("Got quit signal %i\n", sig); + running = false; +} + +int xmessage_handler(int e) { + return EvokeService::instance()->handle(e); +} + +const char* next_param(int curr, char** argv, int argc) { + int j = curr + 1; + if(j >= argc) + return NULL; + if(argv[j][0] == '-') + return NULL; + return argv[j]; +} + +void help(void) { + puts("Usage: "APPNAME" [OPTIONS]"); + puts("EDE startup manager responsible for starting, quitting and tracking"); + puts("various pieces of desktop environment and external programs."); + puts("...and to popup a nice window when something crashes...\n"); + puts("Options:"); + puts(" -h, --help this help"); + puts(" -s, --startup run in starup mode"); + puts(" -f, --foreground run in foreground"); + puts(" -c, --config [FILE] use FILE as config file"); + puts(" -p, --pid [FILE] use FILE to store PID number"); + puts(" -l, --log [FILE] log traffic to FILE\n"); +} + +int main(int argc, char** argv) { + const char* config_file = NULL; + const char* pid_file = NULL; + const char* log_file = NULL; + + bool do_startup = false; + bool do_foreground = false; + + if(argc > 1) { + const char* a; + for(int i = 1; i < argc; i++) { + a = argv[i]; + if(CHECK_ARGV(a, "-h", "--help")) { + help(); + return 0; + } else if(CHECK_ARGV(a, "-c", "--config")) { + config_file = next_param(i, argv, argc); + if(!config_file) { + puts("Missing configuration filename"); + return 1; + } + i++; + } else if(CHECK_ARGV(a, "-p", "--pid")) { + pid_file = next_param(i, argv, argc); + if(!pid_file) { + puts("Missing pid filename"); + return 1; + } + i++; + } else if(CHECK_ARGV(a, "-l", "--log")) { + log_file = next_param(i, argv, argc); + if(!log_file) { + puts("Missing log filename"); + return 1; + } + i++; + } + else if(CHECK_ARGV(a, "-s", "--startup")) + do_startup = true; + else if(CHECK_ARGV(a, "-f", "--foreground")) + do_foreground = true; + else { + printf("Unknown parameter '%s'. Run '"APPNAME" -h' for options\n", a); + return 1; + } + } + } + + // make sure X11 is running before fork + fl_open_display(); + + // start service + if(!do_foreground) { + int x; + if((x = fork()) > 0) + exit(0); + else if(x == -1) { + printf("Fatal: fork failed !\n"); + return 1; + } + } + + EvokeService* service = EvokeService::instance(); + + if(!service->setup_logging(log_file)) { + printf("Can't open %s for logging. Please choose some writeable place\n", log_file); + return 1; + } + + EVOKE_LOG("= "APPNAME" started =\n"); + + if(!pid_file) + pid_file = DEFAULT_PID; + + if(!service->setup_pid(pid_file)) { + EVOKE_LOG("Either another "APPNAME" instance is running or can't create pid file. Please correct this\n"); + EVOKE_LOG("= "APPNAME" abrupted shutdown =\n"); + return 1; + } + + if(!config_file) + config_file = CONFIG_FILE; // TODO: XDG paths + + if(!service->setup_config(config_file, do_startup)) { + EVOKE_LOG("Unable to read correctly %s. Please check it is correct config file\n"); + EVOKE_LOG("= "APPNAME" abrupted shutdown =\n"); + return 1; + } + + service->setup_atoms(fl_display); + + signal(SIGINT, quit_signal); + signal(SIGTERM, quit_signal); + signal(SIGKILL, quit_signal); + + running = true; + + XSelectInput(fl_display, RootWindow(fl_display, fl_screen), PropertyChangeMask | StructureNotifyMask | ClientMessage); + + /* + * Register event listener and run in infinite loop. Loop will be + * interrupted from one of the received signals. + * + * I choose to use fltk for this since wait() will nicely pool events + * and pass expecting ones to xmessage_handler(). Other (non-fltk) solution would + * be to manually pool events via select() and that code could be very messy. + * So stick with the simplicity :) + */ + Fl::add_handler(xmessage_handler); + while(running) + Fl::wait(FOREVER); + + EVOKE_LOG("= "APPNAME" nice shutdown =\n"); + return 0; +} diff --git a/evoke/splash-alpha1.png b/evoke/splash-alpha1.png new file mode 100644 index 0000000..63b13d2 Binary files /dev/null and b/evoke/splash-alpha1.png differ diff --git a/evoke/splash.fl b/evoke/splash.fl new file mode 100644 index 0000000..45a6873 --- /dev/null +++ b/evoke/splash.fl @@ -0,0 +1,27 @@ +# data file for the Fltk User Interface Designer (fluid) +version 1.0108 +header_name {.h} +code_name {.cxx} +Function {} {open selected +} { + Fl_Window {} {open + xywh {365 175 480 364} type Double visible + } { + Fl_Box {} { + image {splash-alpha1.png} xywh {0 0 480 364} labelsize 14 + } + Fl_Box {} { + label {Starting window manager...} + xywh {20 322 440 23} labelsize 14 align 16 + } + Fl_Box {} { + image {../../../../.icons/edeneu/32x32/actions/address-book-new.png} xywh {135 259 60 53} labelsize 14 + } + Fl_Box {} { + image {../../../../.icons/edeneu/32x32/actions/appointment-new.png} xywh {200 259 60 53} labelsize 14 + } + Fl_Box {} { + image {../../../../.icons/edeneu/32x32/apps/evolution.png} xywh {265 259 60 53} labelsize 14 + } + } +} diff --git a/evolume/Jamfile b/evolume/Jamfile new file mode 100644 index 0000000..12955bd --- /dev/null +++ b/evolume/Jamfile @@ -0,0 +1,16 @@ +# +# $Id$ +# +# Part of Equinox Desktop Environment (EDE). +# Copyright (c) 2000-2007 EDE Authors. +# +# This program is licenced under terms of the +# GNU General Public Licence version 2 or newer. +# See COPYING for details. + +SubDir TOP evolume ; + +SOURCE = evolume.cpp prefs.cpp ; + +MakeProgram evolume : $(SOURCE) ; +ExtractStrings locale : $(SOURCE) ; diff --git a/evolume/Makefile b/evolume/Makefile new file mode 100644 index 0000000..858f02f --- /dev/null +++ b/evolume/Makefile @@ -0,0 +1,22 @@ + +CPPFILES = evolume.cpp prefs.cpp ../edelib2/about_dialog.cpp ../edelib2/Util.cpp ../edelib2/Config.cpp ../edelib2/process.cpp ../edelib2/pty.cpp ../edelib2/Run.cpp +TARGET = evolume + + +POFILES = locale/ru.po\ + locale/sk.po\ + locale/hu.po + +include ../makeinclude + +install: + $(INSTALL_PROGRAM) $(TARGET) $(bindir) + $(INSTALL_LOCALE) + +uninstall: + $(RM) $(bindir)/$(TARGET) + +clean: + $(RM) $(TARGET) + $(RM) *.o + diff --git a/evolume/evolume.cpp b/evolume/evolume.cpp new file mode 100644 index 0000000..a23141a --- /dev/null +++ b/evolume/evolume.cpp @@ -0,0 +1,624 @@ +/* + * $Id$ + * + * Volume control application + * Part of Equinox Desktop Environment (EDE). + * Copyright (c) 2000-2006 EDE Authors. + * + * This program is licenced under terms of the + * GNU General Public Licence version 2 or newer. + * See COPYING for details. + */ + + +// TODO: +// At the moment evolume is ALSA only - patches for OSS support +// are welcome + +#include "prefs.h" +#include "evolume.h" +#include "../edeconf.h" + +#include "../edelib2/about_dialog.h" + +#include +#include + + +using namespace fltk; +using namespace edelib; + + + + +// Global variables + +char device[1024]={0}; +Window *main_window=0; + +Config globalConfig("EDE Team", "evolume"); +bool simplemode = true; + + +// Main ALSA device functions + +void set_device(int mixer_fd, int device, Slider *device_sl, Slider *balance) +{ + int l = (unsigned int) ((1.0-(balance->value()) ) * device_sl->value() ); + int r = (unsigned int) ( (balance->value()) * device_sl->value()); + int v = (r << 8) | l; + if (ioctl (mixer_fd, MIXER_WRITE (device), &v) < 0) + alert(_("Cannot setup device, sorry.")); +} + +void get_device_info(int mixer_dev, Slider *sl, Slider *bal, + CheckButton *ck, int device) +{ + unsigned int devmask, recmask, recsrc, stereo; + volume real_volume; + + real_volume.left = real_volume.right = 0; + devmask = recmask = recsrc = stereo = 0; + + if (ioctl(mixer_dev, SOUND_MIXER_READ_DEVMASK, &devmask) == -1) + fprintf(stderr, "Read devmask failed.\n"); + if (devmask & (1 << (device))) + sl->activate(); + else + sl->deactivate(); + + if (ioctl(mixer_dev, SOUND_MIXER_READ_STEREODEVS, &stereo) == -1) + fprintf(stderr, "Read recsrc failed.\n"); + if ( stereo & (1 << (device) ) ) bal->activate(); + else ck->deactivate(); + + if (ioctl(mixer_dev, SOUND_MIXER_READ_RECMASK, &recmask) == -1) + fprintf(stderr, "Read recmask failed.\n"); + if ( recmask & (1 << (device) ) ) ck->activate(); + else ck->deactivate(); + + if (ioctl(mixer_dev, SOUND_MIXER_READ_RECSRC, &recsrc) == -1) + fprintf(stderr, "Read recsrc failed.\n"); + if ( recsrc & (1 << (device) ) ) ck->set(); + else ck->clear(); + + if ( ioctl(mixer_dev, MIXER_READ(device), &real_volume) < 0 ) { + fprintf(stderr, "Can't obtain current volume settings.\n"); + } + + float volume = real_volume.left + real_volume.right; + + float balance = 0; + balance = ( (1.0 * (unsigned char)real_volume.right ) / + (1.0 * ((unsigned char)real_volume.left + (unsigned char)real_volume.right)) ); + + if (volume == 0) + volume=1; + if (balance < 0) + balance=0.5; + sl->value(volume); + bal->value(balance); +} + +void set_mute(int mixer_fd, int device, Slider *device_sl, Slider *balance, CheckButton *check_button) +{ + int vol = 0; + + if ( check_button->value() ) + { + if (ioctl(mixer_fd, MIXER_WRITE(device), &vol) < 0 ) + fprintf(stderr, "Cannot set mute.\n"); + } + else { + volume real_volume; + double old_volume = device_sl->value(); + double old_balance = balance->value(); + real_volume.left = (unsigned char) ( (1.0 - (old_balance)) * old_volume ); + real_volume.right = (unsigned char) ( (old_balance) * old_volume); + if ( ioctl(mixer_fd, MIXER_WRITE(device), &real_volume) < 0 ) + { + fprintf(stderr, "Cannot setup volume, sorry.\n"); + } + } +} + +void set_rec(int mixer_fd, int device, CheckButton *ck) +{ + unsigned int recsrc; + + if (ioctl(mixer_fd, SOUND_MIXER_READ_RECSRC, &recsrc) == -1) + printf("read recsrc failed\n"); + unsigned int new_recsrc = recsrc ^ ( 1 << device ); + + if (ioctl(mixer_fd, SOUND_MIXER_WRITE_RECSRC, &new_recsrc) == -1) + printf("oh no\n"); +} + +void update_info() +{ + mixer_info minfo; + + if (ioctl(mixer_device, SOUND_MIXER_INFO, &minfo) < 0) + fprintf(stderr, "Read device info failed.\n"); + else + { + char *title = (char*)malloc(strlen(_("Volume control: [%s]"))+strlen(minfo.name)); + sprintf(title,_("Volume control: [%s]"), minfo.name); + main_window->label(title); + } +} + + +// These functions set parameters for default look of sliders + +void default_look(Slider* slider) +{ + slider->type(Slider::TICK_BOTH); + slider->set_vertical(); + slider->minimum(-100); + slider->maximum(100); + slider->value(1); + slider->step(1); + slider->align(ALIGN_TOP); +} + +void default_look_b(Slider* balance_slider) +{ + balance_slider->type(1); + balance_slider->minimum(0.00); + balance_slider->maximum(1.00); + balance_slider->step(0.01); + balance_slider->value(0.01); +} + + +// Functions for various control groups - this is mostly copy-paste + +void cb_volume(Slider* o, void *i) +{ + int x = (int) i; + if (x == 1) set_device(mixer_device, SOUND_MIXER_VOLUME, volume_slider, volume_balance); + if (x == 2) set_device(mixer_device, SOUND_MIXER_VOLUME, volume_slider, volume_balance); + if (x == 3) set_mute(mixer_device, SOUND_MIXER_VOLUME, volume_slider, volume_balance, volume_mute); + if (x == 4) set_rec(mixer_device, SOUND_MIXER_VOLUME, volume_rec); +} + +void cb_cd(Slider* o, void *i) { + int x = (int) i; + if (x == 1) set_device(mixer_device, SOUND_MIXER_CD, cd_slider, cd_balance); + if (x == 2) set_device(mixer_device, SOUND_MIXER_CD, cd_slider, cd_balance); + if (x == 3) set_mute(mixer_device, SOUND_MIXER_CD, cd_slider, cd_balance, cd_mute); + if (x == 4) set_rec(mixer_device, SOUND_MIXER_CD, cd_rec); +} + +void cb_pcm(Slider* o, void *i) +{ + int x = (int) i; + if (x == 1) set_device(mixer_device, SOUND_MIXER_PCM, pcm_slider, pcm_balance); + if (x == 2) set_device(mixer_device, SOUND_MIXER_PCM, pcm_slider, pcm_balance); + if (x == 3) set_mute(mixer_device, SOUND_MIXER_PCM, pcm_slider, pcm_balance, pcm_mute); + if (x == 4) set_rec(mixer_device, SOUND_MIXER_PCM, pcm_rec); +} + +void cb_synth(Slider* o, void *i) +{ + int x = (int) i; + if (x == 1) set_device(mixer_device, SOUND_MIXER_SYNTH, synth_slider, synth_balance); + if (x == 2) set_device(mixer_device, SOUND_MIXER_SYNTH, synth_slider, synth_balance); + if (x == 3) set_mute(mixer_device, SOUND_MIXER_SYNTH, synth_slider, synth_balance, synth_mute); + if (x == 4) set_rec(mixer_device, SOUND_MIXER_SYNTH, synth_rec); +} + +void cb_line(Slider* o, void *i) +{ + int x = (int) i; + if (x == 1) set_device(mixer_device, SOUND_MIXER_LINE, line_slider, line_balance); + if (x == 2) set_device(mixer_device, SOUND_MIXER_LINE, line_slider, line_balance); + if (x == 3) set_mute(mixer_device, SOUND_MIXER_LINE, line_slider, line_balance, line_mute); + if (x == 4) set_rec(mixer_device, SOUND_MIXER_LINE, line_rec); +} + +void cb_bass(Slider* o, void *i) +{ + int x = (int) i; + if (x == 1) set_device(mixer_device, SOUND_MIXER_BASS, bass_slider, bass_balance); + if (x == 2) set_device(mixer_device, SOUND_MIXER_BASS, bass_slider, bass_balance); + if (x == 3) set_mute(mixer_device, SOUND_MIXER_BASS, bass_slider, bass_balance, bass_mute); + if (x == 4) set_rec(mixer_device, SOUND_MIXER_BASS, bass_rec); +} + +void cb_treble(Slider* o, void *i) +{ + int x = (int) i; + if (x == 1) set_device(mixer_device, SOUND_MIXER_TREBLE, treble_slider, treble_balance); + if (x == 2) set_device(mixer_device, SOUND_MIXER_TREBLE, treble_slider, treble_balance); + if (x == 3) set_mute(mixer_device, SOUND_MIXER_TREBLE, treble_slider, treble_balance, treble_mute); + if (x == 4) set_rec(mixer_device, SOUND_MIXER_TREBLE, treble_rec); +} + +void cb_mic(Slider* o, void *i) +{ + int x = (int) i; + if (x == 1) set_device(mixer_device, SOUND_MIXER_MIC, mic_slider, mic_balance); + if (x == 2) set_device(mixer_device, SOUND_MIXER_MIC, mic_slider, mic_balance); + if (x == 3) set_mute(mixer_device, SOUND_MIXER_MIC, mic_slider, mic_balance, mic_mute); + if (x == 4) set_rec(mixer_device, SOUND_MIXER_MIC, mic_rec); +} + +void cb_speaker(Slider* o, void *i) +{ + int x = (int) i; + if (x == 1) set_device(mixer_device, SOUND_MIXER_SPEAKER, speaker_slider, speaker_balance); + if (x == 2) set_device(mixer_device, SOUND_MIXER_SPEAKER, speaker_slider, speaker_balance); + if (x == 3) set_mute(mixer_device, SOUND_MIXER_SPEAKER, speaker_slider, speaker_balance, speaker_mute); + if (x == 4) set_rec(mixer_device, SOUND_MIXER_SPEAKER, speaker_rec); +} + +void cb_imix(Slider* o, void *i) +{ + int x = (int) i; + if (x == 1) set_device(mixer_device, SOUND_MIXER_IMIX, imix_slider, imix_balance); + if (x == 2) set_device(mixer_device, SOUND_MIXER_IMIX, imix_slider, imix_balance); + if (x == 3) set_mute(mixer_device, SOUND_MIXER_IMIX, imix_slider, imix_balance, imix_mute); + if (x == 4) set_rec(mixer_device, SOUND_MIXER_IMIX, imix_rec); +} + +void cb_igain(Slider* o, void *i) +{ + int x = (int) i; + if (x == 1) set_device(mixer_device, SOUND_MIXER_IGAIN, igain_slider, igain_balance); + if (x == 2) set_device(mixer_device, SOUND_MIXER_IGAIN, igain_slider, igain_balance); + if (x == 3) set_mute(mixer_device, SOUND_MIXER_IGAIN, igain_slider, igain_balance, igain_mute); + if (x == 4) set_rec(mixer_device, SOUND_MIXER_IGAIN, igain_rec); +} + +void cb_ogain(Slider* o, void *i) +{ + int x = (int) i; + if (x == 1) set_device(mixer_device, SOUND_MIXER_OGAIN, ogain_slider, ogain_balance); + if (x == 2) set_device(mixer_device, SOUND_MIXER_OGAIN, ogain_slider, ogain_balance); + if (x == 3) set_mute(mixer_device, SOUND_MIXER_OGAIN, ogain_slider, ogain_balance, ogain_mute); + if (x == 4) set_rec(mixer_device, SOUND_MIXER_OGAIN, ogain_rec); +} + + +// Menu callback functions + +void cb_Quit(Widget*, void*) +{ + main_window->hide(); +} + +static void cb_About(Item*, void*) { + about_dialog("Volume Control","1.0",""); +} + +void cb_SimpleMode(Widget*, void*) { + if (!simplemode) { + simplemode = true; + synth_slider->hide(); + synth_balance->hide(); + synth_mute->hide(); + synth_rec->hide(); + bass_slider->hide(); + bass_balance->hide(); + bass_mute->hide(); + bass_rec->hide(); + treble_slider->hide(); + treble_balance->hide(); + treble_mute->hide(); + treble_rec->hide(); + mic_slider->hide(); + mic_balance->hide(); + mic_mute->hide(); + mic_rec->hide(); + speaker_slider->hide(); + speaker_balance->hide(); + speaker_mute->hide(); + speaker_rec->hide(); + imix_slider->hide(); + imix_balance->hide(); + imix_mute->hide(); + imix_rec->hide(); + igain_slider->hide(); + igain_balance->hide(); + igain_mute->hide(); + igain_rec->hide(); + ogain_slider->hide(); + ogain_balance->hide(); + ogain_mute->hide(); + ogain_rec->hide(); + main_window->resize(250,205); + } else { + simplemode = false; + synth_slider->show(); + synth_balance->show(); + synth_mute->show(); + synth_rec->show(); + bass_slider->show(); + bass_balance->show(); + bass_mute->show(); + bass_rec->show(); + treble_slider->show(); + treble_balance->show(); + treble_mute->show(); + treble_rec->show(); + mic_slider->show(); + mic_balance->show(); + mic_mute->show(); + mic_rec->show(); + speaker_slider->show(); + speaker_balance->show(); + speaker_mute->show(); + speaker_rec->show(); + imix_slider->show(); + imix_balance->show(); + imix_mute->show(); + imix_rec->show(); + igain_slider->show(); + igain_balance->show(); + igain_mute->show(); + igain_rec->show(); + ogain_slider->show(); + ogain_balance->show(); + ogain_mute->show(); + ogain_rec->show(); + main_window->resize(720,205); + } + globalConfig.set("Sound mixer", "Simplemode", simplemode); +} + + +// Main window design + +int main (int argc, char **argv) +{ +// fl_init_locale_support("evolume", PREFIX"/share/locale"); + + globalConfig.get("Sound mixer", "Device", device, "/dev/mixer", sizeof(device)); + globalConfig.get("Sound mixer", "Simplemode", simplemode, true); + + main_window = new Window(720, 205, _("Volume control")); + if (simplemode) main_window->resize(250,205); + main_window->begin(); + + MenuBar *vc_menubar = new MenuBar(0, 0, 724, 25); + vc_menubar->begin(); + + ItemGroup file(_("&File")); + file.begin(); + Item* pref_item = new Item(_("Preferences")); + pref_item->shortcut(CTRL+'p'); + pref_item->callback(PreferencesDialog); + + Item* quit_item = new Item(_("Quit")); + quit_item->shortcut(CTRL+'q'); + quit_item->callback(cb_Quit); + + file.end(); + + ItemGroup view(_("&View")); + view.begin(); + Item* mode_item = new Item(_("Simple mode")); + mode_item->shortcut(CTRL+'s'); + mode_item->type(Item::TOGGLE); + mode_item->callback(cb_SimpleMode); + if (simplemode) mode_item->set(); + view.end(); + + ItemGroup help(_("&Help")); + help.begin(); + Item* about_item = new Item(_("About")); + about_item->shortcut(CTRL+'a'); + about_item->callback((Callback*)cb_About); + help.end(); + vc_menubar->end(); + + {Divider* o = new Divider(); + o->resize(0, 24, 724, 3); + } + + volume_slider = new Slider(20, 50, 20, 80, "VOL"); + default_look(volume_slider); + volume_balance = new Slider(10, 135, 40, 15, "Balance"); + default_look_b(volume_balance); + volume_mute = new CheckButton(5, 165, 20, 20, "Mute"); + volume_mute->align(ALIGN_BOTTOM); + volume_rec = new CheckButton(35, 165, 20, 20, "Rec"); + volume_rec->align(ALIGN_BOTTOM); + + cd_slider = new Slider(80, 50, 20, 80, "CD"); + default_look(cd_slider); + cd_balance = new Slider(70, 135, 40, 15, "Balance"); + default_look_b(cd_balance); + cd_mute = new CheckButton(65, 165, 20, 20, "Mute"); + cd_mute->align(ALIGN_BOTTOM); + cd_rec = new CheckButton(95, 165, 20, 20, "Rec"); + cd_rec->align(ALIGN_BOTTOM); + + pcm_slider = new Slider(140, 50, 20, 80, "PCM"); + default_look(pcm_slider); + pcm_balance = new Slider(130, 135, 40, 15, "Balance"); + default_look_b(pcm_balance); + pcm_mute = new CheckButton(125, 165, 20, 20, "Mute"); + pcm_mute->align(ALIGN_BOTTOM); + pcm_rec = new CheckButton(155, 165, 20, 20, "Rec"); + pcm_rec->align(ALIGN_BOTTOM); + + line_slider = new Slider(200, 50, 20, 80, "LINE"); + default_look(line_slider); + line_balance = new Slider(190, 135, 40, 15, "Balance"); + default_look_b(line_balance); + line_mute = new CheckButton(185, 165, 20, 20, "Mute"); + line_mute->align(ALIGN_BOTTOM); + line_rec = new CheckButton(215, 165, 20, 20, "Rec"); + line_rec->align(ALIGN_BOTTOM); + + synth_slider = new Slider(260, 50, 20, 80, "SYNTH"); + default_look(synth_slider); + synth_balance = new Slider(250, 135, 40, 15, "Balance"); + default_look_b(synth_balance); + synth_mute = new CheckButton(245, 165, 20, 20, "Mute"); + synth_mute->align(ALIGN_BOTTOM); + synth_rec = new CheckButton(275, 165, 20, 20, "Rec"); + synth_rec->align(ALIGN_BOTTOM); + + bass_slider = new Slider(320, 50, 20, 80, "BASS"); + default_look(bass_slider); + bass_balance = new Slider(310, 135, 40, 15, "Balance"); + default_look_b(bass_balance); + bass_mute = new CheckButton(305, 165, 20, 20, "Mute"); + bass_mute->align(ALIGN_BOTTOM); + bass_rec = new CheckButton(335, 165, 20, 20, "Rec"); + bass_rec->align(ALIGN_BOTTOM); + + treble_slider = new Slider(380, 50, 20, 80, "TREBLE"); + default_look(treble_slider); + treble_balance = new Slider(370, 135, 40, 15, "Balance"); + default_look_b(treble_balance); + treble_mute = new CheckButton(365, 165, 20, 20, "Mute"); + treble_mute->align(ALIGN_BOTTOM); + treble_rec = new CheckButton(395, 165, 20, 20, "Rec"); + treble_rec->align(ALIGN_BOTTOM); + + mic_slider = new Slider(440, 50, 20, 80, "MIC"); + default_look(mic_slider); + mic_balance = new Slider(430, 135, 40, 15, "Balance"); + default_look_b(mic_balance); + mic_mute = new CheckButton(425, 165, 20, 20, "Mute"); + mic_mute->align(ALIGN_BOTTOM); + mic_rec = new CheckButton(455, 165, 20, 20, "Rec"); + mic_rec->align(ALIGN_BOTTOM); + + speaker_slider = new Slider(500, 50, 20, 80, "SPK"); + default_look(speaker_slider); + speaker_balance = new Slider(490, 135, 40, 15, "Balance"); + default_look_b(speaker_balance); + speaker_mute = new CheckButton(485, 165, 20, 20, "Mute"); + speaker_mute->align(ALIGN_BOTTOM); + speaker_rec = new CheckButton(515, 165, 20, 20, "Rec"); + speaker_rec->align(ALIGN_BOTTOM); + + imix_slider = new Slider(560, 50, 20, 80, "IMIX"); + default_look(imix_slider); + imix_balance = new Slider(550, 135, 40, 15, "Balance"); + default_look_b(imix_balance); + imix_mute = new CheckButton(545, 165, 20, 20, "Mute"); + imix_mute->align(ALIGN_BOTTOM); + imix_rec = new CheckButton(575, 165, 20, 20, "Rec"); + imix_rec->align(ALIGN_BOTTOM); + + igain_slider = new Slider(620, 50, 20, 80, "IGAIN"); + default_look(igain_slider); + igain_balance = new Slider(610, 135, 40, 15, "Balance"); + default_look_b(igain_balance); + igain_mute = new CheckButton(605, 165, 20, 20, "Mute"); + igain_mute->align(ALIGN_BOTTOM); + igain_rec = new CheckButton(635, 165, 20, 20, "Rec"); + igain_rec->align(ALIGN_BOTTOM); + + ogain_slider = new Slider(680, 50, 20, 80, "OGAIN"); + default_look(ogain_slider); + ogain_balance = new Slider(670, 135, 40, 15, "Balance"); + default_look_b(ogain_balance); + ogain_mute = new CheckButton(665, 165, 20, 20, "Mute"); + ogain_mute->align(ALIGN_BOTTOM); + ogain_rec = new CheckButton(695, 165, 20, 20, "Rec"); + ogain_rec->align(ALIGN_BOTTOM); + + mixer_device = open(device, O_RDWR); + + if (mixer_device == -1) + { + alert(_("Opening mixer device %s failed. Setup correct device in configuration dialog."), device); + volume_slider->deactivate(); cd_slider->deactivate(); + pcm_slider->deactivate(); synth_slider->deactivate(); + line_slider->deactivate(); bass_slider->deactivate(); + treble_slider->deactivate(); mic_slider->deactivate(); + speaker_slider->deactivate(); imix_slider->deactivate(); + igain_slider->deactivate(); ogain_slider->deactivate(); + } + + update_info(); + + volume_slider->callback( (Callback*) cb_volume, (void*) 1 ); + volume_balance->callback( (Callback*) cb_volume,(void *) 2 ); + volume_mute->callback( (Callback*) cb_volume,(void *) 3 ); + volume_rec->callback( (Callback*) cb_volume,(void *) 4 ); + get_device_info(mixer_device, volume_slider, volume_balance, volume_rec, SOUND_MIXER_VOLUME); + + cd_slider->callback( (Callback*) cb_cd, (void *) 1 ); + cd_balance->callback( (Callback*) cb_cd,(void *) 2 ); + cd_mute->callback( (Callback*) cb_cd,(void *) 3 ); + cd_rec->callback( (Callback*) cb_cd,(void *) 4 ); + get_device_info(mixer_device, cd_slider, cd_balance, cd_rec, SOUND_MIXER_CD); + + pcm_slider->callback( (Callback*) cb_pcm, (void *) 1 ); + pcm_balance->callback( (Callback*) cb_pcm,(void *) 2 ); + pcm_mute->callback( (Callback*) cb_pcm,(void *) 3 ); + pcm_rec->callback( (Callback*) cb_pcm,(void *) 4 ); + get_device_info(mixer_device, pcm_slider, pcm_balance, pcm_rec, SOUND_MIXER_PCM); + + synth_slider->callback( (Callback*) cb_synth, (void *) 1 ); + synth_balance->callback( (Callback*) cb_synth,(void *) 2 ); + synth_mute->callback( (Callback*) cb_synth,(void *) 3 ); + synth_rec->callback( (Callback*) cb_synth,(void *) 4 ); + get_device_info(mixer_device, synth_slider, synth_balance, synth_rec, SOUND_MIXER_SYNTH); + + line_slider->callback( (Callback*) cb_line, (void *) 1 ); + line_balance->callback( (Callback*) cb_line,(void *) 2 ); + line_mute->callback( (Callback*) cb_line,(void *) 3 ); + line_rec->callback( (Callback*) cb_line,(void *) 4 ); + get_device_info(mixer_device, line_slider, line_balance, line_rec, SOUND_MIXER_LINE); + + bass_slider->callback( (Callback*) cb_bass, (void *) 1 ); + bass_balance->callback( (Callback*) cb_bass,(void *) 2 ); + bass_mute->callback( (Callback*) cb_bass,(void *) 3 ); + bass_rec->callback( (Callback*) cb_bass,(void *) 4 ); + get_device_info(mixer_device, bass_slider, bass_balance, bass_rec, SOUND_MIXER_BASS); + + treble_slider->callback( (Callback*) cb_treble, (void *) 1 ); + treble_balance->callback( (Callback*) cb_treble,(void *) 2 ); + treble_mute->callback( (Callback*) cb_treble,(void *) 3 ); + treble_rec->callback( (Callback*) cb_treble,(void *) 4 ); + get_device_info(mixer_device, treble_slider, treble_balance, treble_rec, SOUND_MIXER_TREBLE); + + mic_slider->callback( (Callback*) cb_mic, (void *) 1 ); + mic_balance->callback( (Callback*) cb_mic,(void *) 2 ); + mic_mute->callback( (Callback*) cb_mic,(void *) 3 ); + mic_rec->callback( (Callback*) cb_mic,(void *) 4 ); + get_device_info(mixer_device, mic_slider, mic_balance, mic_rec, SOUND_MIXER_MIC); + + speaker_slider->callback( (Callback*) cb_speaker, (void *) 1 ); + speaker_balance->callback( (Callback*) cb_speaker,(void *) 2 ); + speaker_mute->callback( (Callback*) cb_speaker,(void *) 3 ); + speaker_rec->callback( (Callback*) cb_speaker,(void *) 4 ); + get_device_info(mixer_device, speaker_slider, speaker_balance, speaker_rec, SOUND_MIXER_SPEAKER); + + imix_slider->callback( (Callback*) cb_imix, (void *) 1 ); + imix_balance->callback( (Callback*) cb_imix,(void *) 2 ); + imix_mute->callback( (Callback*) cb_imix,(void *) 3 ); + imix_rec->callback( (Callback*) cb_imix,(void *) 4 ); + get_device_info(mixer_device, imix_slider, imix_balance, imix_rec, SOUND_MIXER_IMIX); + + igain_slider->callback( (Callback*) cb_igain, (void *) 1 ); + igain_balance->callback( (Callback*) cb_igain,(void *) 2 ); + igain_mute->callback( (Callback*) cb_igain,(void *) 3 ); + igain_rec->callback( (Callback*) cb_igain,(void *) 4 ); + get_device_info(mixer_device, igain_slider, igain_balance, igain_rec, SOUND_MIXER_IGAIN); + + ogain_slider->callback( (Callback*) cb_ogain, (void *) 1 ); + ogain_balance->callback( (Callback*) cb_ogain,(void *) 2 ); + ogain_mute->callback( (Callback*) cb_ogain,(void *) 3 ); + ogain_rec->callback( (Callback*) cb_ogain,(void *) 4 ); + get_device_info(mixer_device, ogain_slider, ogain_balance, ogain_rec, SOUND_MIXER_OGAIN); + + main_window->end(); + main_window->show(argc, argv); + + simplemode = !simplemode; // cb_SimpleMode inverts meaning + cb_SimpleMode(0,0); + + return run(); +} + diff --git a/evolume/evolume.h b/evolume/evolume.h new file mode 100644 index 0000000..0fb4b09 --- /dev/null +++ b/evolume/evolume.h @@ -0,0 +1,93 @@ +/* + * $Id$ + * + * Volume control application + * Part of Equinox Desktop Environment (EDE). + * Copyright (c) 2000-2006 EDE Authors. + * + * This program is licenced under terms of the + * GNU General Public Licence version 2 or newer. + * See COPYING for details. + */ + +#ifndef EVOLUME_H_ +#define EVOLUME_H_ + +extern "C" { +#include +#include +#include +#include +#include +#include +#include +#include +} + +/*#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "../edelib2/Config.h" +#include "../edelib2/NLS.h" + +typedef struct +volume +{ + unsigned char left; + unsigned char right; + +} volume; + +int mixer_device; + +fltk::Slider *volume_slider, *cd_slider, *pcm_slider, *synth_slider, + *line_slider, *bass_slider, *treble_slider, *mic_slider, + *speaker_slider, *imix_slider, *igain_slider, *ogain_slider; + +fltk::Slider *volume_balance, *cd_balance, *pcm_balance, *synth_balance, + *line_balance, *bass_balance, *treble_balance, *mic_balance, + *speaker_balance, *imix_balance, *igain_balance, *ogain_balance; + +fltk::CheckButton *volume_mute, *cd_mute, *pcm_mute, *synth_mute, + *line_mute, *bass_mute, *treble_mute, *mic_mute, + *speaker_mute, *imix_mute, *igain_mute, *ogain_mute; + +fltk::CheckButton *volume_rec, *cd_rec, *pcm_rec, *synth_rec, + *line_rec, *bass_rec, *treble_rec, *mic_rec, + *speaker_rec, *imix_rec, *igain_rec, *ogain_rec; + +void get_device_info(int mixer_dev, fltk::Slider *sl, fltk::Slider *bal, fltk::CheckButton *ck, int device); +void set_device(int mixer_fd, int device, fltk::Slider *device_sl, fltk::Slider *balance); +void set_mute(int mixer_fd, int device, fltk::Slider *device_sl, fltk::Slider *balance, fltk::CheckButton *check_button); +void set_rec(int mixer_fd, int device, fltk::CheckButton *ck); +void update_info(); + +#endif + diff --git a/evolume/locale/hu.po b/evolume/locale/hu.po new file mode 100644 index 0000000..59ecd8f --- /dev/null +++ b/evolume/locale/hu.po @@ -0,0 +1,66 @@ +msgid "" +msgstr "" +"Project-Id-Version: \n" +"POT-Creation-Date: \n" +"PO-Revision-Date: 2005-02-09 11:23+0100\n" +"Last-Translator: Nemeth Otto \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: evolume.cpp:158 +msgid "Cannot setup device, sorry." +msgstr "Az eszköz beállítása sikertelen." + +#: evolume.cpp:256 +#, c-format +msgid "Volume control: [%s]" +msgstr "Hangerőszabályzó: [%s]" + +#: evolume.cpp:269 +msgid "Volume control" +msgstr "Hangerőszabályzó" + +#: evolume.cpp:274 +msgid "&File" +msgstr "&Fájl" + +#: evolume.cpp:275 +#: prefs.cpp:63 +msgid "Preferencies" +msgstr "Beállítások" + +#: evolume.cpp:279 +msgid "Quit" +msgstr "Kilépés" + +#: evolume.cpp:285 +msgid "&Help" +msgstr "Se&gítség" + +#: evolume.cpp:286 +msgid "About" +msgstr "Magamról" + +#: evolume.cpp:406 +#, c-format +msgid "Opening mixer device %s failed. Setup correct device in configuration dialog." +msgstr "A %s keverő eszköz megnyitása sikertelen. Állítsd be a megfelelő eszközt a beállításoknál!" + +#: prefs.cpp:66 +msgid "Sound device" +msgstr "Keverő eszköz" + +#: prefs.cpp:68 +msgid "Device name:" +msgstr "Eszköz neve:" + +#: prefs.cpp:80 +msgid "&OK" +msgstr "&OK" + +#: prefs.cpp:84 +msgid "&Cancel" +msgstr "Mégs&em" + diff --git a/evolume/locale/id.po b/evolume/locale/id.po new file mode 100644 index 0000000..27d0bb6 --- /dev/null +++ b/evolume/locale/id.po @@ -0,0 +1,101 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR Free Software Foundation, Inc. +# FIRST AUTHOR , YEAR. +# +msgid "" +msgstr "" +"Project-Id-Version: evolume\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2005-02-04 11:54+0100\n" +"PO-Revision-Date: 2002-12-18 14:34+0700\n" +"Last-Translator: Bambang Purnomosidi D. P. \n" +"Language-Team: id \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=iso-8859-2\n" +"Content-Transfer-Encoding: 8bit\n" + +#: evolume.cpp:158 +msgid "Cannot setup device, sorry." +msgstr "Tidak bisa mensetup devais, maaf." + +#: evolume.cpp:256 +#, c-format +msgid "Volume control: [%s]" +msgstr "Pengendali volume: [%s]" + +#: evolume.cpp:269 +msgid "Volume control" +msgstr "Pengendali volume" + +#: evolume.cpp:274 +msgid "&File" +msgstr "&File" + +#: evolume.cpp:275 prefs.cpp:63 +msgid "Preferencies" +msgstr "Preferensi" + +#: evolume.cpp:279 +msgid "Quit" +msgstr "Keluar" + +#: evolume.cpp:285 +msgid "&Help" +msgstr "&Pertolongan" + +#: evolume.cpp:286 +msgid "About" +msgstr "Tentang" + +#: evolume.cpp:406 +#, c-format +msgid "" +"Opening mixer device %s failed. Setup correct device in configuration dialog." +msgstr "" +"Gagal membuka devais mixer %s. Setup devais yang benar pada dialog " +"konfigurasi." + +#: prefs.cpp:66 +msgid "Sound device" +msgstr "Devais suara" + +#: prefs.cpp:68 +msgid "Device name:" +msgstr "Nama devais:" + +#: prefs.cpp:80 +msgid "&OK" +msgstr "&OK" + +#: prefs.cpp:84 +msgid "&Cancel" +msgstr "&Batal" + +#~ msgid "About Volume control" +#~ msgstr "Tentang pengendali volume" + +#~ msgid "&Close" +#~ msgstr "&Tutup" + +#~ msgid "" +#~ "This program is based in part on the work of FLTK project (www.fltk.org). " +#~ "This program is free software, you can redistribute it and/or modify it " +#~ "under the terms of GNU General Public License as published by the Free " +#~ "Software Foundation, either version 2 of the License, or (at your option) " +#~ "any later version. This program 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 General " +#~ "Public License for more details. You should have received a copy of the " +#~ "GNU General Public Licence along with this program; if not, write to the " +#~ "Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA" +#~ msgstr "" +#~ "Program ini berbasis pada hasil pekerjaan proyek FLTK (www.fltk.org). " +#~ "Program ini adalah free software, anda bisa mendistribusikan kembali dan/" +#~ "atau memodifikasinya dengan syarat-syarat yang diatur pada GNU General " +#~ "Public License, versi 2 atau versi yang lebih baru. Program ini " +#~ "didistribusikan dengan harapan akan berguna, tetapi TANPA JAMINAN; bahkan " +#~ "tanpa jaminan daya jual dan tujuan-tujuan tertentu. Lihat GNU General " +#~ "Public License untuk lebih jelasnya. Anda seharusnya telah menerima " +#~ "salinan GNU General Public License bersama dengan program ini; jikat " +#~ "tidak, silahkan minta ke Free Software Foundation, Inc., 675 Mass Ave, " +#~ "Cambridge, MA 02139, USA." diff --git a/evolume/locale/messages.pot b/evolume/locale/messages.pot new file mode 100644 index 0000000..33f6576 --- /dev/null +++ b/evolume/locale/messages.pot @@ -0,0 +1,72 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2005-02-04 11:54+0100\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=CHARSET\n" +"Content-Transfer-Encoding: 8bit\n" + +#: evolume.cpp:158 +msgid "Cannot setup device, sorry." +msgstr "" + +#: evolume.cpp:256 +#, c-format +msgid "Volume control: [%s]" +msgstr "" + +#: evolume.cpp:269 +msgid "Volume control" +msgstr "" + +#: evolume.cpp:274 +msgid "&File" +msgstr "" + +#: evolume.cpp:275 prefs.cpp:63 +msgid "Preferencies" +msgstr "" + +#: evolume.cpp:279 +msgid "Quit" +msgstr "" + +#: evolume.cpp:285 +msgid "&Help" +msgstr "" + +#: evolume.cpp:286 +msgid "About" +msgstr "" + +#: evolume.cpp:406 +#, c-format +msgid "" +"Opening mixer device %s failed. Setup correct device in configuration dialog." +msgstr "" + +#: prefs.cpp:66 +msgid "Sound device" +msgstr "" + +#: prefs.cpp:68 +msgid "Device name:" +msgstr "" + +#: prefs.cpp:80 +msgid "&OK" +msgstr "" + +#: prefs.cpp:84 +msgid "&Cancel" +msgstr "" diff --git a/evolume/locale/ru.po b/evolume/locale/ru.po new file mode 100644 index 0000000..0cfb800 --- /dev/null +++ b/evolume/locale/ru.po @@ -0,0 +1,78 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR Free Software Foundation, Inc. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2005-02-04 11:54+0100\n" +"PO-Revision-Date: 2002-11-28 HO:MI+ZONE\n" +"Last-Translator: aabbvv \n" +"Language-Team: RUSSIAN \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=koi8-r\n" +"Content-Transfer-Encoding: 8bit\n" + +#: evolume.cpp:158 +msgid "Cannot setup device, sorry." +msgstr " , ." + +#: evolume.cpp:256 +#, c-format +msgid "Volume control: [%s]" +msgstr ": [%s]" + +#: evolume.cpp:269 +msgid "Volume control" +msgstr " " + +#: evolume.cpp:274 +msgid "&File" +msgstr "" + +#: evolume.cpp:275 prefs.cpp:63 +msgid "Preferencies" +msgstr "" + +#: evolume.cpp:279 +msgid "Quit" +msgstr "" + +#: evolume.cpp:285 +msgid "&Help" +msgstr "" + +#: evolume.cpp:286 +msgid "About" +msgstr " " + +#: evolume.cpp:406 +#, c-format +msgid "" +"Opening mixer device %s failed. Setup correct device in configuration dialog." +msgstr "" +" %s. ." + +#: prefs.cpp:66 +msgid "Sound device" +msgstr "" + +#: prefs.cpp:68 +msgid "Device name:" +msgstr ":" + +#: prefs.cpp:80 +msgid "&OK" +msgstr "&OK" + +#: prefs.cpp:84 +msgid "&Cancel" +msgstr "" + +#~ msgid "About Volume control" +#~ msgstr " " + +#~ msgid "&Close" +#~ msgstr "" diff --git a/evolume/locale/sk.po b/evolume/locale/sk.po new file mode 100644 index 0000000..56db1e2 --- /dev/null +++ b/evolume/locale/sk.po @@ -0,0 +1,102 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR Free Software Foundation, Inc. +# FIRST AUTHOR , YEAR. +# +msgid "" +msgstr "" +"Project-Id-Version: evolume 1.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2005-02-04 11:54+0100\n" +"PO-Revision-Date: 2002-04-21 14:50+0200\n" +"Last-Translator: Martin Pekar \n" +"Language-Team: Slovak \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: evolume.cpp:158 +msgid "Cannot setup device, sorry." +msgstr "Nemôžem nastaviť zariadenie, ľutujem." + +#: evolume.cpp:256 +#, c-format +msgid "Volume control: [%s]" +msgstr "Ovládanie hlasitosti: [%s]" + +#: evolume.cpp:269 +msgid "Volume control" +msgstr "Ovládanie hlasitosti" + +#: evolume.cpp:274 +msgid "&File" +msgstr "&Súbor" + +#: evolume.cpp:275 prefs.cpp:63 +msgid "Preferencies" +msgstr "Nastavenia" + +#: evolume.cpp:279 +msgid "Quit" +msgstr "Koniec" + +#: evolume.cpp:285 +msgid "&Help" +msgstr "&Nápoveda" + +#: evolume.cpp:286 +msgid "About" +msgstr "O programe" + +#: evolume.cpp:406 +#, c-format +msgid "" +"Opening mixer device %s failed. Setup correct device in configuration dialog." +msgstr "" +"Otvorenie zariadenia mixéra %s zlyhalo. Nastavte správne zariadenie v " +"konfiguračnom dialógu." + +#: prefs.cpp:66 +msgid "Sound device" +msgstr "Zvukové zariadenie" + +#: prefs.cpp:68 +msgid "Device name:" +msgstr "Meno zariadenia:" + +#: prefs.cpp:80 +msgid "&OK" +msgstr "&OK" + +#: prefs.cpp:84 +msgid "&Cancel" +msgstr "&Zrušiť" + +#~ msgid "About Volume control" +#~ msgstr "O Ovládaní hlasitosti" + +#~ msgid "&Close" +#~ msgstr "&Zavrieť" + +#~ msgid "" +#~ "This program is based in part on the work of FLTK project (www.fltk.org). " +#~ "This program is free software, you can redistribute it and/or modify it " +#~ "under the terms of GNU General Public License as published by the Free " +#~ "Software Foundation, either version 2 of the License, or (at your option) " +#~ "any later version. This program 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 General " +#~ "Public License for more details. You should have received a copy of the " +#~ "GNU General Public Licence along with this program; if not, write to the " +#~ "Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA" +#~ msgstr "" +#~ "Tento program je z časti založený na práci projektu FLTK (www.fltk.org)." +#~ "Tento program je voľný softvér, môžete ho redistribuovať a/alebo " +#~ "modifikovať podľa podmienok licencie GNU General Public License " +#~ "publikovanej nadáciou the Free Software Foundation, buď verzie 2 tejto " +#~ "licencie, alebo (podľa vášho uváženia) ľubovoľnej novšej verzie. Tento " +#~ "program je distribuovaný v nádeji, že bude užitočný, ale BEZ AKEJKOĽVEK " +#~ "ZÁRUKY; dokonca bez obsiahnutej záruky OBCHODOVATEĽNOSTI alebo VÝHOD PRE " +#~ "URČITÝ ÚČEL. Ďalšie podrobnosti hľadajte v licencii GNU General Public " +#~ "License. S týmto programom by ste mali dostať kópiu licencie GNU General " +#~ "Public Licence; ak nie, napíšte do nadácie the Free Software Foundation, " +#~ "Inc., 675 Mass Ave, Cambridge, MA 02139, USA." diff --git a/evolume/prefs.cpp b/evolume/prefs.cpp new file mode 100644 index 0000000..5f48c36 --- /dev/null +++ b/evolume/prefs.cpp @@ -0,0 +1,115 @@ +/* + * $Id$ + * + * Volume control application + * Part of Equinox Desktop Environment (EDE). + * Copyright (c) 2000-2006 EDE Authors. + * + * This program is licenced under terms of the + * GNU General Public Licence version 2 or newer. + * See COPYING for details. + */ + +#include "prefs.h" +#include +#include //#include +#include //#include + +#include "../edelib2/NLS.h"//#include +#include "../edelib2/Config.h"//#include + + +using namespace fltk; +using namespace edelib; + + + +extern char device[1024]; +extern int mixer_device; + +void choice_items(char *path) { + Item *new_Item; + dirent **files; + int num_Files = 0; + + num_Files = filename_list(path, &files); + + if (num_Files > 0) { + + for (int i = 0; i < num_Files; i ++) { + if (strcmp(files[i]->d_name, ".") != 0 && + strcmp(files[i]->d_name, "..") != 0) { + + char filename[PATH_MAX]; + snprintf(filename, sizeof(filename)-1, "%s/%s", path, files[i]->d_name); + + struct stat s; + if (!stat(filename, &s)==0) break; + + if (!S_ISDIR(s.st_mode) && strncmp(files[i]->d_name, "mixer", 5)==0) { + new_Item = new Item(); + new_Item->copy_label(filename); + } + } + free(files[i]); + } + free(files); + } +} + +Window* preferencesWindow; + +InputBrowser* deviceNameInput; + +static void cb_OK(Button*, void*) { + Config globalConfig("EDE Team", "evolume"); + globalConfig.set("Sound mixer", "Device", deviceNameInput->value()); + snprintf(device, sizeof(device)-1, "%s", (char*)deviceNameInput->value()); + + mixer_device = open(device, O_RDWR); + update_info(); + + preferencesWindow->hide(); +} + +static void cb_Cancel(Button*, void*) { + preferencesWindow->hide(); +} + +void PreferencesDialog(Widget *, void *) { + Window* w; + {Window* o = preferencesWindow = new Window(265, 290, _("Preferences")); + w = o; + preferencesWindow->begin(); + {TabGroup* o = new TabGroup(10, 10, 245, 240); + o->begin(); + {Group* o = new Group(0, 25, 255, 215, _("Sound device")); + o->align(ALIGN_TOP | ALIGN_LEFT); + o->begin(); + {InputBrowser* o = deviceNameInput = new InputBrowser(10, 30, 155, 25, _("Device name:")); + o->begin(); + o->align(ALIGN_TOP | ALIGN_LEFT); + + o->text(device); + choice_items("/dev"); + choice_items("/dev/sound"); + o->end(); + } + o->end(); + } + o->end(); + o->selection_color(o->color()); + o->selection_textcolor(o->textcolor()); + } + {Button* o = new Button(65, 255, 90, 25, _("&OK")); + o->callback((Callback*)cb_OK); + } + {Button* o = new Button(165, 255, 90, 25, _("&Cancel")); + o->callback((Callback*)cb_Cancel); + } + o->end(); + } + preferencesWindow->end(); + preferencesWindow->set_modal(); + preferencesWindow->show(); +} diff --git a/evolume/prefs.fld b/evolume/prefs.fld new file mode 100644 index 0000000..0d46e4e --- /dev/null +++ b/evolume/prefs.fld @@ -0,0 +1,132 @@ +# data file for the FLTK User Interface Designer (FLUID) +version 2,0003 +images_dir ./ +i18n +header_name {.h} +code_name {.cpp} +gridx 5 +gridy 5 +snap 3 +decl {// Volume control for EDE is (C) Copyright 2000-2002 by Martin Pekar, this program is provided under the terms of GNU GPL v.2, see file COPYING for more information.} {} + +decl {\#include } {} + +decl {\#include } {selected +} + +decl {\#include } {} + +decl {\#include } {} + +decl {\#include } {} + +decl {extern char device[1024];} {} + +decl {extern int mixer_device;} {} + +Function {choice_items(char *path)} {return_type void +} { + code {Fl_Item *new_Item; + dirent **files; + int num_Files = 0; + + num_Files = fl_filename_list(path, &files); + + if (num_Files > 0) { + + for (int i = 0; i < num_Files; i ++) { + if (strcmp(files[i]->d_name, ".") != 0 && + strcmp(files[i]->d_name, "..") != 0) { + + char filename[FL_PATH_MAX]; + snprintf(filename, sizeof(filename)-1, "%s/%s", path, files[i]->d_name); + + if (!fl_is_dir(filename) && fl_file_match(files[i]->d_name, "mixer*")) { + new_Item = new Fl_Item(); + new_Item->copy_label(filename); + } + } + free(files[i]); + } + free(files); + }} {} +} + +Function {PreferencesDialog(Fl_Widget *, void *)} {return_type void +} { + Fl_Window preferenciesWindow { + label Preferencies open + xywh {249 86 265 289} hide + } { + Fl_Tabs {} {open + xywh {5 5 255 245} + } { + Fl_Group {} { + label {Sound device} open + private xywh {0 23 255 221} align 5 + } { + Fl_Input_Browser deviceNameInput { + label {Device name:} open + xywh {90 27 155 23} align 132 + extra_code {\#include + +o->value(device); +choice_items("/dev"); +choice_items("/dev/sound");} + class Fl_Input_Browser + } {} + } + } + Fl_Button {} { + label {&OK} + callback {Fl_Config globalConfig("EDE Team", "evolume"); +globalConfig.set("Sound mixer", "Device", deviceNameInput->value()); +snprintf(device, sizeof(device)-1, "%s", (char*)deviceNameInput->value()); + +mixer_device = open(device, O_RDWR); +update_info(); + +preferenciesWindow->hide();} + private xywh {95 260 80 25} + extra_code {\#include + +extern void update_info();} + } + Fl_Button {} { + label {&Cancel} + callback {preferenciesWindow->hide();} + private xywh {180 260 80 25} + } + } + code {preferenciesWindow->end(); +preferenciesWindow->show();} {} +} + +Function {AboutDialog(Fl_Widget *, void *)} {return_type void +} { + Fl_Window aboutWindow { + label {About Volume control} open + xywh {270 82 285 301} hide + } { + Fl_Button {} { + label {&Close} + callback {aboutWindow->hide();} + private xywh {110 270 80 25} + } + Fl_Box {} { + label {Volume control for Equinox Desktop Environment v. 1.0} + private xywh {5 5 275 45} align 145 label_size 18 + } + Fl_Box {} { + label {This program is based in part on the work of FLTK project (www.fltk.org). This program is free software, you can redistribute it and/or modify it under the terms of GNU General Public License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any later version. This program 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 General Public License for more details. You should have received a copy of the GNU General Public Licence along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA} + xywh {5 75 275 185} align 145 label_size 10 + extra_code {;} + } + Fl_Box {} { + label {(C) Copyright 2000-2002 by Martin Pekar} + xywh {5 50 275 25} + } + } + code {aboutWindow->end(); +aboutWindow->show();} {} +} diff --git a/evolume/prefs.h b/evolume/prefs.h new file mode 100644 index 0000000..570f4e1 --- /dev/null +++ b/evolume/prefs.h @@ -0,0 +1,28 @@ +/* + * $Id$ + * + * Volume control application + * Part of Equinox Desktop Environment (EDE). + * Copyright (c) 2000-2006 EDE Authors. + * + * This program is licenced under terms of the + * GNU General Public Licence version 2 or newer. + * See COPYING for details. + */ + +#ifndef prefs_h +#define prefs_h +//#include +#include "../edelib2/NLS.h" //#include +void choice_items(char *path); +#include //#include +extern fltk::Window* preferencesWindow; +#include //#include +#include //#include +#include //#include +extern fltk::InputBrowser* deviceNameInput; +#include //#include +#include +extern void update_info(); +void PreferencesDialog(fltk::Widget *, void *); +#endif diff --git a/ewmconf/Jamfile b/ewmconf/Jamfile new file mode 100644 index 0000000..062b1fd --- /dev/null +++ b/ewmconf/Jamfile @@ -0,0 +1,16 @@ +# +# $Id$ +# +# Part of Equinox Desktop Environment (EDE). +# Copyright (c) 2000-2007 EDE Authors. +# +# This program is licenced under terms of the +# GNU General Public Licence version 2 or newer. +# See COPYING for details. + +SubDir TOP ewmconf ; + +SOURCE = ewm.cpp ewmconf.cpp ; + +MakeProgram ewmconf : $(SOURCE) ; +ExtractStrings locale : $(SOURCE) ; diff --git a/ewmconf/Makefile b/ewmconf/Makefile new file mode 100644 index 0000000..1b246a8 --- /dev/null +++ b/ewmconf/Makefile @@ -0,0 +1,22 @@ + +CPPFILES = ../edelib2/Util.cpp ../edelib2/Config.cpp ewm.cpp ewmconf.cpp +TARGET = ewmconf + +POFILES = locale/ru.po\ + locale/sr.po\ + locale/sk.po\ + locale/hu.po\ + +include ../makeinclude + +install: + $(INSTALL_PROGRAM) $(TARGET) $(bindir) + $(INSTALL_LOCALE) + +uninstall: + $(RM) $(bindir)/$(TARGET) + +clean: + $(RM) $(TARGET) + $(RM) *.o + diff --git a/ewmconf/ewm.cpp b/ewmconf/ewm.cpp new file mode 100644 index 0000000..bd91be1 --- /dev/null +++ b/ewmconf/ewm.cpp @@ -0,0 +1,131 @@ +/* + * $Id$ + * + * edewm (EDE Window Manager) settings + * Part of Equinox Desktop Environment (EDE). + * Copyright (c) 2000-2006 EDE Authors. + * + * This program is licenced under terms of the + * GNU General Public Licence version 2 or newer. + * See COPYING for details. + */ + +#include "ewm.h" + +#include +#include + +#include +#include +#include +#include + +#include "../edelib2/Config.h" + + +using namespace fltk; +using namespace edelib; + + + + +Color title_active_color, title_active_color_text; +Color title_normal_color, title_normal_color_text; + +int title_height; +int title_align; + +bool opaque_resize; +int title_draw_grad; + +bool animate; +int animate_speed; + +bool use_frame; +Color theme_frame_color; +bool use_theme; +char* theme_path; + +static void sendClientMessage(XWindow w, Atom a, long x) +{ + XEvent ev; + long mask; + + memset(&ev, 0, sizeof(ev)); + ev.xclient.type = ClientMessage; + ev.xclient.window = w; + ev.xclient.message_type = a; + ev.xclient.format = 32; + ev.xclient.data.l[0] = x; + ev.xclient.data.l[1] = CurrentTime; + mask = 0L; + if (w == RootWindow(xdisplay, xscreen)) + mask = SubstructureRedirectMask; + XSendEvent(xdisplay, w, False, mask, &ev); +} + +void applyConfiguration() +{ + extern Atom FLTKChangeSettings; +// sendClientMessage(RootWindow(xdisplay, xscreen), FLTKChangeSettings, 0); + XFlush(xdisplay); +} + +void readConfiguration() +{ + Config wmconf(Config::find_file("wmanager.conf", 0)); + + wmconf.set_section("TitleBar"); + wmconf.read("Active color", title_active_color, color(0,0,128)); + wmconf.read("Active color text", title_active_color_text, color(255,255,255)); + wmconf.read("Normal color", title_normal_color, color(0,0,130)); + wmconf.read("Normal color text", title_normal_color_text, color(255,255,255)); + + wmconf.read("Box type", title_draw_grad, 0); + wmconf.read("Height", title_height, 20); + wmconf.read("Text align", title_align, 0); + + wmconf.set_section("Resize"); + wmconf.read("Opaque resize", opaque_resize, false); + wmconf.read("Animate", animate, true); + wmconf.read("Animate Speed", animate_speed, 14); + + wmconf.set_section("Misc"); + wmconf.read("Use frame", use_frame, false); + wmconf.read("Frame color", theme_frame_color, color(0,0,128)); + wmconf.read("Use theme", use_theme, false); + wmconf.read("Theme path", theme_path, 0); +} + +void writeConfiguration() +{ + if(title_height > 50) title_height=50; + else if(title_height < 10) title_height=10; + + Config wmconf(Config::find_file("wmanager.conf", 1)); + + wmconf.set_section("TitleBar"); + wmconf.write("Active color", title_active_color); + wmconf.write("Active color text", title_active_color_text); + wmconf.write("Normal color", title_normal_color); + wmconf.write("Normal color text", title_normal_color_text); + + wmconf.write("Box type", title_draw_grad); + wmconf.write("Height", title_height); + wmconf.write("Text align", title_align); + + wmconf.set_section("Resize"); + wmconf.write("Opaque resize", opaque_resize); + wmconf.write("Animate", animate); + wmconf.write("Animate Speed", animate_speed); + + wmconf.set_section("Misc"); + wmconf.write("Use frame", use_frame); + wmconf.write("Frame color", theme_frame_color); + wmconf.write("Use theme", use_theme); + if (use_theme) + wmconf.write("Theme path", theme_path); + else + wmconf.write("Theme path", ""); +} + diff --git a/ewmconf/ewm.h b/ewmconf/ewm.h new file mode 100644 index 0000000..ac3afd2 --- /dev/null +++ b/ewmconf/ewm.h @@ -0,0 +1,37 @@ +/* + * $Id$ + * + * edewm (EDE Window Manager) settings + * Part of Equinox Desktop Environment (EDE). + * Copyright (c) 2000-2006 EDE Authors. + * + * This program is licenced under terms of the + * GNU General Public Licence version 2 or newer. + * See COPYING for details. + */ + +#ifndef ewm_h +#define ewm_h + +#include + + +extern fltk::Color title_active_color, title_active_color_text; +extern fltk::Color title_normal_color, title_normal_color_text; +extern bool opaque_resize; +extern int title_draw_grad; +extern bool animate; +extern int animate_speed; +extern bool use_frame; +extern fltk::Color theme_frame_color; +extern bool use_theme; +extern char* theme_path; +extern int title_height; +extern int title_align; + +void readConfiguration(); +void applyConfiguration(); +void writeConfiguration(); + +#endif + diff --git a/ewmconf/ewmconf.cpp b/ewmconf/ewmconf.cpp new file mode 100644 index 0000000..f6e822c --- /dev/null +++ b/ewmconf/ewmconf.cpp @@ -0,0 +1,351 @@ +/* + * $Id$ + * + * edewm (EDE Window Manager) settings + * Part of Equinox Desktop Environment (EDE). + * Copyright (c) 2000-2006 EDE Authors. + * + * This program is licenced under terms of the + * GNU General Public Licence version 2 or newer. + * See COPYING for details. + */ + +#include "ewmconf.h" +#include "ewm.h" + +#include +#include +#include +#include + +#include +#include + +#include "../edelib2/NLS.h" + +fltk::Button* titlebarLabelColorButton; +fltk::Button* titlebarColorButton; +fltk::Button* titlebarActiveLabelColorButton; +fltk::Button* titlebarActiveColorButton; +fltk::Choice* titlebarDrawGrad; +fltk::CheckButton* useThemeButton; +fltk::Input* themePathInput; +fltk::Button* browse_btn; +fltk::CheckButton* animateButton; +fltk::ValueSlider* animateSlider; +fltk::CheckButton* opaqueResize; + +fltk::Button* applyButton; + +bool conf_changed = false; + + +// Functions called by callbacks + +void changeBoxColor(fltk::Button *box) { + fltk::Button *colorBox = box; + fltk::Color oldColor = colorBox->color(); + fltk::Color defColor = oldColor; + fltk::color_chooser("Choose color", defColor); + if ( defColor != oldColor ) { + colorBox->color(defColor); + colorBox->redraw(); + } +} + +void confChanged() { + if (conf_changed) return; + conf_changed=true; + applyButton->activate(); +} + + +// Callback functions + +static void cb_Text(fltk::Choice* o, void*) { + title_align = (int)o->value(); + confChanged(); +} + +static void cb_Height(fltk::ValueInput* o, void*) { + title_height = (int)o->value(); + confChanged(); +} + +static void cb_titlebarLabelColorButton(fltk::Button*, void*) { + changeBoxColor(titlebarLabelColorButton); + title_normal_color_text = (int) titlebarLabelColorButton->color(); + confChanged(); +} + +static void cb_titlebarColorButton(fltk::Button*, void*) { + changeBoxColor(titlebarColorButton); + title_normal_color = (int) titlebarColorButton->color(); + confChanged(); +} + +static void cb_titlebarActiveLabelColorButton(fltk::Button*, void*) { + changeBoxColor(titlebarActiveLabelColorButton); + title_active_color_text = (int) titlebarActiveLabelColorButton->color(); + confChanged(); +} + +static void cb_titlebarActiveColorButton(fltk::Button*, void*) { + changeBoxColor(titlebarActiveColorButton); + title_active_color = (int) titlebarActiveColorButton->color(); + confChanged(); +} + +static void cb_titlebarDrawGrad(fltk::Choice*, void*) { + title_draw_grad = titlebarDrawGrad->value(); + confChanged(); +} + +static void cb_useThemeButton(fltk::CheckButton*, void*) { + if (useThemeButton->value()) { + themePathInput->activate(); + browse_btn->activate(); + titlebarDrawGrad->deactivate(); + titlebarColorButton->deactivate(); + titlebarActiveColorButton->deactivate(); + } else { + themePathInput->deactivate(); + browse_btn->deactivate(); + titlebarDrawGrad->activate(); + titlebarColorButton->activate(); + titlebarActiveColorButton->activate(); + } + + use_theme = useThemeButton->value(); + confChanged(); +} + +static void cb_themePathInput(fltk::Input*, void*) { + theme_path = (char*)realloc(theme_path, strlen(themePathInput->value())); + strcpy(theme_path, themePathInput->value()); + confChanged(); +} + +static void cb_browse_btn(fltk::Button*, void*) { + char *file_types = _("Themes (*.theme), *.theme, All files (*.*), *"); + const char *fileName = fltk::file_chooser( "Themes...", file_types, themePathInput->value()); + if (fileName) { + themePathInput->value(fileName); + strncpy(theme_path, fileName, strlen(fileName)); + } + confChanged(); +} + +static void cb_animateButton(fltk::CheckButton*, void*) { + if (animateButton->value()) + animateSlider->activate(); + else + animateSlider->deactivate(); + animate = animateButton->value(); + confChanged(); +} + +static void cb_animateSlider(fltk::ValueSlider*, void*) { + animate_speed = (int)animateSlider->value(); + confChanged(); +} + +static void cb_opaqueResize(fltk::CheckButton*, void*) { + opaque_resize = opaqueResize->value(); + confChanged(); +} + +/*static void cb_OK(fltk::Button*, void*) { + writeConfiguration(); + applyConfiguration(); + exit(0); +}*/ + +static void cb_Apply(fltk::Button*, void*) { + writeConfiguration(); + applyConfiguration(); + conf_changed = false; + applyButton->deactivate(); +} + +static void cb_Close(fltk::Button*, void*) { + if (conf_changed) { + int answer = fltk::choice_alert(_("You have unsaved changes in this window!\nDo you want to close it anyway?"), 0, _("Go &Back"), _("&Discard Changes")); + if (answer == 1) return; + } + exit(0); +} + + +// Main window design + +int main (int argc, char **argv) { + + fltk::Window* w; + //fl_init_locale_support("ewmconf", PREFIX"/share/locale"); + readConfiguration(); + {fltk::Window* o = new fltk::Window(325, 385, _("Window manager settings")); + w = o; + o->set_vertical(); + o->begin(); + {fltk::TabGroup* o = new fltk::TabGroup(10, 10, 305, 330); + o->selection_color(o->color()); + o->selection_textcolor(o->textcolor()); + o->box(fltk::THIN_UP_BOX); + o->begin(); + {fltk::Group* o = new fltk::Group(0, 25, 305, 305, _("&Titlebar")); + o->align(fltk::ALIGN_TOP|fltk::ALIGN_LEFT); + o->begin(); + {fltk::Choice* o = new fltk::Choice(35, 30, 125, 25, _("Text align:")); + o->callback((fltk::Callback*)cb_Text); + o->align(fltk::ALIGN_TOP|fltk::ALIGN_LEFT); + o->begin(); + new fltk::Item(_("Left")); + new fltk::Item(_("Right")); + new fltk::Item(_("Center")); + o->end(); + o->value(title_align); + o->tooltip(_("Where will window title be placed on the title bar?")); + } + {fltk::ValueInput* o = new fltk::ValueInput(205, 30, 60, 25, _("Height:")); + o->align(fltk::ALIGN_TOP|fltk::ALIGN_LEFT); + o->minimum(10); + o->maximum(50); + o->step(1); + o->value(20); + o->callback((fltk::Callback*)cb_Height); + o->value(title_height); + o->tooltip(_("Height of titlebar (in pixels)")); + } + {fltk::Button* o = titlebarLabelColorButton = new fltk::Button(205, 75, 60, 20, _("Label color: ")); + o->callback((fltk::Callback*)cb_titlebarLabelColorButton); + o->align(fltk::ALIGN_LEFT); + o->color((fltk::Color)title_normal_color_text); + o->tooltip(_("Text color of window title")); + } + {fltk::Button* o = titlebarActiveLabelColorButton = new fltk::Button(205, 105, 60, 20, _("Active label color: ")); + o->callback((fltk::Callback*)cb_titlebarActiveLabelColorButton); + o->align(fltk::ALIGN_LEFT); + o->color((fltk::Color) title_active_color_text); + o->tooltip(_("Title text color of active (foremost) window")); + } + {fltk::Button* o = titlebarColorButton = new fltk::Button(205, 135, 60, 20, _("Titlebar color: ")); + o->callback((fltk::Callback*)cb_titlebarColorButton); + o->align(fltk::ALIGN_LEFT); + o->color((fltk::Color) title_normal_color); + o->tooltip(_("Color of title bar")); + } + {fltk::Button* o = titlebarActiveColorButton = new fltk::Button(205, 165, 60, 20, _("Active titlebar color: ")); + o->callback((fltk::Callback*)cb_titlebarActiveColorButton); + o->align(fltk::ALIGN_LEFT); + o->color((fltk::Color)title_active_color); + o->tooltip(_("Titlebar color of active (foremost) window")); + } + {fltk::Choice* o = titlebarDrawGrad = new fltk::Choice(120, 200, 145, 25, _("Effect type:")); + o->callback((fltk::Callback*)cb_titlebarDrawGrad); + o->align(fltk::ALIGN_LEFT|fltk::ALIGN_WRAP); + o->begin(); + new fltk::Item(_("Flat")); + new fltk::Item(_("Horizontal shade")); + new fltk::Item(_("Thin down")); + new fltk::Item(_("Up box")); + new fltk::Item(_("Down box")); + new fltk::Item(_("Plastic")); + o->end(); + o->value(title_draw_grad); + o->tooltip(_("Effect that will be used when drawing titlebar")); + } + {fltk::Divider* o = new fltk::Divider(); + o->resize(10,235,285,2); + {fltk::CheckButton* o = useThemeButton = new fltk::CheckButton(10, 245, 300, 25, _("&Use theme")); + o->callback((fltk::Callback*)cb_useThemeButton); + o->value(use_theme); + o->tooltip(_("Choose titlebar theme below (some options will be disabled)")); + } + {fltk::Input* o = themePathInput = new fltk::Input(65, 270, 195, 25, _("Path:")); + o->callback((fltk::Callback*)cb_themePathInput); + o->deactivate(); + themePathInput->value(theme_path); + o->tooltip(_("Enter filename for file where theme is stored")); + } + {fltk::Button* o = browse_btn = new fltk::Button(270, 270, 25, 25, "..."); + o->callback((fltk::Callback*)cb_browse_btn); + o->deactivate(); + o->tooltip(_("Click here to choose theme")); + } +// {fltk::Divider* o = new fltk::Divider(); +// o->resize(10,100,300,2); +// } + } + o->end(); + } + {fltk::Group* o = new fltk::Group(0, 25, 305, 305, "&Resizing"); + o->align(fltk::ALIGN_TOP|fltk::ALIGN_LEFT); + o->hide(); + o->begin(); + {fltk::CheckButton* o = animateButton = new fltk::CheckButton(10, 15, 295, 25, _("Animate size changes")); + o->set(); + o->callback((fltk::Callback*)cb_animateButton); + o->value(animate); + o->tooltip(_("If you enable this option, maximize/minimize operations will be animated")); + } + {fltk::ValueSlider* o = animateSlider = new fltk::ValueSlider(70, 40, 225, 25, _("Speed:")); + o->type(fltk::ValueSlider::TICK_ABOVE); + o->box(fltk::DOWN_BOX); + o->textsize(10); + o->minimum(5); + o->maximum(20); + o->step(1); + o->value(14); + o->slider_size(8); + o->callback((fltk::Callback*)cb_animateSlider); + o->align(fltk::ALIGN_LEFT); + o->value(animate_speed); + if(animate) o->activate(); else o->deactivate(); + o->tooltip(_("Set speed for animation when maximizing / minimizing windows")); + } + {fltk::Divider* o = new fltk::Divider(); + o->resize(10,75,285,2); + } + {fltk::CheckButton* o = opaqueResize = new fltk::CheckButton(10, 85, 285, 25, "Show window content while resizing"); + o->callback((fltk::Callback*)cb_opaqueResize); + o->value(opaque_resize); + o->tooltip(_("Enable if you want contents of windows to be redrawn as you resize window")); + } + o->end(); + } + o->end(); + } +// {fltk::Button* o = new fltk::Button(67, 337, 80, 25, "&OK"); +// o->shortcut(0xff0d); +// o->callback((fltk::Callback*)cb_OK); +// } + {fltk::Button* o = applyButton = new fltk::Button(125, 350, 90, 25, _("&Apply")); + o->callback((fltk::Callback*)cb_Apply); + o->tooltip(_("Apply changes")); + } + {fltk::Button* o = new fltk::Button(225, 350, 90, 25, _("&Close")); + o->shortcut(0xff1b); + o->callback((fltk::Callback*)cb_Close); + o->tooltip(_("Close this window")); + } + o->end(); + } + + // Make sure that "Use theme" is active and standalone buttons inactive + // if theme is set - and vice versa + if (!theme_path || strlen(theme_path) < 2) // possibly just 1 space + useThemeButton->value(false); + else + useThemeButton->value(true); + cb_useThemeButton(useThemeButton, 0); + + // above will activate Apply button, so we need to change it back + applyButton->deactivate(); + conf_changed=false; + + //useThemeButton->do_callback(FL_DIALOG_BTN); + w->show(argc, argv); + return fltk::run(); +} + diff --git a/ewmconf/ewmconf.fl b/ewmconf/ewmconf.fl new file mode 100644 index 0000000..4f61bd4 --- /dev/null +++ b/ewmconf/ewmconf.fl @@ -0,0 +1,220 @@ +# data file for the FLTK User Interface Designer (FLUID) +version 2.0100 +images_dir ./ +header_name {.h} +code_name {.cpp} +gridx 5 +gridy 5 +snap 3 +decl {// Window manager settings for EDE is (C) Copyright 2001-2002 by Martin Pekar, this program is provided under the terms of GNU GPL v.2, see file COPYING for more information.} {} + +decl {\#include "ewm.h"} {} + +decl {\#include } {} + +Function {} {open +} { + code {//fl_init_locale_support("ewmconf", PREFIX"/share/locale"); +readConfiguration();} {} + {fltk::Window} {} { + label {Window manager settings} open + xywh {348 192 325 370} visible + } { + {fltk::TabGroup} {} {open + xywh {0 5 330 320} color 16 + } { + {fltk::Group} {} { + label {&Titlebar} open + private xywh {0 20 325 300} align 5 + } { + {fltk::Choice} {} { + label {Text align:} + callback {title_align = (int)o->value();} open + xywh {82 23 105 22} + extra_code {o->value(title_align);} + } { + {fltk::Item} {} { + label Left + } + {fltk::Item} {} { + label Right + } + {fltk::Item} {} { + label Center + } + } + {fltk::ValueInput} {} { + label {Height:} + callback {title_height = (int)o->value();} + xywh {242 23 60 22} minimum 10 maximum 50 step 1 value 20 + extra_code {o->value(title_height);} + } + {fltk::Button} titlebarLabelColorButton { + label {Titlebar label color: } + callback {changeBoxColor(titlebarLabelColorButton); +title_normal_color_text = (int) titlebarLabelColorButton->color();} + xywh {84 65 60 20} align 132 + extra_code {o->color((fltk::Color)title_normal_color_text);} + } + {fltk::Button} titlebarColorButton { + label {Titlebar color: } + callback {changeBoxColor(titlebarColorButton); +title_normal_color = (int) titlebarColorButton->color();} + xywh {84 130 60 20} align 132 + extra_code {o->color((fltk::Color) title_normal_color);} + } + {fltk::Group} {} {open + xywh {150 65 156 145} + } { + {fltk::Button} titlebarActiveLabelColorButton { + label {Titlebar active label color: } + callback {changeBoxColor(titlebarActiveLabelColorButton); +title_active_color_text = (int) titlebarActiveLabelColorButton->color();} + xywh {90 0 60 20} align 132 + extra_code {o->color((fltk::Color) title_active_color_text);} + } + {fltk::Button} titlebarActiveColorButton { + label {Titlebar active color: } + callback {changeBoxColor(titlebarActiveColorButton); +title_active_color = (int) titlebarActiveColorButton->color();} + xywh {90 65 60 20} align 132 + extra_code {o->color((fltk::Color)title_active_color);} + } + } + {fltk::Choice} titlebarDrawGrad { + label {Box type:} + callback {title_draw_grad = titlebarDrawGrad->value();} open + xywh {84 167 163 23} align 132 + extra_code {o->value(title_draw_grad);} + } { + {fltk::Item} {} { + label Flat + } + {fltk::Item} {} { + label {Horizontal shade} + } + {fltk::Item} {} { + label {Thin down} + } + {fltk::Item} {} { + label {Up box} + } + {fltk::Item} {} { + label {Down box} + } + {fltk::Item} {} { + label Plastic + } + } + {fltk::CheckButton} useThemeButton { + label {&Use theme} + callback {if (useThemeButton->value()) { + themePathInput->activate(); + browse_btn->activate(); + titlebarDrawGrad->deactivate(); + titlebarColorButton->deactivate(); + titlebarActiveColorButton->deactivate(); +} +else +{ + themePathInput->deactivate(); + browse_btn->deactivate(); + titlebarDrawGrad->activate(); + titlebarColorButton->activate(); + titlebarActiveColorButton->activate(); + +} + +use_theme = useThemeButton->value();} + xywh {7 230 300 20} + extra_code {o->value(use_theme);} + } + {fltk::Input} themePathInput { + label {Path:} + callback {theme_path = themePathInput->value();} + xywh {64 257 210 23} deactivate + extra_code {themePathInput->value(theme_path);} + } + {fltk::Button} browse_btn { + label {...} + callback {char *file_types = _("Themes (*.theme), *.theme, All files (*.*), *"); +const char *fileName = fltk::file_chooser( "Themes...", themePathInput->value(), file_types); +if (fileName) { + themePathInput->value(fileName); + theme_path = fileName; +}} selected + xywh {279 257 25 23} deactivate + } + {fltk::Divider} {} { + + extra_code {o->resize(10,100,300,2);} + } + {fltk::Divider} {} { + + extra_code {o->resize(10,210,300,2);} + } + } + {fltk::Group} {} { + label {&Resizing} open + xywh {0 20 325 300} align 5 hide + } { + {fltk::CheckButton} animateButton { + label {Animate size changes} + callback {if(animateButton->value()) animateSlider->activate(); +else animateSlider->deactivate(); +animate = animateButton->value();} + xywh {7 15 300 20} value 1 + extra_code {o->value(animate);} + } + {fltk::ValueSlider} animateSlider { + label {Speed:} + callback {animate_speed = (int)animateSlider->value();} + xywh {67 40 235 20} type TICK_ABOVE align 4 box DOWN_BOX textsize 10 minimum 5 maximum 20 step 1 value 14 slider_size 8 + extra_code {o->value(animate_speed); +if(animate) o->activate(); else o->deactivate();} + } + {fltk::Divider} {} { + + extra_code {o->resize(10,75,300,2);} + } + {fltk::CheckButton} opaqueResize { + label {Show window content while resizing} + callback {opaque_resize = opaqueResize->value()} + xywh {7 90 290 20} + extra_code {o->value(opaque_resize);} + } + } + } + {fltk::Button} {} { + label {&OK} + callback {writeConfiguration(); +applyConfiguration(); +exit(0);} + private xywh {67 337 80 25} shortcut 0xff0d + } + {fltk::Button} {} { + label {&Apply} + callback {writeConfiguration(); +applyConfiguration();} + private xywh {152 337 80 25} + } + {fltk::Button} {} { + label {&Cancel} + callback {exit(0);} + private xywh {237 337 80 25} shortcut 0xff1b + } + } + code {//useThemeButton->do_callback(FL_DIALOG_BTN);} {} +} + +Function {changeBoxColor(fltk::Button *box)} {open return_type void +} { + code {fltk::Button *colorBox = box; +fltk::Color oldColor = colorBox->color(); +fltk::Color defColor = oldColor; +fltk::color_chooser("Choose color", defColor); +if ( defColor != oldColor ) { + colorBox->color(defColor); + colorBox->redraw(); +}} {} +} diff --git a/ewmconf/ewmconf.fld b/ewmconf/ewmconf.fld new file mode 100644 index 0000000..b34f0c4 --- /dev/null +++ b/ewmconf/ewmconf.fld @@ -0,0 +1,228 @@ +# data file for the FLTK User Interface Designer (FLUID) +version 2,0003 +images_dir ./ +i18n +header_name {.h} +code_name {.cpp} +gridx 5 +gridy 5 +snap 3 +decl {// Window manager settings for EDE is (C) Copyright 2001-2002 by Martin Pekar, this program is provided under the terms of GNU GPL v.2, see file COPYING for more information.} {} + +decl {\#include } {} + +decl {\#include } {} + +decl {\#include } {} + +decl {\#include } {} + +decl {\#include "ewm.h"} {} + +Function {} {open +} { + code {fl_init_locale_support("ewmconf", PREFIX"/share/locale"); +readConfiguration();} {} + Fl_Window {} { + label {Window manager settings} open + xywh {793 429 320 370} visible + } { + Fl_Tabs {} {open + xywh {2 5 318 325} color 16 + } { + Fl_Group {} { + label {&Titlebar} open + private xywh {1 29 316 295} align 5 + } { + Fl_Choice {} { + label {Text align:} + callback {title_align = (int)o->value();} open + xywh {83 13 105 22} + extra_code {o->value(title_align);} + } { + Fl_Item {} { + label Left + } + Fl_Item {} { + label Right + } + Fl_Item {} { + label Center + } + } + Fl_Value_Input {} { + label {Height:} + callback {title_height = (int)o->value();} + xywh {243 13 60 22} minimum 10 maximum 50 step 1 value 20 + extra_code {o->value(title_height);} + } + Fl_Button titlebarLabelColorButton { + label {Titlebar label color: } + callback {changeBoxColor(titlebarLabelColorButton); +title_normal_color_text = (int) titlebarLabelColorButton->color();} + xywh {85 55 60 20} align 132 box DOWN_BOX + extra_code {o->color((Fl_Color)title_normal_color_text);} + } + Fl_Button titlebarColorButton { + label {Titlebar color: } + callback {changeBoxColor(titlebarColorButton); +title_normal_color = (int) titlebarColorButton->color();} + xywh {85 120 60 20} align 132 box DOWN_BOX + extra_code {o->color((Fl_Color) title_normal_color);} + } + Fl_Group {} {open + xywh {153 45 160 110} + } { + Fl_Button titlebarActiveLabelColorButton { + label {Titlebar active label color: } + callback {changeBoxColor(titlebarActiveLabelColorButton); +title_active_color_text = (int) titlebarActiveLabelColorButton->color();} + xywh {90 10 60 20} align 132 box DOWN_BOX + extra_code {o->color((Fl_Color) title_active_color_text);} + } + Fl_Button titlebarActiveColorButton { + label {Titlebar active color: } + callback {changeBoxColor(titlebarActiveColorButton); +title_active_color = (int) titlebarActiveColorButton->color();} + xywh {90 75 60 20} align 132 box DOWN_BOX + extra_code {o->color((Fl_Color)title_active_color);} + } + } + Fl_Choice titlebarDrawGrad { + label {Box type:} + callback {title_draw_grad = titlebarDrawGrad->value();} open + xywh {85 157 163 23} align 132 + extra_code {o->value(title_draw_grad);} + } { + Fl_Item {} { + label Flat + } + Fl_Item {} { + label {Horizontal shade} + } + Fl_Item {} { + label {Thin down} + } + Fl_Item {} { + label {Up box} + } + Fl_Item {} { + label {Down box} + } + Fl_Item {} { + label Plastic + } + } + Fl_Check_Button useThemeButton { + label {&Use theme} + callback {if (useThemeButton->value()) { + themePathInput->activate(); + browse_btn->activate(); + titlebarDrawGrad->deactivate(); + titlebarColorButton->deactivate(); + titlebarActiveColorButton->deactivate(); +} +else +{ + themePathInput->deactivate(); + browse_btn->deactivate(); + titlebarDrawGrad->activate(); + titlebarColorButton->activate(); + titlebarActiveColorButton->activate(); + +} + +use_theme = useThemeButton->value();} + xywh {8 220 300 20} + extra_code {o->value(use_theme);} + } + Fl_Input themePathInput { + label {Path:} + callback {theme_path = themePathInput->value();} + xywh {65 247 210 23} deactivate + extra_code {themePathInput->value(theme_path);} + } + Fl_Button browse_btn { + label {...} + callback {char *file_types = _("Themes (*.theme), *.theme, All files (*.*), *"); +const char *fileName = fl_select_file(themePathInput->value(), file_types, _("Themes...")); +if (fileName) { + themePathInput->value(fileName); + theme_path = fileName; +}} + xywh {280 247 25 23} deactivate + } + Fl_Divider {} { + label label + xywh {8 190 300 25} color 16 + } + Fl_Divider {} { + label label + xywh {8 85 297 25} color 16 + } + } + Fl_Group {} { + label {&Resizing} open + xywh {3 20 310 305} align 5 hide + } { + Fl_Check_Button animateButton { + label {Animate size changes} + callback {if(animateButton->value()) animateSlider->activate(); +else animateSlider->deactivate(); +animate = animateButton->value();} + xywh {10 10 300 20} value 1 + extra_code {o->value(animate);} + } + Fl_Value_Slider animateSlider { + label {Speed:} + callback {animate_speed = (int)animateSlider->value();} + xywh {70 35 235 20} type {HORIZONTAL|Fl_Slider::TICK_ABOVE} align 4 box DOWN_BOX text_size 10 minimum 5 maximum 20 step 2 value 14 slider_size 8 + extra_code {o->value(animate_speed); +if(animate) o->activate(); else o->deactivate();} + } + Fl_Divider {} { + label label + xywh {0 60 300 25} + } + Fl_Check_Button opaqueResize { + label {Show window content while resizing} + callback {opaque_resize = opaqueResize->value()} + xywh {10 85 290 20} + extra_code {o->value(opaque_resize);} + } + } + } + Fl_Button {} { + label {&OK} + callback {writeConfiguration(); +applyConfiguration(); +exit(0);} + private xywh {67 337 80 25} shortcut 0xff0d + } + Fl_Button {} { + label {&Apply} + callback {writeConfiguration(); +applyConfiguration();} + private xywh {152 337 80 25} + } + Fl_Button {} { + label {&Cancel} + callback {exit(0);} + private xywh {237 337 80 25} shortcut 0xff1b + } + } + code {useThemeButton->do_callback(FL_DIALOG_BTN);} {selected + } +} + +Function {changeBoxColor(Fl_Button *box)} {open return_type void +} { + code {Fl_Button *colorBox = box; +Fl_Color oldColor = colorBox->color(); +Fl_Color defColor = oldColor; +fl_color_chooser(_("Choose color"), defColor); +if ( defColor != oldColor ) { + colorBox->color(defColor); + colorBox->redraw(); +}} {} +} diff --git a/ewmconf/ewmconf.h b/ewmconf/ewmconf.h new file mode 100644 index 0000000..170eaec --- /dev/null +++ b/ewmconf/ewmconf.h @@ -0,0 +1,42 @@ +/* + * $Id$ + * + * edewm (EDE Window Manager) settings + * Part of Equinox Desktop Environment (EDE). + * Copyright (c) 2000-2006 EDE Authors. + * + * This program is licenced under terms of the + * GNU General Public Licence version 2 or newer. + * See COPYING for details. + */ + +#ifndef ewmconf_h +#define ewmconf_h + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern fltk::Button* titlebarLabelColorButton; +extern fltk::Button* titlebarColorButton; +extern fltk::Button* titlebarActiveLabelColorButton; +extern fltk::Button* titlebarActiveColorButton; +extern fltk::Choice* titlebarDrawGrad; +extern fltk::CheckButton* useThemeButton; +extern fltk::Input* themePathInput; +extern fltk::Button* browse_btn; +extern fltk::CheckButton* animateButton; +extern fltk::ValueSlider* animateSlider; +extern fltk::CheckButton* opaqueResize; + +void changeBoxColor(fltk::Button *box); + +#endif diff --git a/ewmconf/locale/hu.po b/ewmconf/locale/hu.po new file mode 100644 index 0000000..7fa11bc --- /dev/null +++ b/ewmconf/locale/hu.po @@ -0,0 +1,141 @@ +msgid "" +msgstr "" +"Project-Id-Version: \n" +"POT-Creation-Date: \n" +"PO-Revision-Date: 2005-02-09 11:23+0100\n" +"Last-Translator: Nemeth Otto \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: ewmconf.cpp:89 +msgid "Themes (*.theme), *.theme, All files (*.*), *" +msgstr "Témák (*.theme), *.theme, Minden fájl (*.*), *" + +#: ewmconf.cpp:92 +msgid "Themes..." +msgstr "Témák..." + +#: ewmconf.cpp:139 +msgid "Window manager settings" +msgstr "Ablakkezelő beállítások" + +#: ewmconf.cpp:143 +msgid "&Titlebar" +msgstr "&Fejléc" + +#: ewmconf.cpp:145 +msgid "Text align:" +msgstr "Igazítás:" + +#: ewmconf.cpp:147 +msgid "Left" +msgstr "Balra" + +#: ewmconf.cpp:148 +msgid "Right" +msgstr "Jobbra" + +#: ewmconf.cpp:149 +msgid "Center" +msgstr "Középen" + +#: ewmconf.cpp:153 +msgid "Height:" +msgstr "Mag.:" + +#: ewmconf.cpp:161 +msgid "Titlebar label color: " +msgstr "Inaktív szöveg szín:" + +#: ewmconf.cpp:167 +msgid "Titlebar color: " +msgstr "Inaktív fejléc szín:" + +#: ewmconf.cpp:174 +msgid "Titlebar active label color: " +msgstr "Aktív szöveg szín:" + +#: ewmconf.cpp:180 +msgid "Titlebar active color: " +msgstr "Aktív fejléc szín:" + +#: ewmconf.cpp:188 +msgid "Box type:" +msgstr "Stílus:" + +#: ewmconf.cpp:191 +msgid "Flat" +msgstr "Egyszínű" + +#: ewmconf.cpp:192 +msgid "Horizontal shade" +msgstr "Vízszintes színátmenet" + +#: ewmconf.cpp:193 +msgid "Thin down" +msgstr "Karcsú" + +#: ewmconf.cpp:194 +msgid "Up box" +msgstr "Megemelt" + +#: ewmconf.cpp:195 +msgid "Down box" +msgstr "Süllyesztett" + +#: ewmconf.cpp:196 +msgid "Plastic" +msgstr "Plasztik" + +#: ewmconf.cpp:200 +msgid "&Use theme" +msgstr "&Téma használata" + +#: ewmconf.cpp:204 +msgid "Path:" +msgstr "Útvonal:" + +#: ewmconf.cpp:209 +msgid "..." +msgstr "..." + +#: ewmconf.cpp:213 +#: ewmconf.cpp:216 +#: ewmconf.cpp:243 +msgid "label" +msgstr "címke" + +#: ewmconf.cpp:221 +msgid "&Resizing" +msgstr "Á&tméretezés" + +#: ewmconf.cpp:224 +msgid "Animate size changes" +msgstr "Animált maximalizálás" + +#: ewmconf.cpp:229 +msgid "Speed:" +msgstr "Sebesség:" + +#: ewmconf.cpp:244 +msgid "Show window content while resizing" +msgstr "Ablaktartalom megjelenítése átméretezésnél" + +#: ewmconf.cpp:252 +msgid "&OK" +msgstr "&OK" + +#: ewmconf.cpp:256 +msgid "&Apply" +msgstr "&Alkalmaz" + +#: ewmconf.cpp:259 +msgid "&Cancel" +msgstr "Mégs&em" + +#: ewmconf.cpp:274 +msgid "Choose color" +msgstr "Szín kiválasztása" + diff --git a/ewmconf/locale/id.po b/ewmconf/locale/id.po new file mode 100644 index 0000000..c0d4540 --- /dev/null +++ b/ewmconf/locale/id.po @@ -0,0 +1,148 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR Free Software Foundation, Inc. +# FIRST AUTHOR , YEAR. +# +msgid "" +msgstr "" +"Project-Id-Version: ewmconf\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2005-02-04 11:51+0100\n" +"PO-Revision-Date: 2002-11-29 15:44+0700\n" +"Last-Translator: Bambang Purnomosidi D. P. \n" +"Language-Team: id \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=iso-8859-2\n" +"Content-Transfer-Encoding: 8bit\n" + +#: ewmconf.cpp:89 +msgid "Themes (*.theme), *.theme, All files (*.*), *" +msgstr "" + +#: ewmconf.cpp:92 +msgid "Themes..." +msgstr "" + +#: ewmconf.cpp:139 +msgid "Window manager settings" +msgstr "Seting window manager" + +#: ewmconf.cpp:143 +#, fuzzy +msgid "&Titlebar" +msgstr "Baris judul" + +#: ewmconf.cpp:145 +msgid "Text align:" +msgstr "" + +#: ewmconf.cpp:147 +msgid "Left" +msgstr "" + +#: ewmconf.cpp:148 +msgid "Right" +msgstr "" + +#: ewmconf.cpp:149 +msgid "Center" +msgstr "" + +#: ewmconf.cpp:153 +msgid "Height:" +msgstr "" + +#: ewmconf.cpp:161 +msgid "Titlebar label color: " +msgstr "Warna label baris judul" + +#: ewmconf.cpp:167 +msgid "Titlebar color: " +msgstr "Warna judul baris" + +#: ewmconf.cpp:174 +msgid "Titlebar active label color: " +msgstr "Warna label judul baris yang aktif" + +#: ewmconf.cpp:180 +msgid "Titlebar active color: " +msgstr "Warna judul baris aktif" + +#: ewmconf.cpp:188 +msgid "Box type:" +msgstr "" + +#: ewmconf.cpp:191 +msgid "Flat" +msgstr "" + +#: ewmconf.cpp:192 +msgid "Horizontal shade" +msgstr "" + +#: ewmconf.cpp:193 +msgid "Thin down" +msgstr "" + +#: ewmconf.cpp:194 +msgid "Up box" +msgstr "" + +#: ewmconf.cpp:195 +msgid "Down box" +msgstr "" + +#: ewmconf.cpp:196 +msgid "Plastic" +msgstr "" + +#: ewmconf.cpp:200 +msgid "&Use theme" +msgstr "" + +#: ewmconf.cpp:204 +msgid "Path:" +msgstr "" + +#: ewmconf.cpp:209 +msgid "..." +msgstr "" + +#: ewmconf.cpp:213 ewmconf.cpp:216 ewmconf.cpp:243 +msgid "label" +msgstr "" + +#: ewmconf.cpp:221 +#, fuzzy +msgid "&Resizing" +msgstr "Pindahkan && Ubah ukuran" + +#: ewmconf.cpp:224 +msgid "Animate size changes" +msgstr "Animasikan perubahan ukuran" + +#: ewmconf.cpp:229 +msgid "Speed:" +msgstr "Kecepatan:" + +#: ewmconf.cpp:244 +msgid "Show window content while resizing" +msgstr "Perlihatkan isi window pada saat mengubah ukuran" + +#: ewmconf.cpp:252 +msgid "&OK" +msgstr "&OK" + +#: ewmconf.cpp:256 +msgid "&Apply" +msgstr "Ter&apkan" + +#: ewmconf.cpp:259 +msgid "&Cancel" +msgstr "&Batal" + +#: ewmconf.cpp:274 +msgid "Choose color" +msgstr "Pilih warna" + +#~ msgid "Draw gradient titlebar" +#~ msgstr "Hapus gradien judul baris" diff --git a/ewmconf/locale/messages.pot b/ewmconf/locale/messages.pot new file mode 100644 index 0000000..f1782e7 --- /dev/null +++ b/ewmconf/locale/messages.pot @@ -0,0 +1,145 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2005-02-04 11:51+0100\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=CHARSET\n" +"Content-Transfer-Encoding: 8bit\n" + +#: ewmconf.cpp:89 +msgid "Themes (*.theme), *.theme, All files (*.*), *" +msgstr "" + +#: ewmconf.cpp:92 +msgid "Themes..." +msgstr "" + +#: ewmconf.cpp:139 +msgid "Window manager settings" +msgstr "" + +#: ewmconf.cpp:143 +msgid "&Titlebar" +msgstr "" + +#: ewmconf.cpp:145 +msgid "Text align:" +msgstr "" + +#: ewmconf.cpp:147 +msgid "Left" +msgstr "" + +#: ewmconf.cpp:148 +msgid "Right" +msgstr "" + +#: ewmconf.cpp:149 +msgid "Center" +msgstr "" + +#: ewmconf.cpp:153 +msgid "Height:" +msgstr "" + +#: ewmconf.cpp:161 +msgid "Titlebar label color: " +msgstr "" + +#: ewmconf.cpp:167 +msgid "Titlebar color: " +msgstr "" + +#: ewmconf.cpp:174 +msgid "Titlebar active label color: " +msgstr "" + +#: ewmconf.cpp:180 +msgid "Titlebar active color: " +msgstr "" + +#: ewmconf.cpp:188 +msgid "Box type:" +msgstr "" + +#: ewmconf.cpp:191 +msgid "Flat" +msgstr "" + +#: ewmconf.cpp:192 +msgid "Horizontal shade" +msgstr "" + +#: ewmconf.cpp:193 +msgid "Thin down" +msgstr "" + +#: ewmconf.cpp:194 +msgid "Up box" +msgstr "" + +#: ewmconf.cpp:195 +msgid "Down box" +msgstr "" + +#: ewmconf.cpp:196 +msgid "Plastic" +msgstr "" + +#: ewmconf.cpp:200 +msgid "&Use theme" +msgstr "" + +#: ewmconf.cpp:204 +msgid "Path:" +msgstr "" + +#: ewmconf.cpp:209 +msgid "..." +msgstr "" + +#: ewmconf.cpp:213 ewmconf.cpp:216 ewmconf.cpp:243 +msgid "label" +msgstr "" + +#: ewmconf.cpp:221 +msgid "&Resizing" +msgstr "" + +#: ewmconf.cpp:224 +msgid "Animate size changes" +msgstr "" + +#: ewmconf.cpp:229 +msgid "Speed:" +msgstr "" + +#: ewmconf.cpp:244 +msgid "Show window content while resizing" +msgstr "" + +#: ewmconf.cpp:252 +msgid "&OK" +msgstr "" + +#: ewmconf.cpp:256 +msgid "&Apply" +msgstr "" + +#: ewmconf.cpp:259 +msgid "&Cancel" +msgstr "" + +#: ewmconf.cpp:274 +msgid "Choose color" +msgstr "" diff --git a/ewmconf/locale/ru.po b/ewmconf/locale/ru.po new file mode 100644 index 0000000..c135e9b --- /dev/null +++ b/ewmconf/locale/ru.po @@ -0,0 +1,149 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR Free Software Foundation, Inc. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2005-02-04 11:51+0100\n" +"PO-Revision-Date: 2002-11-28 HO:MI+ZONE\n" +"Last-Translator: aabbvv \n" +"Language-Team: RUSSIAN \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=koi8-r\n" +"Content-Transfer-Encoding: 8bit\n" + +#: ewmconf.cpp:89 +msgid "Themes (*.theme), *.theme, All files (*.*), *" +msgstr "" + +#: ewmconf.cpp:92 +msgid "Themes..." +msgstr "" + +#: ewmconf.cpp:139 +msgid "Window manager settings" +msgstr " " + +#: ewmconf.cpp:143 +#, fuzzy +msgid "&Titlebar" +msgstr "" + +#: ewmconf.cpp:145 +msgid "Text align:" +msgstr "" + +#: ewmconf.cpp:147 +msgid "Left" +msgstr "" + +#: ewmconf.cpp:148 +msgid "Right" +msgstr "" + +#: ewmconf.cpp:149 +msgid "Center" +msgstr "" + +#: ewmconf.cpp:153 +msgid "Height:" +msgstr "" + +#: ewmconf.cpp:161 +msgid "Titlebar label color: " +msgstr " :" + +#: ewmconf.cpp:167 +msgid "Titlebar color: " +msgstr " :" + +#: ewmconf.cpp:174 +msgid "Titlebar active label color: " +msgstr " :" + +#: ewmconf.cpp:180 +msgid "Titlebar active color: " +msgstr " :" + +#: ewmconf.cpp:188 +msgid "Box type:" +msgstr "" + +#: ewmconf.cpp:191 +msgid "Flat" +msgstr "" + +#: ewmconf.cpp:192 +msgid "Horizontal shade" +msgstr "" + +#: ewmconf.cpp:193 +msgid "Thin down" +msgstr "" + +#: ewmconf.cpp:194 +msgid "Up box" +msgstr "" + +#: ewmconf.cpp:195 +msgid "Down box" +msgstr "" + +#: ewmconf.cpp:196 +msgid "Plastic" +msgstr "" + +#: ewmconf.cpp:200 +msgid "&Use theme" +msgstr "" + +#: ewmconf.cpp:204 +msgid "Path:" +msgstr "" + +#: ewmconf.cpp:209 +msgid "..." +msgstr "" + +#: ewmconf.cpp:213 ewmconf.cpp:216 ewmconf.cpp:243 +msgid "label" +msgstr "" + +#: ewmconf.cpp:221 +#, fuzzy +msgid "&Resizing" +msgstr " " + +#: ewmconf.cpp:224 +msgid "Animate size changes" +msgstr " " + +#: ewmconf.cpp:229 +msgid "Speed:" +msgstr ":" + +#: ewmconf.cpp:244 +msgid "Show window content while resizing" +msgstr " " + +#: ewmconf.cpp:252 +msgid "&OK" +msgstr "&OK" + +#: ewmconf.cpp:256 +msgid "&Apply" +msgstr "&" + +#: ewmconf.cpp:259 +msgid "&Cancel" +msgstr "&" + +#: ewmconf.cpp:274 +msgid "Choose color" +msgstr " " + +#~ msgid "Draw gradient titlebar" +#~ msgstr " " diff --git a/ewmconf/locale/sk.po b/ewmconf/locale/sk.po new file mode 100644 index 0000000..c99bbb1 --- /dev/null +++ b/ewmconf/locale/sk.po @@ -0,0 +1,148 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR Free Software Foundation, Inc. +# FIRST AUTHOR , YEAR. +# +msgid "" +msgstr "" +"Project-Id-Version: ewmconf 1.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2005-02-04 11:51+0100\n" +"PO-Revision-Date: 2002-04-21 14:50+0200\n" +"Last-Translator: Martin Pekar \n" +"Language-Team: Slovak \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: ewmconf.cpp:89 +msgid "Themes (*.theme), *.theme, All files (*.*), *" +msgstr "" + +#: ewmconf.cpp:92 +msgid "Themes..." +msgstr "" + +#: ewmconf.cpp:139 +msgid "Window manager settings" +msgstr "Nastavenie manažéra okien" + +#: ewmconf.cpp:143 +#, fuzzy +msgid "&Titlebar" +msgstr "Lišta okna" + +#: ewmconf.cpp:145 +msgid "Text align:" +msgstr "" + +#: ewmconf.cpp:147 +msgid "Left" +msgstr "" + +#: ewmconf.cpp:148 +msgid "Right" +msgstr "" + +#: ewmconf.cpp:149 +msgid "Center" +msgstr "" + +#: ewmconf.cpp:153 +msgid "Height:" +msgstr "" + +#: ewmconf.cpp:161 +msgid "Titlebar label color: " +msgstr "Farba menovky lišty: " + +#: ewmconf.cpp:167 +msgid "Titlebar color: " +msgstr "Farba lišty: " + +#: ewmconf.cpp:174 +msgid "Titlebar active label color: " +msgstr "Aktívna farba menovky lišty: " + +#: ewmconf.cpp:180 +msgid "Titlebar active color: " +msgstr "Aktívna farba lišty: " + +#: ewmconf.cpp:188 +msgid "Box type:" +msgstr "" + +#: ewmconf.cpp:191 +msgid "Flat" +msgstr "" + +#: ewmconf.cpp:192 +msgid "Horizontal shade" +msgstr "" + +#: ewmconf.cpp:193 +msgid "Thin down" +msgstr "" + +#: ewmconf.cpp:194 +msgid "Up box" +msgstr "" + +#: ewmconf.cpp:195 +msgid "Down box" +msgstr "" + +#: ewmconf.cpp:196 +msgid "Plastic" +msgstr "" + +#: ewmconf.cpp:200 +msgid "&Use theme" +msgstr "" + +#: ewmconf.cpp:204 +msgid "Path:" +msgstr "" + +#: ewmconf.cpp:209 +msgid "..." +msgstr "" + +#: ewmconf.cpp:213 ewmconf.cpp:216 ewmconf.cpp:243 +msgid "label" +msgstr "" + +#: ewmconf.cpp:221 +#, fuzzy +msgid "&Resizing" +msgstr "Presun a zmena veľkosti" + +#: ewmconf.cpp:224 +msgid "Animate size changes" +msgstr "Animácia pri zmene rozmeru" + +#: ewmconf.cpp:229 +msgid "Speed:" +msgstr "Rýchlosť:" + +#: ewmconf.cpp:244 +msgid "Show window content while resizing" +msgstr "Zobrazovať obsah okna počas zmeny veľkosti" + +#: ewmconf.cpp:252 +msgid "&OK" +msgstr "&OK" + +#: ewmconf.cpp:256 +msgid "&Apply" +msgstr "&Použiť" + +#: ewmconf.cpp:259 +msgid "&Cancel" +msgstr "&Zrušiť" + +#: ewmconf.cpp:274 +msgid "Choose color" +msgstr "Zvoliť farbu" + +#~ msgid "Draw gradient titlebar" +#~ msgstr "Kresliť gradientovú lištu" diff --git a/ewmconf/locale/sr.po b/ewmconf/locale/sr.po new file mode 100644 index 0000000..d5632c6 --- /dev/null +++ b/ewmconf/locale/sr.po @@ -0,0 +1,148 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR Free Software Foundation, Inc. +# Dejan Lekic , 2002. +# +msgid "" +msgstr "" +"Project-Id-Version: ewmconf 1.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2005-02-04 11:51+0100\n" +"PO-Revision-Date: 2002-12-02 04:24+0100\n" +"Last-Translator: Dejan Lekic \n" +"Language-Team: LINUKS.org T.T. \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: ewmconf.cpp:89 +msgid "Themes (*.theme), *.theme, All files (*.*), *" +msgstr "" + +#: ewmconf.cpp:92 +msgid "Themes..." +msgstr "" + +#: ewmconf.cpp:139 +msgid "Window manager settings" +msgstr "Подешавање менаџера прозора" + +#: ewmconf.cpp:143 +#, fuzzy +msgid "&Titlebar" +msgstr "Тајтлбар" + +#: ewmconf.cpp:145 +msgid "Text align:" +msgstr "" + +#: ewmconf.cpp:147 +msgid "Left" +msgstr "" + +#: ewmconf.cpp:148 +msgid "Right" +msgstr "" + +#: ewmconf.cpp:149 +msgid "Center" +msgstr "" + +#: ewmconf.cpp:153 +msgid "Height:" +msgstr "" + +#: ewmconf.cpp:161 +msgid "Titlebar label color: " +msgstr "Боја наслова:" + +#: ewmconf.cpp:167 +msgid "Titlebar color: " +msgstr "Боја тајтлбар-а:" + +#: ewmconf.cpp:174 +msgid "Titlebar active label color: " +msgstr "Боја активног тајтлбар-а:" + +#: ewmconf.cpp:180 +msgid "Titlebar active color: " +msgstr "Боја активног тајтлбар-а:" + +#: ewmconf.cpp:188 +msgid "Box type:" +msgstr "" + +#: ewmconf.cpp:191 +msgid "Flat" +msgstr "" + +#: ewmconf.cpp:192 +msgid "Horizontal shade" +msgstr "" + +#: ewmconf.cpp:193 +msgid "Thin down" +msgstr "" + +#: ewmconf.cpp:194 +msgid "Up box" +msgstr "" + +#: ewmconf.cpp:195 +msgid "Down box" +msgstr "" + +#: ewmconf.cpp:196 +msgid "Plastic" +msgstr "" + +#: ewmconf.cpp:200 +msgid "&Use theme" +msgstr "" + +#: ewmconf.cpp:204 +msgid "Path:" +msgstr "" + +#: ewmconf.cpp:209 +msgid "..." +msgstr "" + +#: ewmconf.cpp:213 ewmconf.cpp:216 ewmconf.cpp:243 +msgid "label" +msgstr "" + +#: ewmconf.cpp:221 +#, fuzzy +msgid "&Resizing" +msgstr "Померање и промена величине" + +#: ewmconf.cpp:224 +msgid "Animate size changes" +msgstr "Анимирај промену величине" + +#: ewmconf.cpp:229 +msgid "Speed:" +msgstr "Брзина:" + +#: ewmconf.cpp:244 +msgid "Show window content while resizing" +msgstr "Приказуј прозор приликом мењања величине" + +#: ewmconf.cpp:252 +msgid "&OK" +msgstr "&ОК" + +#: ewmconf.cpp:256 +msgid "&Apply" +msgstr "&Примени" + +#: ewmconf.cpp:259 +msgid "&Cancel" +msgstr "&Одустани" + +#: ewmconf.cpp:274 +msgid "Choose color" +msgstr "Изабери боју" + +#~ msgid "Draw gradient titlebar" +#~ msgstr "Цртај тајтлбар са преливом" diff --git a/eworkpanel/EDE_Config.cpp b/eworkpanel/EDE_Config.cpp new file mode 100644 index 0000000..2ddd8de --- /dev/null +++ b/eworkpanel/EDE_Config.cpp @@ -0,0 +1,990 @@ +// EDE_Config.cpp: implementation of the EDE_Config class. +// +////////////////////////////////////////////////////////////////////// + +/*#include "fl_internal.h" + +#include +#include +#include +#include +#include +#include */ + +#include "EDE_Config.h" +#include +#include "NLS.h" +#include +#include + +#include +#include +#include +#include + +#ifdef _WIN32_WCE +#include +#endif +//#include + + +#ifdef _WIN32 + +# include +# include +# include +# define access(a,b) _access(a,b) +# define mkdir(a,b) _mkdir(a) +# define R_OK 4 + +#else + +# include + +#endif /* _WIN32 */ + +// This is used for comment inside config files: +#define EDE_VERSION 2.0 + +#define LOCALE_TO_C() \ + char *locale = setlocale(LC_ALL, ""); \ + char *restore_locale = locale ? strdup(locale) : strdup("C"); \ + setlocale(LC_ALL, "C") + +#define RESTORE_LOCALE() \ + setlocale(LC_ALL, restore_locale); \ + free(restore_locale) + +// From Enumerations.h +#ifdef _WIN32 +# undef slash +# define slash '\\' +#else +# undef slash +# define slash '/' +#endif +// End Enumerations.h + +// From config.h +#define CONFIGDIR "/usr/share/ede" +// End config.h + +static int is_path_rooted(const char *fn) +{ + /* see if an absolute name was given: */ +#ifdef _WIN32 + if (fn[0] == '/' || fn[0] == '.' || fn[0] == '\\' || fn[1]==':') +#else + if (fn[0] == '/' || fn[0] == '.') +#endif + return 1; + return 0; +} + +// recursively create a path in the file system +static bool makePath( const char *path ) { + if(access(path, 0)) { + const char *s = strrchr( path, slash ); + if ( !s ) return 0; + int len = s-path; + char *p = (char*)malloc( len+1 ); + memcpy( p, path, len ); + p[len] = 0; + makePath( p ); + free( p ); + return ( mkdir( path, 0777 ) == 0 ); + } + return true; +} + +// strip the filename and create a path +static bool makePathForFile( const char *path ) +{ + const char *s = strrchr( path, slash ); + if ( !s ) return false; + int len = s-path; + char *p = (char*)malloc( len+1 ); + memcpy( p, path, len ); + p[len] = 0; + bool ret=makePath( p ); + free( p ); + return ret; +} + +char *get_sys_dir() { +#ifndef _WIN32 + return CONFIGDIR; +#else + static char path[PATH_MAX]; + HKEY hKey; + if(RegOpenKeyExW(HKEY_LOCAL_MACHINE, L"Software\\Microsoft\\Windows\\CurrentVersion", 0, KEY_READ, &hKey)==ERROR_SUCCESS) + { + DWORD size=4096; + RegQueryValueExW(hKey, L"CommonFilesDir", NULL, NULL, (LPBYTE)path, &size); + RegCloseKey(hKey); + return path; + } + return "C:\\EDE\\"; +#endif +} + +char *get_homedir() { + char *path = new char[PATH_MAX]; + const char *str1; + + str1=getenv("HOME"); + if (str1) { + memcpy(path, str1, strlen(str1)+1); + return path; + } + + return 0; +} + + +char *EDE_Config::find_config_file(const char *filename, bool create, int mode) +{ + static char path[4096]; + + if(is_path_rooted(filename)) { + strncpy(path, filename, sizeof(path)); + return (create || !access(path, R_OK)) ? path : 0; + } + if(mode==USER) { + char *cptr = get_homedir(); + char *ret=0; + if(cptr) { + snprintf(path, sizeof(path)-1, "%s%c%s%c%s", cptr, slash, ".ede", slash, filename); + if(create || !access(path, R_OK)) { + ret = path; + } + delete []cptr; + return ret; + } + return 0; + } else { + snprintf(path, sizeof(path)-1, "%s%c%s", get_sys_dir(), slash, filename); + return (create || !access(path, R_OK)) ? path : 0; + } +} + + +// Vedran - a few string management functions... + +// strdupcat() - it's cool to strcat with implied realloc +// -- NOTE: due to use of realloc *always* use strdupcat return value: +// dest = strdupcat(dest,src); +// and *never* use it like: +// strdupcat(dest,src); +char *strdupcat(char *dest, const char *src) +{ + if (!dest) { + dest=(char*)malloc(strlen(src)); + } else { + dest=(char*)realloc (dest, strlen(dest)+strlen(src)+1); + } + strcat(dest,src); + return dest; +} + + +// wstrim() - for trimming characters (used in parser) +// parts of former fl_trimleft and fl_trimright from Fl_Util.cpp +char* wstrim(char *string) +{ + char *start; + + if(string == NULL ) + return NULL; + + if (*string) { + int len = strlen(string); + if (len) { + char *p = string + len; + do { + p--; + if ( !isspace(*p) ) break; + } while ( p != string ); + + if ( !isspace(*p) ) p++; + *p = 0; + } + } + + for(start = string; *start && isspace (*start); start++); + memmove(string, start, strlen(start) + 1); + + return string; +} + +// hmmmh? +//char* wstrim(const char *string) +//{ +// char *newstring = strdup(string); +// return wstrim(newstring); +//} + + +// from_string() - adapted from Fl_String_List to use vector +std::vector from_string(const char *str, const char *separator) +{ + if(!str) return std::vector (); + + const char *ptr = str; + const char *s = strstr(ptr, separator); + std::vector retval; + if(s) { + unsigned separator_len = strlen(separator); + do { + unsigned len = s - ptr; + if (len) { + retval.push_back(strndup(ptr,len)); + } else { + retval.push_back(NULL); + } + + ptr = s + separator_len; + s = strstr(ptr, separator); + } + while(s); + + if(*ptr) { + retval.push_back(strdup(ptr)); + } + } else { + retval.push_back(strdup(ptr)); + } + return retval; +} + + + +////////////////////////////////////////////////////////////////////// +// Construction/Destruction +////////////////////////////////////////////////////////////////////// + +#define S(item) ((EDE_Config_Section*)item) + +EDE_Config::EDE_Config(const char *vendor, const char *application, int mode) +: EDE_Config_Section("","",0) +{ + m_vendor=m_app=m_filename=NULL; + m_cur_sec = 0; + m_changed=false; + m_error = 0; + + if(vendor) m_vendor = strdup(vendor); + if(application) m_app = strdup(application); + + if(strlen(m_app) > 0) { + const char *file=0; + char tmp[PATH_MAX]; +#ifdef _WIN32 + if(mode==SYSTEM) + snprintf(tmp, sizeof(tmp)-1, "%s%c%s.conf", m_app, slash, m_app); + else +#endif + snprintf(tmp, sizeof(tmp)-1, "apps%c%s%c%s.conf", slash, m_app, slash, m_app); + file = find_config_file(tmp, true, mode); + if(file) { + bool ret = makePathForFile(file); + if(ret) { + m_filename = strdup(file); + read_file(true); + } else + m_error = CONF_ERR_FILE; + } else + m_error = CONF_ERR_FILE; + } else + m_error = CONF_ERR_FILE; +} + +EDE_Config::EDE_Config(const char *filename, bool read, bool create) +: EDE_Config_Section("","",0) +{ + m_vendor=m_app=m_filename=NULL; + + if(filename) m_filename = strdup(filename); else m_filename = strdup(""); +// TODO: shouldn't we just return false if there's no filename?? +// use case: creating a new file (nonexistant) + + m_error = 0; + m_cur_sec = 0; + m_changed=false; + + if(create && strlen(m_filename)>0) { + makePathForFile(m_filename); + } + + if(read) read_file(create); +} + +EDE_Config::~EDE_Config() +{ + flush(); + clear(); + if(m_filename) free(m_filename); + if(m_vendor) free(m_vendor); + if(m_app) free(m_app); +} + +/* get error string associated with error number */ +const char *EDE_Config::strerror(int error) +{ + switch(error) + { + case CONF_SUCCESS: return _("Successful completion"); + case CONF_ERR_FILE: return _("Could not access config file"); + case CONF_ERR_SECTION: return _("Config file section not found"); + case CONF_ERR_KEY: return _("Key not found in section"); + case CONF_ERR_MEMORY: return _("Could not allocate memory"); + case CONF_ERR_NOVALUE: return _("Invalid value associated with key"); + default: return _("Unknown error"); + } +} + +bool EDE_Config::read_file(bool create) +{ + bool error = false; + if(m_filename && strlen(m_filename)<1) { + m_error = CONF_ERR_FILE; + return false; + } + + if(create && !(access(m_filename, F_OK)==0)) { + FILE *f = fopen(m_filename, "w+"); + if(f) { + fputs(" ", f); + fclose(f); + } else error=true; + } + + if(error) { + m_error = CONF_ERR_FILE; + return false; + } + + // If somebody calls this function two times, we + // need to clean earlier section list... + clear(); + + ///// + struct stat fileStat; + stat(m_filename, &fileStat); + unsigned int size = fileStat.st_size; + if(size == 0) { + m_error = 0; + return true; + } + + FILE *fp = fopen(m_filename, "r"); + if(!fp) { + //fprintf(stderr, "fp == 0: %s\n", m_filename); + m_error = CONF_ERR_FILE; + return false; + } + + unsigned bsize = size*sizeof(char); + char *buffer = (char*)malloc(bsize+1); + buffer[bsize] = 0; + if(!buffer) { + m_error = CONF_ERR_MEMORY; + return false; + } + + unsigned int readed = fread(buffer, 1, size, fp); + if(readed <= 0) { + free((char*)buffer); + fclose(fp); + m_error = CONF_ERR_FILE; + return false; + } + fclose(fp); + + /* old parser + EDE_String_List strings(buffer, "\n"); + + free((char*)buffer); + + EDE_Config_Section *section = this; + for(unsigned n=0; n=0) { + line = strings[n].sub_str(comment_pos, strings[n].length()-comment_pos).trim(); + } else { + line = strings[n].trim(); + } + + if(line[0] == '[') + { + int pos = line.pos(']'); + if(pos>=0) + { + EDE_String sec(line.sub_str(1, pos-1)); + section = create_section(sec); + } + } + else if(line[0] != '#') + { + int pos = line.pos('='); + if(pos==-1) pos = line.pos(':'); + if(pos>=0) { + EDE_String key(line.sub_str(0, pos)); + pos++; + EDE_String value(line.sub_str(pos, line.length()-pos)); + section->add_entry(key, value); + } + } + } + */ + + // new parser by Vedran + // I like writing parsers + // too bad others don't like me writing parsers... + // TODO: i did some stupid things here for debugging, need to check + + int pos=0; + bool comment, iskey, issection; + char *key, *value, *sectionname; + key=strdup(""); value=strdup(""); sectionname=strdup(""); + EDE_Config_Section *section = this; + do { + int c=buffer[pos]; + if ((c == '\n') || (c == '\0')) { + comment=false; iskey=true; issection=false; + sectionname = wstrim(sectionname); + key = wstrim(key); + value = wstrim(value); + if (strlen(sectionname) > 0) + section = create_section(sectionname); + if (strlen(key) > 0) + section->add_entry(key,value); + free(sectionname); free(key); free(value); + key=strdup(""); value=strdup(""); sectionname=strdup(""); + } + else if (c == '#') + comment = true; + else if (comment == false) { + if (c == '[') + issection = true; + else if (c == ']') + issection = false; + else if ((c == '=') || (c == ':')) + iskey = false; + else { + if (issection) + sectionname = strdupcat(sectionname, (const char*) &c); + else if (iskey) + key = strdupcat(key, (const char*) &c); + else + value = strdupcat(value,(const char*) &c); + } + } + pos++; + } while (buffer[pos] != '\0'); + + free(key); free(value); free(sectionname); + m_error = 0; + m_changed=false; + return true; +} + +bool EDE_Config::flush() +{ + if(!m_changed) return true; + if(strlen(m_filename) < 1) return false; + + FILE *file = fopen(m_filename, "w+"); +// if(!file) +// fl_throw(::strerror(errno)); + + LOCALE_TO_C(); + + fprintf(file, "# EDE INI Version %f\n", EDE_VERSION); + if(m_vendor && strlen(m_vendor)>0) fprintf(file, "# Vendor: %s\n", m_vendor); + if(m_app && strlen(m_app)>0) fprintf(file, "# Application: %s\n", m_app); + + // Flush sections + write_section(0, file); + + RESTORE_LOCALE(); + + fclose(file); + + m_error = 0; + m_changed=false; + return true; +} + + +EDE_Config_Section *EDE_Config::create_section(const char* name) +{ + if(strlen(name)<1) return 0; + + EDE_Config_Section *section = find_section(name, true); + if(section) return section; + + char *lastptr = strrchr(name,'/'); // int pos = name.rpos('/')+1; + int pos; + if(lastptr) { + pos = lastptr-name + 1; + } else { + section = new EDE_Config_Section(name, "", 0); + sections().push_back(section); + return section; + } + + //char* sec_name(name.sub_str(pos, name.length()-pos)); + char *sec_name = strndup(name+pos, strlen(name)-pos); + //char* sec_path(name.sub_str(0, pos)); + char *sec_path = strndup(name, pos); + + EDE_Config_Section *parent = find_section(sec_path, false); + EDE_Config_Sections *list = §ions(); + + if(!parent) { + // Fl_String_List sections; + std::vector sections = from_string(sec_path, "/"); + + char* path = strdup(""); + for(unsigned n=0; nsections(); + + parent = new EDE_Config_Section(sections.at(n), path, parent); + list->push_back(parent); + + path = strdupcat (path, sections.at(n)); + path = strdupcat (path, (char *)'/'); + } + free(path); + } + + if(parent) list = &parent->sections(); + + section = new EDE_Config_Section(sec_name, sec_path, parent); + list->push_back(section); + + free(sec_name); free(sec_path); + m_error = 0; + return section; +} + +EDE_Config_Section *EDE_Config::find_section(const char *path, bool perfect_match) const +{ + if(!path || !*path) return 0; + + std::vector sections = from_string(path, "/"); + + if(sections.size()==0) + return find(path, false); + + EDE_Config_Section *section = (EDE_Config_Section *)this; + for(unsigned n=0; nfind(sections.at(n), false); + if(!tmp) { + if(perfect_match) + return 0; + else + break; + } + section = tmp; + } + return section; +} + +void EDE_Config::remove_key(const char *section, const char *key) +{ + if(key) { + EDE_Config_Section *sect = find_section(section, true); + if(sect->remove_entry(key)) { + m_error = 0; + m_changed = true; + return; + } + } + m_error = CONF_ERR_KEY; +} + +// finding and removing stuff from deque +void sectremove(EDE_Config_Sections sects, EDE_Config_Section *sect) { + for (unsigned int n=0; nparent()) { + sectremove(sect->parent()->sections(),sect); + } else { + sectremove(sections(),sect); + } + delete sect; + m_error = 0; + m_changed = true; + return; + } + m_error = CONF_ERR_SECTION; +} + +/* + * Read functions + */ + +int EDE_Config::_read_string(EDE_Config_Section *s, const char *key, char *ret, const char *def_value, int size) +{ + if(!key || !s) { + if(def_value) strncpy(ret, def_value, size); + else ret[0] = '\0'; + m_error = (!key ? CONF_ERR_KEY : CONF_ERR_SECTION); + return m_error; + } + + char *val = s->find_entry(key); + if(val) { + int len = strlen(val); // convert from unsigned... and now: + len = (lenfind_entry(key); + if(val && strlen(val)>0) + { + ret = strdup(val); + return (m_error = CONF_SUCCESS); + } + free(val); + + ret = def_value ? strdup(def_value) : 0; + m_error = CONF_ERR_KEY; + return m_error; +} + +/*int EDE_Config::_read_string(EDE_Config_Section *s, const char *key, Fl_String &ret, const char *def_value) +{ + if(!key || !s) { + ret = def_value; + m_error = !key ? CONF_ERR_KEY : CONF_ERR_SECTION; + return m_error; + } + + Fl_String *val = s->find_entry(key); + if(val) { + ret = (*val); + return (m_error = CONF_SUCCESS); + } + + ret = def_value; + return (m_error = CONF_ERR_KEY); +}*/ + +int EDE_Config::_read_long(EDE_Config_Section *s, const char *key, long &ret, long def_value) +{ + char* tmp; + if(!_read_string(s, key, tmp, 0)) { + ret = tmp[0] ? strtol(tmp, NULL, 10) : def_value; + } else + ret = def_value; + return m_error; +} + +int EDE_Config::_read_int(EDE_Config_Section *s, const char *key, int &ret, int def_value) +{ + char* tmp; + if(!_read_string(s, key, tmp, 0)) { + ret = atoi(tmp); + if ((errno = ERANGE) || (ret == 0 && strcmp(tmp,"0") != 0)) ret = def_value; + } else + ret = def_value; + return m_error; +} + +int EDE_Config::_read_float (EDE_Config_Section *s, const char *key, float &ret, float def_value) +{ + char* tmp; + if(!_read_string(s, key, tmp, 0)) { + LOCALE_TO_C(); + ret = (float)strtod(tmp, 0); + RESTORE_LOCALE(); + } else + ret = def_value; + return m_error; +} + +int EDE_Config::_read_double(EDE_Config_Section *s, const char *key, double &ret, double def_value) +{ + char* tmp; + if(!_read_string(s, key, tmp, 0)) { + LOCALE_TO_C(); + ret = strtod(tmp, 0); + RESTORE_LOCALE(); + } else + ret = def_value; + return m_error; +} + +int EDE_Config::_read_bool(EDE_Config_Section *s, const char *key, bool &ret, bool def_value) +{ + char* tmp; + if(_read_string(s, key, tmp, 0)) { + ret = def_value; + return m_error; + } + if ((strncasecmp(tmp,"true",4)) || + (strncasecmp(tmp,"yes",3)) || + (strncasecmp(tmp,"on",2)) || + (strcasecmp(tmp,"1"))) { + ret = true; + } else if((strncasecmp(tmp,"false",5)) || + (strncasecmp(tmp,"no",2)) || + (strncasecmp(tmp,"off",3)) || + (strcasecmp(tmp,"0"))) { + ret = false; + } else { + m_error = CONF_ERR_NOVALUE; + ret = def_value; + } + return m_error; +} + +int EDE_Config::_read_color(EDE_Config_Section *s, const char *key, fltk::Color &ret, fltk::Color def_value) +{ + char* tmp; + if(_read_string(s, key, tmp, 0)) { + ret = def_value; + return m_error; + } + + int r=0,g=0,b=0; + if(sscanf(tmp, "RGB(%d,%d,%d)", &r, &g, &b)!=3) { + ret = def_value; + return (m_error = CONF_ERR_NOVALUE); + } + ret = fltk::color(r,g,b); + return m_error; +} + +/* + * Write functions + */ + +/*int EDE_Config::_write_string(EDE_Config_Section *s, const char *key, const char *value) +{ + char* val(value); + return _write_string(s, key, val); +}*/ + +int EDE_Config::_write_string(EDE_Config_Section *s, const char *key, const char* value) +{ + if(!s) return (m_error = CONF_ERR_SECTION); + if(!key) return (m_error = CONF_ERR_KEY); + +/* This logic is now in add_entry, cause we can't pass around pointers into structure + + char *val = s->find_entry(key); + if(val) { + strncpy(val, value, strlen(value)); + } else */ + if (value) s->add_entry(key, value); else s->add_entry(key, ""); + + m_changed=true; + return (m_error=CONF_SUCCESS); +} + +int EDE_Config::_write_long(EDE_Config_Section *s, const char *key, const long value) +{ + char tmp[128]; snprintf(tmp, sizeof(tmp)-1, "%ld", value); + return _write_string(s, key, tmp); +} + +int EDE_Config::_write_int(EDE_Config_Section *s, const char *key, const int value) +{ + char tmp[128]; snprintf(tmp, sizeof(tmp)-1, "%d", value); + return _write_string(s, key, tmp); +} + +int EDE_Config::_write_float(EDE_Config_Section *s, const char *key, const float value) +{ + LOCALE_TO_C(); + char tmp[32]; snprintf(tmp, sizeof(tmp)-1, "%g", value); + RESTORE_LOCALE(); + return _write_string(s, key, tmp); +} + +int EDE_Config::_write_double(EDE_Config_Section *s, const char *key, const double value) +{ + LOCALE_TO_C(); + char tmp[32]; snprintf(tmp, sizeof(tmp)-1, "%g", value); + RESTORE_LOCALE(); + return _write_string(s, key, tmp); +} + +int EDE_Config::_write_bool(EDE_Config_Section *s, const char *key, const bool value) +{ + if(value) return _write_string(s, key, "1"); + return _write_string(s, key, "0"); +} + +int EDE_Config::_write_color(EDE_Config_Section *s, const char *key, const fltk::Color value) +{ + unsigned char r,g,b; + fltk::split_color(value, r,g,b); + char tmp[32]; + snprintf(tmp, sizeof(tmp)-1, "RGB(%d,%d,%d)", r,g,b); + return _write_string(s, key, tmp); +} + +////////////////////////////////////// +////////////////////////////////////// +////////////////////////////////////// + +EDE_Config_Section::EDE_Config_Section(const char* name, const char* path, EDE_Config_Section *par) +: m_parent(par) +{ + m_name=strdup(name); + m_path=strdup(path); +} + +EDE_Config_Section::~EDE_Config_Section() +{ + free(m_name); + free(m_path); + clear(); +} + +void EDE_Config_Section::clear() +{ + for(unsigned n=0; n0) + fprintf(fp, "[%s%s]\n", path(), name()); + + for(unsigned n=0; n 0) { + for(int a=0; awrite_section(indent+2, fp); + } +} + +void EDE_Config_Section::add_entry(const char* key, const char* value) +{ + int keylen = strlen(key); + if(!key || keylen<1) return; + if(!value) return; + + char *tmp = strdup(key); + char *tmp2 = strdup(value); + tmp = wstrim(tmp); + tmp2 = wstrim(tmp2); + tmp = strdupcat(tmp, "="); + tmp = strdupcat(tmp, tmp2); + free(tmp2); + + // if key already exists, delete + bool found = false; + for (unsigned i=0; isize(); n++) { + EDE_Config_Section *s = (EDE_Config_Section*) list->at(n); + if(strcmp(s->name(), name) == 0) { + return s; + } + if(recursive) { + s = s->find(name, recursive); + if(s) return s; + } + } + return 0; +} diff --git a/eworkpanel/EDE_Config.h b/eworkpanel/EDE_Config.h new file mode 100644 index 0000000..121c6e4 --- /dev/null +++ b/eworkpanel/EDE_Config.h @@ -0,0 +1,752 @@ +/* + * EDE_Config + * Library for configuration files + * Copyright (c) 2000. - 2005. EDE Authors + * WWW: http://ede.sf.net + * + * This library is distributed under the GNU LIBRARY GENERAL PUBLIC LICENSE + * version 2. See COPYING for details. + * + * Author : Mikko Lahteenmaki (mikko@fltk.net) + * Port to FLTK2: Vedran Ljubovic (vljubovic@smartnet.ba) + * + * Please report all bugs and problems to "efltk-bugs@fltk.net" + * + */ + +#ifndef _EDE_CONFIG_H_ +#define _EDE_CONFIG_H_ + +/*#include "Enumerations.h" +#include "Fl_Util.h" +#include "Fl_String.h" +#include "Fl_Color.h" +#include "Fl_Ptr_List.h" +#include "Fl_Map.h"*/ + +#include +#include +#include + +#include +#include +#include + +#ifdef _WIN32_WCE +#include +#endif + +/** + * \defgroup EDE_Config EDE_Config globals + */ +/*@{*/ + +/** + * Error codes for EDE_Config + */ +enum ConfErrors { + CONF_SUCCESS = 0, ///< successful operation + CONF_ERR_FILE, ///< trouble accessing config file or directory + CONF_ERR_SECTION, ///< requested section was not found + CONF_ERR_KEY, ///< requested key was not found + CONF_ERR_MEMORY, ///< memory allocation error + CONF_ERR_NOVALUE, ///< key found, but invalid value associated with it +}; + +/** List used for sections in Fl_Config_Section */ +//FIXME +//typedef Fl_Ptr_List Fl_Config_Sections; +typedef std::deque EDE_Config_Sections; + +/** Map used for entries in Fl_Config_Section */ +//FIXME +//typedef Fl_String_String_Map Fl_Config_Lines; +//this is not exactly compatible, but that's the best we can do... +typedef std::vector EDE_Config_Lines; + +/*@}*/ + +class EDE_Config; + +/** + * The configuration section. + * Represents one section in config (ini) file. + * @see EDE_Config + */ +//FIXME: class FL_API EDE_Config_Section +class EDE_Config_Section +{ + friend class EDE_Config; +public: + EDE_Config_Section(const char* name, const char* path, EDE_Config_Section *par); + virtual ~EDE_Config_Section(); + + /** + * Destroys all sections and entries. + */ + virtual void clear(); + + /** + * Returns pointer to parent section, NULL for Fl_Config (root) + */ + EDE_Config_Section *parent() const { return m_parent; } + + /** + * Returns name of section, without path. + * @see path() + */ + const char* name() const { return m_name; } + + /** + * Returns path to section, without name. + * @see name() + */ + const char* path() const { return m_path; } + + /** + * Returns const reference to entry map. + */ + const EDE_Config_Lines &lines() const { return m_lines; } + + /** + * Returns reference to entry map. + */ + EDE_Config_Lines &lines() { return m_lines; } + + /** + * Returns const reference to section list. + */ + const EDE_Config_Sections §ions() const { return m_sections; } + + /** + * Returns reference to section list. + */ + EDE_Config_Sections §ions() { return m_sections; } + + /** + * Find section named 'name'. + * @param section_name name of section to find + * @param recursive set true to perform recursive search. + */ + EDE_Config_Section *find(const char *section_name, bool recursive=false) const; + +protected: + EDE_Config_Section *m_parent; + char *m_name, *m_path; + + EDE_Config_Lines m_lines; //Line map + EDE_Config_Sections m_sections; //Section list + + void write_section(int indent, FILE *fp) const; + + void add_entry(const char* key, const char* value); + bool remove_entry(const char* key); + char* find_entry(const char *key) const; +}; + +/** + * The configuration holder. This class maybe used very easily to + * store application settings to file. Either system wide or user specific, + * depending on config type. Fl_Config is derived Fl_Config_Section, please + * take look a look at functions it provides also. + * @see Fl_Config_Section + */ +//FIXME: class FL_API Fl_Config : public Fl_Config_Section { +class EDE_Config : public EDE_Config_Section { +public: + + /** + * Config file modes + */ + enum ConfigType { + USER=1, ///< User specific config file + SYSTEM ///< System wide config file + }; + + /** + * Creates/reads/writes app specific config file. + * + * LINUX:
+ * File is created in ($home)/.ede/apps/($application)/($application).conf + * Or ($prefix)/share/ede/apps/($application)/($application).conf + * + *
WIN32:
+ * ($home)\Local Settings\.ede\apps\($application)/($application).conf + * Or ($common files)\($application)\($application).conf + * + * Location depends on ConfigType 'mode', USER or SYSTEM + * + * @param vendor aplication vendor, written down to file + * @param application name, written down to file + * @param mode which mode to use + */ + EDE_Config(const char *vendor, const char *application, int mode=USER); + + /** + * Access custom file in filesystem. + * + * @param filename path to config (ini) file. + * @param readfile if true, file is readed on constructor. I.e no need for read_file() + * @param createfile if true, file is created if it doesn't exists. + */ + EDE_Config(const char *filename, bool readfile=true, bool createfile=true); + + /** + * Destroys config + */ + virtual ~EDE_Config(); + + /** + * Finds config file, depending on mode. + * NOTE: User MUST NOT free returned pointer! + * + * LINUX:
+ * File is created in ($home)/.ede/apps/($application)/($application).conf + * Or ($prefix)/share/ede/apps/($application)/($application).conf + * + *
WIN32:
+ * ($home)\Local Settings\.ede\apps\($application)/($application).conf + * Or ($common files)\($application)\($application).conf + * + * @param filename Relative filename, e.g. "myapp_config.ini" + * @param create if true, path is returned even if file is not found. Otherwise NULL if path not found. + * @param mode which mode to use + */ + static char *find_config_file(const char *filename, bool create=true, int mode=USER); + + + /** + * (re)read file. NOTE: Deletes current entries from this Fl_Config object. + * @param create if true, file is created if it doesn't exists. + * @see filename() + */ + bool read_file(bool create = true); + + /** + * Flush entries to file. + * Returns true on success. + * @see filename() + */ + bool flush(); + + /** Returns current filename. */ + const char* filename() const { return m_filename; } + /** Set new filename. You need to call read_file() to get new entries. */ + void filename(const char *filename) { strncpy(m_filename, filename, strlen(filename)); } + /** Set new filename. You need to call read_file() to get new entries. */ +// void filename(const Fl_String &filename) { m_filename = filename; } + + /** Returns current vendor name. */ + const char* vendor() const { return m_vendor; } + /** Set new vendor name. */ + void vendor(const char *vendor) { strncpy(m_vendor, vendor, strlen(vendor)); } + /** Set new vendor name. */ +// void vendor(const Fl_String &vendor) { m_vendor = vendor; } + + /** Returns current application name. */ + const char* application() const { return m_app; } + /** Set new application name. */ + void application(const char *app) { strncpy(m_app, app, strlen(app)); } + /** Set new application name. */ +// void application(const Fl_String &app) { m_app = app; } + + /** + * Returns true, if data changed. + * call flush() to sync changes to file + * @see flush() + */ + bool is_changed() const { return m_changed; } + + /** + * Set changed, forces flush() to write file. + * Even if it is not changed. + */ + void set_changed() { m_changed = true; } + + /** + * Returns last error happened. + */ + int error() const { return m_error; } + + /** + * Reset error, normally you don't need to call this. + */ + void reset_error() { m_error = 0; } + + /** + * Return string presentation for last happened error. + */ + const char *strerror() const { return EDE_Config::strerror(m_error); } + + /** + * Return error string, associated with 'errnum' + */ + static const char *strerror(int errnum); + + /** + * Create new section. You can pass full path as section name. + * For example: create_section("/path/to/my/section"); + * All nested sections are created automatically. + * + * Returns pointer to created section, NULL if failed. + */ +// EDE_Config_Section *create_section(const char *path) { char* tmp(path); return create_section(tmp); } + + /** + * Create new section. You can pass full path as section name. + * For example: create_section("/path/to/my/section"); + * All nested sections are created automatically. + * + * Returns pointer to created section, NULL if failed. + */ + EDE_Config_Section *create_section(const char* path); + + /** + * Find section. You can pass full path as section name. + * For example: find_section("/path/to/my/section"); + * + * Returns pointer to found section, NULL if not found. + * + * @param perfect_match is true, it returns NULL if no exact section found. Otherwise it returns last found section in path. + */ + EDE_Config_Section *find_section(const char *path, bool perfect_match=true) const; + + /** + * Return child sections of section specified 'secpath' + */ + EDE_Config_Sections *section_list(const char *secpath) const { EDE_Config_Section *s=find_section(secpath); return s ? (&s->sections()) : 0; } + + /** + * Return entries of section specified 'secpath' + */ + EDE_Config_Lines *line_list(const char *secpath) const { EDE_Config_Section *s=find_section(secpath); return s ? (&s->lines()) : 0; } + + /** + * Set default section for read/write operations. + * NOTE: section is created, if it's not found.
+ * NOTE: You can pass path to section e.g "/path/to/my/section" + */ + void set_section(const char *secpath) { set_section(create_section(secpath)); } + + /** + * Set default section for read/write operations. + */ + void set_section(EDE_Config_Section *sec) { m_cur_sec = sec; } + + /** + * Remove entry associated with 'key' from section. + * NOTE: You can pass path to section e.g "/path/to/my/section" + */ + void remove_key(const char *section, const char *key); + + /** + * Remove section specified by 'section'. + * NOTE: You can pass path to section e.g "/path/to/my/section" + */ + void remove_sec(const char *section); + + + /** + * Read Fl_String entry from config. + * Returns CONF_SUCCESS on success, otherwise errorcode. + * NOTE: This function assumes that current section is set with set_section(). + * + * @param key Key to entry. + * @param ret Result is stored to this. + * @param def_value Default value for ret, if not found. + */ +// int read(const char *key, char* ret, const char *def_value) { return _read_string(m_cur_sec, key, ret, def_value); } + + /** + * Read char* entry from config. + * Returns CONF_SUCCESS on success, otherwise errorcode. + * NOTE: This function assumes that current section is set with set_section(). + * + * @param key Key to entry. + * @param ret Result is stored to this. + * @param def_value Default value for ret, if not found. + * @param size of 'ret' char* array. + */ + int read(const char *key, char *ret, const char *def_value, int size) { return _read_string(m_cur_sec, key, ret, def_value, size); } + + /** + * Read char* entry from config. + * Returns CONF_SUCCESS on success, otherwise errorcode. + * NOTE: 'ret' is allocated by Fl_Confing, user MUST free 'ret' by calling free() function. + * NOTE: This function assumes that current section is set with set_section(). + * + * @param key Key to entry. + * @param ret Result is stored to this. + * @param def_value Default value for ret, if not found. + */ + int read(const char *key, char *&ret, const char *def_value=0) { return _read_string(m_cur_sec, key, ret, def_value); } + + /** + * Read long entry from config. + * Returns CONF_SUCCESS on success, otherwise errorcode. + * NOTE: This function assumes that current section is set with set_section(). + * + * @param key Key to entry. + * @param ret Result is stored to this. + * @param def_value Default value for ret, if not found. + */ + int read(const char *key, long &ret, long def_value=0) { return _read_long(m_cur_sec, key, ret, def_value); } + + /** + * Read int entry from config. + * Returns CONF_SUCCESS on success, otherwise errorcode. + * NOTE: This function assumes that current section is set with set_section(). + * + * @param key Key to entry. + * @param ret Result is stored to this. + * @param def_value Default value for ret, if not found. + */ + int read(const char *key, int &ret, int def_value=0) { return _read_int(m_cur_sec, key, ret, def_value); } + + /** + * Read float entry from config. + * Returns CONF_SUCCESS on success, otherwise errorcode. + * NOTE: This function assumes that current section is set with set_section(). + * + * @param key Key to entry. + * @param ret Result is stored to this. + * @param def_value Default value for ret, if not found. + */ + int read(const char *key, float &ret, float def_value=0) { return _read_float(m_cur_sec, key, ret, def_value); } + + /** + * Read double entry from config. + * Returns CONF_SUCCESS on success, otherwise errorcode. + * NOTE: This function assumes that current section is set with set_section(). + * + * @param key Key to entry. + * @param ret Result is stored to this. + * @param def_value Default value for ret, if not found. + */ + int read(const char *key, double &ret, double def_value=0) { return _read_double(m_cur_sec, key, ret, def_value); } + + /** + * Read bool entry from config. + * Returns CONF_SUCCESS on success, otherwise errorcode. + * NOTE: This function assumes that current section is set with set_section(). + * + * @param key Key to entry. + * @param ret Result is stored to this. + * @param def_value Default value for ret, if not found. + */ + int read(const char *key, bool &ret, bool def_value=0) { return _read_bool(m_cur_sec, key, ret, def_value); } + + /** + * Read Fl_Color entry from config. + * Returns CONF_SUCCESS on success, otherwise errorcode. + * NOTE: This function assumes that current section is set with set_section(). + * + * @param key Key to entry. + * @param ret Result is stored to this. + * @param def_value Default value for ret, if not found. + */ + int read(const char *key, fltk::Color &ret, fltk::Color def_value=0) { return _read_color(m_cur_sec, key, ret, def_value); } + + + /** + * Write Fl_String entry to config. You must call flush() to sunc changes to file. + * Returns CONF_SUCCESS on success, otherwise errorcode. + * NOTE: This function assumes that current section is set with set_section(). + * + * @param key Key to entry. + * @param value value to set. if entry with 'key' exists, value is replaced. + */ +// int write(const char *key, const Fl_String &value) { return _write_string(m_cur_sec, key, value); } + + /** + * Write const char* entry to config. You must call flush() to sunc changes to file. + * Returns CONF_SUCCESS on success, otherwise errorcode. + * NOTE: This function assumes that current section is set with set_section(). + * + * @param key Key to entry. + * @param value value to set. if entry with 'key' exists, value is replaced. + */ + int write(const char *key, const char *value) { return _write_string(m_cur_sec, key, value); } + + /** + * Write long entry to config. You must call flush() to sunc changes to file. + * Returns CONF_SUCCESS on success, otherwise errorcode. + * NOTE: This function assumes that current section is set with set_section(). + * + * @param key Key to entry. + * @param value value to set. if entry with 'key' exists, value is replaced. + */ + int write(const char *key, const long value) { return _write_long(m_cur_sec, key, value); } + + /** + * Write int entry to config. You must call flush() to sunc changes to file. + * Returns CONF_SUCCESS on success, otherwise errorcode. + * NOTE: This function assumes that current section is set with set_section(). + * + * @param key Key to entry. + * @param value value to set. if entry with 'key' exists, value is replaced. + */ + int write(const char *key, const int value) { return _write_int(m_cur_sec, key, value); } + + /** + * Write float entry to config. You must call flush() to sunc changes to file. + * Returns CONF_SUCCESS on success, otherwise errorcode. + * NOTE: This function assumes that current section is set with set_section(). + * + * @param key Key to entry. + * @param value value to set. if entry with 'key' exists, value is replaced. + */ + int write(const char *key, const float value) { return _write_float(m_cur_sec, key, value); } + + /** + * Write double entry to config. You must call flush() to sunc changes to file. + * Returns CONF_SUCCESS on success, otherwise errorcode. + * NOTE: This function assumes that current section is set with set_section(). + * + * @param key Key to entry. + * @param value value to set. if entry with 'key' exists, value is replaced. + */ + int write(const char *key, const double value) { return _write_double(m_cur_sec, key, value); } + + /** + * Write bool entry to config. You must call flush() to sunc changes to file. + * Returns CONF_SUCCESS on success, otherwise errorcode. + * NOTE: This function assumes that current section is set with set_section(). + * + * @param key Key to entry. + * @param value value to set. if entry with 'key' exists, value is replaced. + */ + int write(const char *key, const bool value) { return _write_bool(m_cur_sec, key, value); } + + /** + * Write Fl_Color entry to config. You must call flush() to sunc changes to file. + * Returns CONF_SUCCESS on success, otherwise errorcode. + * NOTE: This function assumes that current section is set with set_section(). + * + * @param key Key to entry. + * @param value value to set. if entry with 'key' exists, value is replaced. + */ + int write(const char *key, const fltk::Color value) { return _write_color(m_cur_sec, key, value); } + + + /** + * Read Fl_String entry from config. + * Returns CONF_SUCCESS on success, otherwise errorcode. + * NOTE: section must be set as first parameter! + * + * @param section Section for entry + * @param key Key to entry. + * @param ret Result is stored to this. + * @param def_value Default value for ret, if not found. + */ +// int get(const char *section, const char *key, Fl_String &ret, const char *def_value) { return _read_string(find_section(section), key, ret, def_value); } + + /** + * Read char* entry from config. + * Returns CONF_SUCCESS on success, otherwise errorcode. + * NOTE: section must be set as first parameter! + * + * @param section Section for entry + * @param key Key to entry. + * @param ret Result is stored to this. + * @param def_value Default value for ret, if not found. + */ + int get(const char *section, const char *key, char *ret, const char *def_value, int size) { return _read_string(find_section(section), key, ret, def_value, size); } + + /** + * Read char* entry from config. + * Returns CONF_SUCCESS on success, otherwise errorcode. + * NOTE: 'ret' is allocated by Fl_Confing, user MUST free 'ret' by calling free() function. + * NOTE: section must be set as first parameter! + * + * @param section Section for entry + * @param key Key to entry. + * @param ret Result is stored to this. + * @param def_value Default value for ret, if not found. + */ + int get(const char *section, const char *key, char *&ret, const char *def_value=0) { return _read_string(find_section(section), key, ret, def_value); } + + /** + * Read long entry from config. + * Returns CONF_SUCCESS on success, otherwise errorcode. + * NOTE: section must be set as first parameter! + * + * @param section Section for entry + * @param key Key to entry. + * @param ret Result is stored to this. + * @param def_value Default value for ret, if not found. + */ + int get(const char *section, const char *key, long &ret, long def_value=0) { return _read_long(find_section(section), key, ret, def_value); } + + /** + * Read int entry from config. + * Returns CONF_SUCCESS on success, otherwise errorcode. + * NOTE: section must be set as first parameter! + * + * @param section Section for entry + * @param key Key to entry. + * @param ret Result is stored to this. + * @param def_value Default value for ret, if not found. + */ + int get(const char *section, const char *key, int &ret, int def_value=0) { return _read_int(find_section(section), key, ret, def_value); } + + /** + * Read float entry from config. + * Returns CONF_SUCCESS on success, otherwise errorcode. + * NOTE: section must be set as first parameter! + * + * @param section Section for entry + * @param key Key to entry. + * @param ret Result is stored to this. + * @param def_value Default value for ret, if not found. + */ + int get(const char *section, const char *key, float &ret, float def_value=0) { return _read_float(find_section(section), key, ret, def_value); } + + /** + * Read double entry from config. + * Returns CONF_SUCCESS on success, otherwise errorcode. + * NOTE: section must be set as first parameter! + * + * @param section Section for entry + * @param key Key to entry. + * @param ret Result is stored to this. + * @param def_value Default value for ret, if not found. + */ + int get(const char *section, const char *key, double &ret, double def_value=0) { return _read_double(find_section(section), key, ret, def_value); } + + /** + * Read bool entry from config. + * Returns CONF_SUCCESS on success, otherwise errorcode. + * NOTE: section must be set as first parameter! + * + * @param section Section for entry + * @param key Key to entry. + * @param ret Result is stored to this. + * @param def_value Default value for ret, if not found. + */ + int get(const char *section, const char *key, bool &ret, bool def_value=0) { return _read_bool(find_section(section), key, ret, def_value); } + + /** + * Read Fl_Color entry from config. + * Returns CONF_SUCCESS on success, otherwise errorcode. + * NOTE: section must be set as first parameter! + * + * @param section Section for entry + * @param key Key to entry. + * @param ret Result is stored to this. + * @param def_value Default value for ret, if not found. + */ + int get(const char *section, const char *key, fltk::Color &ret, fltk::Color def_value=0) { return _read_color(find_section(section), key, ret, def_value); } + + + /** + * Write Fl_String entry to config. You must call flush() to sunc changes to file. + * Returns CONF_SUCCESS on success, otherwise errorcode. + * NOTE: section must be set as first parameter! + * + * @param section Section for entry + * @param key Key to entry. + * @param value value to set. if entry with 'key' exists, value is replaced. + */ +// int set(const char *section, const char *key, const Fl_String &value) { return _write_string(create_section(section), key, value); } + + /** + * Write const char *entry to config. You must call flush() to sunc changes to file. + * Returns CONF_SUCCESS on success, otherwise errorcode. + * NOTE: section must be set as first parameter! + * + * @param section Section for entry + * @param key Key to entry. + * @param value value to set. if entry with 'key' exists, value is replaced. + */ + int set(const char *section, const char *key, const char *value) { return _write_string(create_section(section), key, value); } + + /** + * Write long entry to config. You must call flush() to sunc changes to file. + * Returns CONF_SUCCESS on success, otherwise errorcode. + * NOTE: section must be set as first parameter! + * + * @param section Section for entry + * @param key Key to entry. + * @param value value to set. if entry with 'key' exists, value is replaced. + */ + int set(const char *section, const char *key, const long value) { return _write_long(create_section(section), key, value); } + + /** + * Write int entry to config. You must call flush() to sunc changes to file. + * Returns CONF_SUCCESS on success, otherwise errorcode. + * NOTE: section must be set as first parameter! + * + * @param section Section for entry + * @param key Key to entry. + * @param value value to set. if entry with 'key' exists, value is replaced. + */ + int set(const char *section, const char *key, const int value) { return _write_int(create_section(section), key, value); } + + /** + * Write float entry to config. You must call flush() to sunc changes to file. + * Returns CONF_SUCCESS on success, otherwise errorcode. + * NOTE: section must be set as first parameter! + * + * @param section Section for entry + * @param key Key to entry. + * @param value value to set. if entry with 'key' exists, value is replaced. + */ + int set(const char *section, const char *key, const float value) { return _write_float(create_section(section), key, value); } + + /** + * Write bool entry to config. You must call flush() to sunc changes to file. + * Returns CONF_SUCCESS on success, otherwise errorcode. + * NOTE: section must be set as first parameter! + * + * @param section Section for entry + * @param key Key to entry. + * @param value value to set. if entry with 'key' exists, value is replaced. + */ + int set(const char *section, const char *key, const bool value) { return _write_double(create_section(section), key, value); } + + /** + * Write Fl_Color entry to config. You must call flush() to sunc changes to file. + * Returns CONF_SUCCESS on success, otherwise errorcode. + * NOTE: section must be set as first parameter! + * + * @param section Section for entry + * @param key Key to entry. + * @param value value to set. if entry with 'key' exists, value is replaced. + */ + int set(const char *section, const char *key, const fltk::Color value) { return _write_color(create_section(section), key, value); } + +private: + int m_error; + char* m_filename; + char *m_vendor, *m_app; + + EDE_Config_Section *m_cur_sec; + bool m_changed; + + //int _read_string(Fl_Config_Section *s, const char *key, Fl_String &ret, const char *def_value); + int _read_string(EDE_Config_Section *s, const char *key, char *ret, const char *def_value, int size); + int _read_string(EDE_Config_Section *s, const char *key, char *&ret, const char *def_value); + int _read_long (EDE_Config_Section *s, const char *key, long &ret, long def_value); + int _read_int (EDE_Config_Section *s, const char *key, int &ret, int def_value); + int _read_float (EDE_Config_Section *s, const char *key, float &ret, float def_value); + int _read_double(EDE_Config_Section *s, const char *key, double &ret, double def_value); + int _read_bool (EDE_Config_Section *s, const char *key, bool &ret, bool def_value); + int _read_color (EDE_Config_Section *s, const char *key, fltk::Color &ret, fltk::Color def_value); + + //int _write_string(Fl_Config_Section *s, const char *key, const Fl_String &value); + int _write_string(EDE_Config_Section *s, const char *key, const char *value); + int _write_long (EDE_Config_Section *s, const char *key, const long value); + int _write_int (EDE_Config_Section *s, const char *key, const int value); + int _write_float (EDE_Config_Section *s, const char *key, const float value); + int _write_double(EDE_Config_Section *s, const char *key, const double value); + int _write_bool (EDE_Config_Section *s, const char *key, const bool value); + int _write_color (EDE_Config_Section *s, const char *key, const fltk::Color value); +}; + +// Backward compatibility... +static inline const char* ede_find_config_file(const char *filename, bool create=true) { + return EDE_Config::find_config_file(filename, create, EDE_Config::USER); +} + +#endif diff --git a/eworkpanel/Jamfile b/eworkpanel/Jamfile new file mode 100644 index 0000000..405adf3 --- /dev/null +++ b/eworkpanel/Jamfile @@ -0,0 +1,15 @@ +SubDir TOP eworkpanel ; + +SOURCE = aboutdialog.cpp + logoutdialog.cpp + panelbutton.cpp + keyboardchooser.cpp + taskbutton.cpp + workpanel.cpp + item.cpp + cpumonitor.cpp + dock.cpp + mainmenu.cpp + mainmenu_scan.cpp ; + +MakeEfltkProgram eworkpanel : $(SOURCE) ; diff --git a/eworkpanel/Makefile b/eworkpanel/Makefile new file mode 100644 index 0000000..c89ebfc --- /dev/null +++ b/eworkpanel/Makefile @@ -0,0 +1,22 @@ + +CPPFILES = aboutdialog.cpp logoutdialog.cpp panelbutton.cpp keyboardchooser.cpp taskbutton.cpp workpanel.cpp item.cpp cpumonitor.cpp dock.cpp mainmenu.cpp mainmenu_scan.cpp +TARGET = eworkpanel + +POFILES = locale/ru.po\ + locale/sr.po\ + locale/sk.po\ + locale/hu.po\ + +include ../makeinclude + +install: + $(INSTALL_PROGRAM) $(TARGET) $(bindir) + $(INSTALL_LOCALE) + +uninstall: + $(RM) $(bindir)/$(TARGET) + +clean: + $(RM) $(TARGET) + $(RM) *.o + diff --git a/eworkpanel/NLS.h b/eworkpanel/NLS.h new file mode 100644 index 0000000..cf1ce3b --- /dev/null +++ b/eworkpanel/NLS.h @@ -0,0 +1,12 @@ +// Native language support - under construction +// Copyright (c) 2000. - 2005. EDE Authors +// This program is licenced under terms of the +// GNU General Public Licence version 2 or newer. +// See COPYING for details. + +#ifndef _NLS_H_ +#define _NLS_H_ + +#define _(s) s + +#endif diff --git a/eworkpanel/aboutdialog.cpp b/eworkpanel/aboutdialog.cpp new file mode 100644 index 0000000..18cc409 --- /dev/null +++ b/eworkpanel/aboutdialog.cpp @@ -0,0 +1,54 @@ +// generated by Extended Fast Light User Interface Designer (eFluid) version 2.0003 + +#include "aboutdialog.h" +//#include +#include "NLS.h" +#include +static fltk::Window* mAboutDialogWindow; + +static void cb_OK(Fl_Button*, void*) { + mAboutDialogWindow->hide(); +} + +void AboutDialog(fltk::Widget*, void*) { + fltk::Window* w; + {fltk::Window* o = mAboutDialogWindow = new fltk::Window(355, 305, _("About Equinox Desktop Environment")); + w = o; + o->shortcut(0xff1b); + {fltk::Box* o = new fltk::Box(5, 10, 345, 35, _("Equinox Desktop Environment "PACKAGE_VERSION)); + o->box(fltk::BORDER_FRAME); + o->label_font(fl_fonts+1); + o->color((fltk::Color)56); + o->label_color((Fl_Color)32); + o->label_size(16); +// o->align(FL_ALIGN_INSIDE|FL_ALIGN_WRAP); + } + {fltk::Box* o = new fltk::Box(5, 105, 345, 135, _(" This program is based in part on the work of FLTK project (www.fltk.org). Th\ +is program is free software, you can redistribute it and/or modify it under th\ +e terms of GNU General Public License as published by the Free Software Founda\ +tion, either version 2 of the License, or (at your option) any later version. \ +This program is distributed in the hope that it will be useful, but WITHOUT AN\ +Y WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FO\ +R A PARTICULAR PURPOSE. See the GNU General Public License for more details. Y\ +ou should have received a copy of the GNU General Public Licence along with th\ +is program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave,\ + Cambridge, MA 02139, USA")); + o->label_size(10); +// o->align(FL_ALIGN_TOP|FL_ALIGN_INSIDE|FL_ALIGN_WRAP); + } + {fltk::Button* o = new fltk::Button(270, 275, 80, 25, _("&OK")); + o->callback((fltk::Callback*)cb_OK); +// o->align(FL_ALIGN_WRAP); + } + new fltk::Divider(5, 260, 345, 15, _("label")); + {fltk::Box* o = new fltk::Box(5, 70, 345, 15, _("(C)Copyright 2000-2004 EDE Authors")); + o->label_size(10); + o->align(FL_ALIGN_TOP|FL_ALIGN_INSIDE|FL_ALIGN_WRAP); + } +// o->set_modal(); + o->end(); + o->resizable(o); + } + mAboutDialogWindow->end(); + mAboutDialogWindow->show(); +} diff --git a/eworkpanel/aboutdialog.fld b/eworkpanel/aboutdialog.fld new file mode 100644 index 0000000..7ff2781 --- /dev/null +++ b/eworkpanel/aboutdialog.fld @@ -0,0 +1,44 @@ +# data file for the eFLTK User Interface Designer (eFLUID) +version 2.0003 +images_dir ./ +i18n +header_name {.h} +code_name {.cpp} +gridx 5 +gridy 5 +snap 3 +decl {// Work Panel for EDE is (C) Copyright 2000-2002 by Martin Pekar and others, this program is provided under the terms of GNU GPL v.2, see file COPYING for more information.} {} + +decl {\#include } {} + +Function {AboutDialog(Fl_Widget*, void*)} {open return_type void +} { + Fl_Window mAboutDialogWindow { + label {About Equinox Desktop Environment} open + private xywh {386 286 355 305} resizable modal visible + } { + Fl_Box {} { + label {Equinox Desktop Environment v1.0.1.1} selected + private xywh {5 10 345 35} align FL_ALIGN_INSIDE|FL_ALIGN_WRAP box BORDER_FRAME label_font 1 color 56 label_color 32 label_size 16 + } + Fl_Box {} { + label { This program is based in part on the work of FLTK project (www.fltk.org). This program is free software, you can redistribute it and/or modify it under the terms of GNU General Public License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any later version. This program 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 General Public License for more details. You should have received a copy of the GNU General Public Licence along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA} + private xywh {5 105 345 135} align FL_ALIGN_TOP|FL_ALIGN_INSIDE|FL_ALIGN_WRAP label_size 10 + } + Fl_Button {} { + label {&OK} + callback {mAboutDialogWindow->hide();} + private xywh {270 275 80 25} align FL_ALIGN_WRAP + } + Fl_Divider {} { + label label + xywh {5 260 345 15} + } + Fl_Box {} { + label {(C)Copyright 2000-2004 EDE Authors} + private xywh {5 70 345 15} align FL_ALIGN_TOP|FL_ALIGN_INSIDE|FL_ALIGN_WRAP label_size 10 + } + } + code {mAboutDialogWindow->end(); +mAboutDialogWindow->show();} {} +} diff --git a/eworkpanel/aboutdialog.h b/eworkpanel/aboutdialog.h new file mode 100644 index 0000000..e58ca7f --- /dev/null +++ b/eworkpanel/aboutdialog.h @@ -0,0 +1,22 @@ +// generated by Extended Fast Light User Interface Designer (eFluid) version 2.0003 + +#ifndef _ABOUTDIALOG_H_ +#define _ABOUTDIALOG_H_ + +/*#include +#include +#include +#include +#include +#include */ +#include +//#include +#include +#include +#include +#include + + +void AboutDialog(fltk::Widget*, void*); + +#endif diff --git a/eworkpanel/cpumonitor.cpp b/eworkpanel/cpumonitor.cpp new file mode 100644 index 0000000..03402a9 --- /dev/null +++ b/eworkpanel/cpumonitor.cpp @@ -0,0 +1,390 @@ +/* + * IceWM + * + * Copyright (C) 1998-2001 Marko Macek + * + * CPU Status + * + * For eWorkPanel by Mikko Lahteenmaki 2003 + */ +#include "cpumonitor.h" + +#include +#include +#include +#include +#include +#include +#include + +#if defined(linux) +//#include +#include +#endif + +#ifdef HAVE_KSTAT_H +#include +#endif + +#if (defined(linux) || defined(HAVE_KSTAT_H)) + +#define UPDATE_INTERVAL .5f + +void cpu_timeout_cb(void *d) { + ((CPUMonitor*)d)->update_status(); + fltk::repeat_timeout(UPDATE_INTERVAL, cpu_timeout_cb, d); +} + +CPUMonitor::CPUMonitor() +: fltk::Widget(0,0,30,0) +{ + box(fltk::THIN_DOWN_BOX); + //box(FL_BORDER_BOX); + + m_draw_label = true; + m_samples = m_old_samples = -1; + cpu = 0; + + colors[IWM_USER] = FL_RED; + colors[IWM_NICE] = FL_GREEN; + colors[IWM_SYS] = FL_DARK3; + colors[IWM_IDLE] = FL_NO_COLOR; + + fltk::add_timeout(UPDATE_INTERVAL, cpu_timeout_cb, this); +} + +CPUMonitor::~CPUMonitor() { + clear(); +} + +void CPUMonitor::clear() +{ + if(!cpu) return; + + for (int i=0; i < samples(); i++) { + delete cpu[i]; cpu[i] = 0; + } + delete cpu; + cpu = 0; + + m_old_samples = -1; +} + +void CPUMonitor::draw() +{ + if(!cpu) { + fltk::push_clip(0,0,w(),h()); + parent()->draw_group_box(); + draw_frame(); + fltk::pop_clip(); + return; + } + + if(colors[IWM_IDLE] == FL_NO_COLOR) { + fltk::push_clip(0,0,w(),h()); + parent()->draw_group_box(); + fltk::pop_clip(); + } + draw_frame(); + + int n, h = height() - box()->dh(); + + int c=0; + for (int i=box()->dx(); i < samples()+box()->dx(); i++) + { + int user = cpu[c][IWM_USER]; + int nice = cpu[c][IWM_NICE]; + int sys = cpu[c][IWM_SYS]; + int idle = cpu[c][IWM_IDLE]; + int total = user + sys + nice + idle; + + c++; + + int y = height() - 1 - box()->dy(); + + if (total > 0) + { + if (sys) { + n = (h * (total - sys)) / total; // check rounding + if (n >= y) n = y; + if (n < 1) n = 1; + fltk::color(colors[IWM_SYS]); + fltk::line(i, y, i, n); + y = n - 1; + } + + if (nice) { + n = (h * (total - sys - nice))/ total; + if (n >= y) n = y; + if (n < 1) n = 1; + fltk::color(colors[IWM_NICE]); + fltk::line(i, y, i, n); + y = n - 1; + } + + if (user) { + n = (h * (total - sys - nice - user))/ total; + if (n >= y) n = y; + if (n < 1) n = 1; + fltk::color(colors[IWM_USER]); + fltk::line(i, y, i, n); + y = n - 1; + } + } + + if (idle) { + if(colors[IWM_IDLE] != FL_NO_COLOR) + { + fltk::color(colors[IWM_IDLE]); + fltk::line(i, box()->dy(), i, y); + } + } + } + + int cpu_percent = cpu[samples()-1][0]*2; + if(m_draw_label && cpu_percent<=100) { + char l[5]; + strcpy(l, itoa(cpu_percent)); + strcat(l, '%'); + label(l); + draw_inside_label(); + } +} + +void CPUMonitor::layout() +{ + label_size(h()/2); + + w(h()*2); + m_samples = w() - box()->dw(); + + if(!cpu || m_old_samples != m_samples) { + clear(); + + cpu = new int*[m_samples]; + for(int i=0; i < m_samples; i++) { + cpu[i] = new int[IWM_STATES]; + cpu[i][IWM_USER] = cpu[i][IWM_NICE] = cpu[i][IWM_SYS] = 0; + cpu[i][IWM_IDLE] = 1; + } + last_cpu[IWM_USER] = last_cpu[IWM_NICE] = last_cpu[IWM_SYS] = last_cpu[IWM_IDLE] = 0; + + update_status(); + m_old_samples = m_samples; + } + + fltk::Widget::layout(); +} + +void CPUMonitor::update_status() +{ + if(!cpu) return; + + for (int i=1; i < samples(); i++) { + cpu[i - 1][IWM_USER] = cpu[i][IWM_USER]; + cpu[i - 1][IWM_NICE] = cpu[i][IWM_NICE]; + cpu[i - 1][IWM_SYS] = cpu[i][IWM_SYS]; + cpu[i - 1][IWM_IDLE] = cpu[i][IWM_IDLE]; + } + + get_cpu_info(); + + // Update tooltip + char load[255]; + snprintf(load, sizeof(load)-1, + _("CPU Load:\n" + "User: %d%%\n" + "Nice: %d%%\n" + "Sys: %d%%\n" + "Idle: %d%%"), + cpu[samples()-1][0]*2, cpu[samples()-1][1]*2, + cpu[samples()-1][2]*2, cpu[samples()-1][3]*2); + tooltip(load); + + redraw(); +} + +void CPUMonitor::get_cpu_info() +{ + if(!cpu) return; + +#ifdef linux + char *p, buf[128]; + long cur[IWM_STATES]; + int len, fd = open("/proc/stat", O_RDONLY); + + cpu[samples()-1][IWM_USER] = 0; + cpu[samples()-1][IWM_NICE] = 0; + cpu[samples()-1][IWM_SYS] = 0; + cpu[samples()-1][IWM_IDLE] = 0; + + if (fd == -1) + return; + len = read(fd, buf, sizeof(buf) - 1); + if (len != sizeof(buf) - 1) { + close(fd); + return; + } + buf[len] = 0; + + p = buf; + while (*p && (*p < '0' || *p > '9')) + p++; + + for (int i = 0; i < 4; i++) { + cur[i] = strtoul(p, &p, 10); + cpu[samples()-1][i] = cur[i] - last_cpu[i]; + last_cpu[i] = cur[i]; + } + close(fd); +#if 0 + fprintf(stderr, "cpu: %d %d %d %d", + cpu[samples()-1][IWM_USER], cpu[samples()-1][IWM_NICE], + cpu[samples()-1][IWM_SYS], cpu[samples()-1][IWM_IDLE]); +#endif + +#endif /* linux */ + +#ifdef HAVE_KSTAT_H +# ifdef HAVE_OLD_KSTAT +# define ui32 ul +#endif + + static kstat_ctl_t *kc = NULL; + static kid_t kcid; + kid_t new_kcid; + kstat_t *ks = NULL; + kstat_named_t *kn = NULL; + int changed,change,total_change; + unsigned int thiscpu; + register int i,j; + static unsigned int ncpus; + static kstat_t **cpu_ks=NULL; + static cpu_stat_t *cpu_stat=NULL; + static long cp_old[CPU_STATES]; + long cp_time[CPU_STATES], cp_pct[CPU_STATES]; + + /* Initialize the kstat */ + if (!kc) { + kc = kstat_open(); + if (!kc) { + perror("kstat_open "); + return;/* FIXME : need err handler? */ + } + changed = 1; + kcid = kc->kc_chain_id; + fcntl(kc->kc_kd, F_SETFD, FD_CLOEXEC); + } else { + changed = 0; + } + /* Fetch the kstat data. Whenever we detect that the kstat has been + changed by the kernel, we 'continue' and restart this loop. + Otherwise, we break out at the end. */ + while (1) { + new_kcid = kstat_chain_update(kc); + if (new_kcid) { + changed = 1; + kcid = new_kcid; + } + if (new_kcid < 0) { + perror("kstat_chain_update "); + return;/* FIXME : need err handler? */ + } + if (new_kcid != 0) + continue; /* kstat changed - start over */ + ks = kstat_lookup(kc, "unix", 0, "system_misc"); + if (kstat_read(kc, ks, 0) == -1) { + perror("kstat_read "); + return;/* FIXME : need err handler? */ + } + if (changed) { + /* the kstat has changed - reread the data */ + thiscpu = 0; ncpus = 0; + kn = (kstat_named_t *)kstat_data_lookup(ks, "ncpus"); + if ((kn) && (kn->value.ui32 > ncpus)) { + /* I guess I should be using 'new' here... FIXME */ + ncpus = kn->value.ui32; + if ((cpu_ks = (kstat_t **) + realloc(cpu_ks, ncpus * sizeof(kstat_t *))) == NULL) + { + perror("realloc: cpu_ks "); + return;/* FIXME : need err handler? */ + } + if ((cpu_stat = (cpu_stat_t *) + realloc(cpu_stat, ncpus * sizeof(cpu_stat_t))) == NULL) + { + perror("realloc: cpu_stat "); + return;/* FIXME : need err handler? */ + } + } + for (ks = kc->kc_chain; ks; ks = ks->ks_next) { + if (strncmp(ks->ks_name, "cpu_stat", 8) == 0) { + new_kcid = kstat_read(kc, ks, NULL); + if (new_kcid < 0) { + perror("kstat_read "); + return;/* FIXME : need err handler? */ + } + if (new_kcid != kcid) + break; + cpu_ks[thiscpu] = ks; + thiscpu++; + if (thiscpu > ncpus) { + fprintf(stderr, "kstat finds too many cpus: should be %d", ncpus); + return;/* FIXME : need err handler? */ + } + } + } + if (new_kcid != kcid) + continue; + ncpus = thiscpu; + changed = 0; + } + for (i = 0; i<(int)ncpus; i++) { + new_kcid = kstat_read(kc, cpu_ks[i], &cpu_stat[i]); + if (new_kcid < 0) { + perror("kstat_read "); + return;/* FIXME : need err handler? */ + } + } + if (new_kcid != kcid) + continue; /* kstat changed - start over */ + else + break; + } /* while (1) */ + + /* Initialize the cp_time array */ + for (i = 0; i < CPU_STATES; i++) + cp_time[i] = 0L; + for (i = 0; i < (int)ncpus; i++) { + for (j = 0; j < CPU_STATES; j++) + cp_time[j] += (long) cpu_stat[i].cpu_sysinfo.cpu[j]; + } + /* calculate the percent utilization for each category */ + /* cpu_state calculations */ + total_change = 0; + for (i = 0; i < CPU_STATES; i++) { + change = cp_time[i] - cp_old[i]; + if (change < 0) /* The counter rolled over */ + change = (int) ((unsigned long)cp_time[i] - (unsigned long)cp_old[i]); + cp_pct[i] = change; + total_change += change; + cp_old[i] = cp_time[i]; /* copy the data for the next run */ + } + /* this percent calculation isn't really needed, since the repaint + routine takes care of this... */ + for (i = 0; i < CPU_STATES; i++) + cp_pct[i] = + ((total_change > 0) ? + ((int)(((1000.0 * (float)cp_pct[i]) / total_change) + 0.5)) : + ((i == CPU_IDLE) ? (1000) : (0))); + + /* OK, we've got the data. Now copy it to cpu[][] */ + cpu[samples()-1][IWM_USER] = cp_pct[CPU_USER]; + cpu[samples()-1][IWM_NICE] = cp_pct[CPU_WAIT]; + cpu[samples()-1][IWM_SYS] = cp_pct[CPU_KERNEL]; + cpu[samples()-1][IWM_IDLE] = cp_pct[CPU_IDLE]; + +#endif /* have_kstat_h */ +} +#endif + diff --git a/eworkpanel/cpumonitor.h b/eworkpanel/cpumonitor.h new file mode 100644 index 0000000..a4aa3dd --- /dev/null +++ b/eworkpanel/cpumonitor.h @@ -0,0 +1,57 @@ +#ifndef _CPUMONITOR_H_ +#define _CPUMONITOR_H_ + +#include + +#if (defined(linux) || defined(HAVE_KSTAT_H)) + +#ifdef HAVE_KSTAT_H +#include +#include +#endif /* have_kstat_h */ + +enum { + IWM_USER = 0, + IWM_NICE, + IWM_SYS, + IWM_IDLE, + IWM_STATES +}; + +/*#include +#include +#include +#include */ +#include +#include +#include */ + +class CPUMonitor : public fltk::Widget { +public: + CPUMonitor(); + virtual ~CPUMonitor(); + + void clear(); + + void update_status(); + void get_cpu_info(); + + virtual void draw(); + virtual void layout(); + virtual void preferred_size(int &w, int &h) { w=this->w(); } + + int samples() const { return m_samples; } + +private: + bool m_draw_label; + int m_old_samples; + int m_samples; + + int **cpu; + long last_cpu[IWM_STATES]; + fltk::Color colors[IWM_STATES]; +}; + +#endif + +#endif diff --git a/eworkpanel/dock.cpp b/eworkpanel/dock.cpp new file mode 100644 index 0000000..622c7fa --- /dev/null +++ b/eworkpanel/dock.cpp @@ -0,0 +1,40 @@ +#include "dock.h" +//#include +#include + +Dock::Dock() + : fltk::Group(0,0,0,0) +{ + //box(FL_THIN_DOWN_BOX); + color(FL_INVALID_COLOR); //Draw with parent color + + layout_align(FL_ALIGN_RIGHT); + layout_spacing(1); + + end(); +} + +void Dock::add_to_tray(Fl_Widget *w) +{ + insert(*w, 0); + + w->layout_align(FL_ALIGN_LEFT); + w->show(); + + int new_width = this->w() + w->width() + layout_spacing(); + this->w(new_width); + + parent()->relayout(); + fltk::redraw(); +} + +void Dock::remove_from_tray(Fl_Widget *w) +{ + remove(w); + + int new_width = this->w() - w->width() - layout_spacing(); + this->w(new_width); + + parent()->relayout(); + fltk::redraw(); +} diff --git a/eworkpanel/dock.h b/eworkpanel/dock.h new file mode 100644 index 0000000..bcda8e4 --- /dev/null +++ b/eworkpanel/dock.h @@ -0,0 +1,16 @@ +#ifndef _DOCK_H_ +#define _DOCK_H_ + +//#include +#include + +class Dock : public fltk::Group +{ +public: + Dock(); + + void add_to_tray(fltk::Widget *w); + void remove_from_tray(fltk::Widget *w); +}; + +#endif diff --git a/eworkpanel/icons/about.xpm b/eworkpanel/icons/about.xpm new file mode 100644 index 0000000..49d513a --- /dev/null +++ b/eworkpanel/icons/about.xpm @@ -0,0 +1,170 @@ +/* XPM */ +static char * about_xpm[] = { +"16 16 151 2", +" c None", +". c #939393", +"+ c #818181", +"@ c #7E7E7E", +"# c #797878", +"$ c #A2A2A2", +"% c #ACACAC", +"& c #BFBFBF", +"* c #9E9E9E", +"= c #8E8E8E", +"- c #707070", +"; c #4D4D4D", +"> c #323031", +", c #999999", +"' c #FAFAFA", +") c #FFFFFF", +"! c #D3D3D3", +"~ c #888888", +"{ c #C2C2C2", +"] c #C1C1C1", +"^ c #515251", +"/ c #343232", +"( c #535353", +"_ c #C3C3C3", +": c #FBFBFC", +"< c #CCCCCF", +"[ c #9D9DA0", +"} c #EFEFF1", +"| c #1A1A1A", +"1 c #737373", +"2 c #2B2B2B", +"3 c #ABABAB", +"4 c #EAEAEB", +"5 c #E5E5DE", +"6 c #7F7F74", +"7 c #808177", +"8 c #C0BFB4", +"9 c #F4F4F3", +"0 c #AEAFAF", +"a c #070707", +"b c #373536", +"c c #3B3B3B", +"d c #191919", +"e c #5B5B5B", +"f c #B5B5BB", +"g c #D4D4AA", +"h c #F5F651", +"i c #FCF646", +"j c #FADE71", +"k c #C6C4C4", +"l c #2D2D2E", +"m c #000000", +"n c #353535", +"o c #161616", +"p c #040404", +"q c #666666", +"r c #E0E0E1", +"s c #EAEBEC", +"t c #FDFB93", +"u c #FBDD43", +"v c #E2D3BC", +"w c #E1E1E6", +"x c #080808", +"y c #272727", +"z c #282828", +"A c #090909", +"B c #FCFCFC", +"C c #FBFBFD", +"D c #F9F8F5", +"E c #ECE4D4", +"F c #DFE0E4", +"G c #E4E3E3", +"H c #D6D6D6", +"I c #545454", +"J c #121212", +"K c #1D1D1D", +"L c #3A3939", +"M c #141313", +"N c #4B4B4B", +"O c #E4E4E4", +"P c #EDEDED", +"Q c #F5F5F5", +"R c #F7F7F9", +"S c #F2F3F7", +"T c #E9E9E9", +"U c #DADADA", +"V c #CACACA", +"W c #282728", +"X c #171717", +"Y c #2A2828", +"Z c #151415", +"` c #7A7A7A", +" . c #DEDEDE", +".. c #EEEEEE", +"+. c #F0F0F0", +"@. c #EBEBEB", +"#. c #E0E0E0", +"$. c #CCCCCC", +"%. c #B4B4B4", +"&. c #8F9090", +"*. c #454545", +"=. c #808080", +"-. c #D1D1D1", +";. c #DCDCDC", +">. c #E6E6E6", +",. c #D2D2D2", +"'. c #BDBDBD", +"). c #A5A5A5", +"!. c #3E3D3D", +"~. c #898989", +"{. c #C5C6C5", +"]. c #D0D0D0", +"^. c #D9D9D9", +"/. c #ADADAD", +"(. c #7D7E7E", +"_. c #A8A9B4", +":. c #BFC1CA", +"<. c #C6C9CC", +"[. c #C6C6C6", +"}. c #BEBEBE", +"|. c #ACADB0", +"1. c #97989B", +"2. c #818187", +"3. c #4B4C56", +"4. c #C6C379", +"5. c #D5C989", +"6. c #C9BCA4", +"7. c #BAB9BA", +"8. c #B1B1B0", +"9. c #B4B39D", +"0. c #C2C4AD", +"a. c #BDBF93", +"b. c #988C45", +"c. c #FCE35C", +"d. c #FFEB66", +"e. c #FFC846", +"f. c #F99635", +"g. c #D47C49", +"h. c #877F7C", +"i. c #7F7E79", +"j. c #D9AC5D", +"k. c #FDC27A", +"l. c #FAB96C", +"m. c #EE973D", +"n. c #AE5333", +"o. c #895E38", +"p. c #81432A", +"q. c #7C3D37", +"r. c #764033", +"s. c #6A2922", +"t. c #662E2E", +" . + @ # ", +" $ % & * = - ; > ", +" , ' ) ! ~ { ] ^ / ", +" ( _ ) : < [ } ) { | ", +" 1 2 3 4 5 6 7 8 9 0 a b ", +" c d e f g h i j k l m n ", +" o p q r s t u v w @ x y ", +" z m A _ B C D E F G H I J K ", +"L M p N O P Q R S T U V ~ W X Y ", +" Z ` .O ..+.@.#.$.%.&.*. ", +" n =.-.;.O >.#.,.'.).~ !. ", +" ~.{.].^.^.,._ /., (. ", +" _.:.<.[.}.|.1.2.3. ", +" 4.5.6.7.8.9.0.a.b. ", +" c.d.e.f.g.h.i.j.k.l.m.n. ", +" o.p.q. r.s.t. "}; diff --git a/eworkpanel/icons/clean.xpm b/eworkpanel/icons/clean.xpm new file mode 100644 index 0000000..db9832e --- /dev/null +++ b/eworkpanel/icons/clean.xpm @@ -0,0 +1,19 @@ +/* XPM */ +static char * clean_xpm[] = { +"16 15 1 1", +" c None", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" "}; diff --git a/eworkpanel/icons/desktop.xpm b/eworkpanel/icons/desktop.xpm new file mode 100644 index 0000000..acfa25d --- /dev/null +++ b/eworkpanel/icons/desktop.xpm @@ -0,0 +1,208 @@ +/* XPM */ +static char * desktop_xpm[] = { +"16 16 189 2", +" c None", +". c #80AADB", +"+ c #89B2E2", +"@ c #83AFE2", +"# c #7CABE2", +"$ c #74A8E2", +"% c #6DA4E2", +"& c #65A0E2", +"* c #609EE2", +"= c #5E9CE2", +"- c #5E9DE2", +"; c #65A0E4", +"> c #4299E6", +", c #003458", +"' c #8BB3E2", +") c #ADD4FF", +"! c #93C7FF", +"~ c #74B8FF", +"{ c #51A7FF", +"] c #2F95FF", +"^ c #0F86FF", +"/ c #007AFF", +"( c #0074FF", +"_ c #0075FF", +": c #0076FF", +"< c #007DFC", +"[ c #003656", +"} c #91B5E1", +"| c #CDE1F8", +"1 c #C2DBF8", +"2 c #B9D7F8", +"3 c #AFD2F8", +"4 c #A4CDF8", +"5 c #9AC8F8", +"6 c #92C5F8", +"7 c #8EC3F8", +"8 c #8DC2F8", +"9 c #8BC2F8", +"0 c #8AC1F8", +"a c #92C5FA", +"b c #5FB1F4", +"c c #003257", +"d c #9CBCE2", +"e c #FDFEFD", +"f c #F7FFFF", +"g c #F6FFFF", +"h c #F6FBFD", +"i c #F5FBFD", +"j c #F3FCFD", +"k c #F1FAFD", +"l c #EEF9FD", +"m c #EBF8FD", +"n c #E9F7FD", +"o c #F0FBFE", +"p c #8FC9F1", +"q c #003056", +"r c #FCFFFF", +"s c #F7DCBA", +"t c #F6C892", +"u c #F1E0C7", +"v c #F0FFFF", +"w c #EEFDFF", +"x c #E7F7FF", +"y c #E7F9FF", +"z c #E6FAFF", +"A c #E2F8FF", +"B c #E0F8FF", +"C c #E3F6FF", +"D c #84C4F2", +"E c #9BBCE2", +"F c #F9FFFF", +"G c #F6A94B", +"H c #F97700", +"I c #F6BD73", +"J c #BFCFD5", +"K c #B3B9BD", +"L c #E8FBFF", +"M c #C0CCD2", +"N c #A6ACB0", +"O c #A9B1B5", +"P c #A7AFB3", +"Q c #D5E7F1", +"R c #85C8F7", +"S c #9ABCE2", +"T c #F4BE7A", +"U c #F7982B", +"V c #F1CA95", +"W c #D8EDF2", +"X c #D4E2EA", +"Y c #E1F6FF", +"Z c #D4E6F1", +"` c #C9DBE6", +" . c #C8DCE8", +".. c #C6DCE7", +"+. c #D7EFFB", +"@. c #82C4F3", +"#. c #9ABBE2", +"$. c #F4FDFF", +"%. c #ECF9FF", +"&. c #E9F9FF", +"*. c #E6F8FF", +"=. c #E4F7FF", +"-. c #DDF2FF", +";. c #DCF3FF", +">. c #DAF4FF", +",. c #D6F3FF", +"'. c #D5F3FF", +"). c #D8F2FF", +"!. c #7FC2F2", +"~. c #99BBE2", +"{. c #F1FBFF", +"]. c #E9F8FF", +"^. c #E6F9FF", +"/. c #DAF1FF", +"(. c #D9F2FF", +"_. c #D6F4FF", +":. c #D3F2FF", +"<. c #D1F1FF", +"[. c #D5F1FF", +"}. c #7EC2F2", +"|. c #98BBE2", +"1. c #EDFEFF", +"2. c #F0BD7A", +"3. c #F6992B", +"4. c #EBC795", +"5. c #D1EAF2", +"6. c #CDDFEA", +"7. c #CCE3F1", +"8. c #C2D9E6", +"9. c #C1DAE8", +"0. c #C0D9E7", +"a. c #CFEBFB", +"b. c #7DC3F3", +"c. c #EAFFFF", +"d. c #F3A84B", +"e. c #FE7900", +"f. c #F0BA73", +"g. c #B5CBD5", +"h. c #ABB6BD", +"i. c #D7F5FF", +"j. c #B6C8D2", +"k. c #A1AAB0", +"l. c #A3AEB5", +"m. c #A1ADB3", +"n. c #C7E2F1", +"o. c #7EC4F7", +"p. c #97BBE2", +"q. c #E9FBFF", +"r. c #E8D7BA", +"s. c #EAC492", +"t. c #E2DBC7", +"u. c #DAF7FF", +"v. c #D8F4FF", +"w. c #D1EFFF", +"x. c #D1F0FF", +"y. c #CFF1FF", +"z. c #CCF1FF", +"A. c #C9F0FF", +"B. c #CDEFFF", +"C. c #7AC0F2", +"D. c #003156", +"E. c #9FBEE4", +"F. c #EFFCFF", +"G. c #E6FCFF", +"H. c #E1FFFF", +"I. c #E0FAFF", +"J. c #DEF3FF", +"K. c #DBF3FF", +"L. c #D4F0FF", +"M. c #D2EFFF", +"N. c #CFEFFF", +"O. c #CDEEFF", +"P. c #D5F2FF", +"Q. c #81C4F5", +"R. c #64A9E4", +"S. c #8BC8F3", +"T. c #87C6F2", +"U. c #86C5F2", +"V. c #83C4F2", +"W. c #81C3F2", +"X. c #80C3F2", +"Y. c #7CC1F2", +"Z. c #7AC1F2", +"`. c #81C5F5", +" + c #54B4F6", +".+ c #00375F", +"++ c #003358", +"@+ c #00375E", +"#+ c #001A2B", +". + @ # $ % & * = - - - ; > , ", +"' ) ! ~ { ] ^ / ( _ _ _ : < [ ", +"} | 1 2 3 4 5 6 7 8 9 0 a b c ", +"d e f g g h i j k l m n o p q ", +"d r s t u v w x y z A B C D q ", +"E F G H I J K L M N O P Q R q ", +"S g T U V W X Y Z ` ...+.@.q ", +"#.$.%.&.*.*.=.-.;.>.,.'.).!.q ", +"~.{.].^.C C Y /.(._.:.<.[.}.q ", +"|.1.2.3.4.5.6.).7.8.9.0.a.b.q ", +"|.c.d.e.f.g.h.i.j.k.l.m.n.o.q ", +"p.q.r.s.t.u.v.w.x.y.z.A.B.C.D. ", +"E.F.G.H.I.J.K.).L.M.N.O.P.Q.D. ", +"R.S.T.U.D V.W.X.}.Y.Y.Z.`. +.+ ", +"++q q q q q q q q q q q q @+#+ ", +" "}; diff --git a/eworkpanel/icons/ede-small.xpm b/eworkpanel/icons/ede-small.xpm new file mode 100644 index 0000000..5053fc9 --- /dev/null +++ b/eworkpanel/icons/ede-small.xpm @@ -0,0 +1,76 @@ +/* XPM */ +static char * ede_small2_xpm[] = { +"16 16 57 1", +" c None", +". c #002F78", +"+ c #002C77", +"@ c #002E78", +"# c #003079", +"$ c #00367B", +"% c #003179", +"& c #002B76", +"* c #003D7D", +"= c #004E84", +"- c #082775", +"; c #002A76", +"> c #003E7E", +", c #005285", +"' c #082072", +") c #081C6F", +"! c #081F71", +"~ c #003B7D", +"{ c #3F8299", +"] c #005486", +"^ c #082675", +"/ c #085887", +"( c #081D70", +"_ c #082975", +": c #081169", +"< c #004D83", +"[ c #608F9F", +"} c #002D77", +"| c #003F7E", +"1 c #257694", +"2 c #13678E", +"3 c #082574", +"4 c #082172", +"5 c #11648C", +"6 c #2B7995", +"7 c #004480", +"8 c #085B89", +"9 c #397F98", +"0 c #004681", +"a c #081A6F", +"b c #196C8F", +"c c #005586", +"d c #085988", +"e c #082474", +"f c #082373", +"g c #003D7E", +"h c #307C97", +"i c #081C70", +"j c #00387C", +"k c #1D7091", +"l c #11668D", +"m c #207392", +"n c #005185", +"o c #004581", +"p c #004580", +"q c #00347A", +"r c #082A76", +"..++++++++++++@.", +".#$$$$$$$$$$$$%.", +"&* =-", +";> ,-", +";> ,')!~{ ]^", +";> /(@._:< [>&", +";> _}+'|1 2_^#", +";> 34%5 6$',7+", +";> -8 904ab c^", +";> de^@' ,^", +";> 2ff@.3g ,^", +";> h.i'ij ,^", +";> klm ,^", +";g n^", +"@%7opppo0oppopq@", +"..r___________@."}; diff --git a/eworkpanel/icons/ede_small.xpm b/eworkpanel/icons/ede_small.xpm new file mode 100644 index 0000000..5fc7024 --- /dev/null +++ b/eworkpanel/icons/ede_small.xpm @@ -0,0 +1,316 @@ +/* XPM */ +static char * ede_small_xpm[] = { +"54 15 298 2", +" c None", +". c #4A484A", +"+ c #454345", +"@ c #000000", +"# c #996523", +"$ c #3A332A", +"% c #706D70", +"& c #282726", +"* c #434243", +"= c #E7EEDE", +"- c #E4EDDA", +"; c #E3ECD7", +"> c #E2EBD6", +", c #DFE9D3", +"' c #DDE8CF", +") c #D9E5CA", +"! c #C4CEB8", +"~ c #791818", +"{ c #7D1616", +"] c #7E1617", +"^ c #7F1617", +"/ c #801717", +"( c #7F1717", +"_ c #7A1515", +": c #671314", +"< c #675E5E", +"[ c #410E92", +"} c #4C12AB", +"| c #5314B9", +"1 c #5A1BBF", +"2 c #5E1FC1", +"3 c #6428C3", +"4 c #6931C4", +"5 c #6D37C4", +"6 c #713FBE", +"7 c #8D5F22", +"8 c #603A08", +"9 c #030303", +"0 c #050504", +"a c #131313", +"b c #DDE8D0", +"c c #DBE6CD", +"d c #D4DFC6", +"e c #CAD4BE", +"f c #CFDBC0", +"g c #D2DDC4", +"h c #D3E0C2", +"i c #D2E0C1", +"j c #8C2727", +"k c #912625", +"l c #912423", +"m c #922726", +"n c #8B2727", +"o c #5211B8", +"p c #5718BD", +"q c #5E26B7", +"r c #5C2CA9", +"s c #532A95", +"t c #1B132B", +"u c #404040", +"v c #2F2E2F", +"w c #787578", +"x c #494749", +"y c #0E0E0E", +"z c #4C4B4C", +"A c #D4E1C3", +"B c #33362F", +"C c #2F312C", +"D c #3E413A", +"E c #953738", +"F c #993738", +"G c #943839", +"H c #903636", +"I c #983637", +"J c #873637", +"K c #5C1FBC", +"L c #6124C2", +"M c #612CB7", +"N c #7B7B7B", +"O c #F9E445", +"P c #A5A3A5", +"Q c #2F2F2F", +"R c #3B3B3B", +"S c #CCDCB9", +"T c #CBDCB8", +"U c #A24B4B", +"V c #A44949", +"W c #984C4E", +"X c #9E4B4B", +"Y c #A44A4A", +"Z c #A24A4A", +"` c #642CBC", +" . c #6930C4", +".. c #6D39BF", +"+. c #4A4C4A", +"@. c #949295", +"#. c #E2DEE2", +"$. c #3E3D3E", +"%. c #0F0F0F", +"&. c #353435", +"*. c #C3D3AF", +"=. c #C5D6AF", +"-. c #C1D5AA", +";. c #AA5C5C", +">. c #AB5A5A", +",. c #A35D5C", +"'. c #AA5959", +"). c #AC5B5B", +"!. c #6D39C1", +"~. c #743DC8", +"{. c #7845C9", +"]. c #7D7C7D", +"^. c #757275", +"/. c #817F81", +"(. c #757475", +"_. c #121212", +":. c #191919", +"<. c #343334", +"[. c #BCD0A4", +"}. c #BBD2A2", +"|. c #B9D09E", +"1. c #BACF9E", +"2. c #B6CE9A", +"3. c #B6CB9A", +"4. c #ACC290", +"5. c #A4BA87", +"6. c #96AB7B", +"7. c #B16B6C", +"8. c #B3696A", +"9. c #AC6E6E", +"0. c #B46A6A", +"a. c #7243BC", +"b. c #7C49CC", +"c. c #8352CF", +"d. c #8659CD", +"e. c #8B60CE", +"f. c #9169D2", +"g. c #966FD1", +"h. c #9B75D5", +"i. c #9F7DD5", +"j. c #A19DA1", +"k. c #6F6C6F", +"l. c #A9A7A9", +"m. c #E2DFE2", +"n. c #2C2B2C", +"o. c #010101", +"p. c #1E1D1C", +"q. c #2A2A2B", +"r. c #1F1F1F", +"s. c #B5CC97", +"t. c #B2CB95", +"u. c #AEC790", +"v. c #899C70", +"w. c #90A477", +"x. c #A1B784", +"y. c #AEC391", +"z. c #ADC390", +"A. c #A9C289", +"B. c #B97C7D", +"C. c #BD7E7E", +"D. c #B97E7E", +"E. c #BD7C7C", +"F. c #BB7A7B", +"G. c #8E63D1", +"H. c #8658CF", +"I. c #8B5FD0", +"J. c #8962C8", +"K. c #616061", +"L. c #F4F0F4", +"M. c #9E9D9E", +"N. c #CCC9CC", +"O. c #F6F3F6", +"P. c #212021", +"Q. c #4A494B", +"R. c #232323", +"S. c #AEC68E", +"T. c #ABC689", +"U. c #9CB27F", +"V. c #3E4731", +"W. c #4C583D", +"X. c #C48F8F", +"Y. c #C68F8E", +"Z. c #C09191", +"`. c #C58E8D", +" + c #936BD3", +".+ c #777677", +"++ c #E7E3E7", +"@+ c #878587", +"#+ c #B3B0B2", +"$+ c #FCF8FC", +"%+ c #171717", +"&+ c #ADAAAD", +"*+ c #878687", +"=+ c #A4C17E", +"-+ c #A2BF7D", +";+ c #899F6B", +">+ c #CDA0A0", +",+ c #CDA1A1", +"'+ c #CDA2A2", +")+ c #CD9FA0", +"!+ c #A07DD7", +"~+ c #9871D5", +"{+ c #9C78D6", +"]+ c #676667", +"^+ c #AFABAF", +"/+ c #F6F2F6", +"(+ c #6C6A6C", +"_+ c #282728", +":+ c #C1BDC1", +"<+ c #BAB7BA", +"[+ c #060606", +"}+ c #9BBB73", +"|+ c #9ABA71", +"1+ c #7B955B", +"2+ c #D6B1B1", +"3+ c #D7B0B0", +"4+ c #D4B2B2", +"5+ c #D1ADAE", +"6+ c #D6AFAF", +"7+ c #D7B2B1", +"8+ c #A382D8", +"9+ c #515051", +"0+ c #CAC6C9", +"a+ c #BEBABE", +"b+ c #585558", +"c+ c #C4C0C4", +"d+ c #CECACE", +"e+ c #252525", +"f+ c #020202", +"g+ c #93B668", +"h+ c #92B566", +"i+ c #91B365", +"j+ c #DFC3C4", +"k+ c #DBC3C3", +"l+ c #DCC0C1", +"m+ c #BFA6A8", +"n+ c #A888DA", +"o+ c #AC8FDD", +"p+ c #4A4848", +"q+ c #ACA9AB", +"r+ c #B3B0B3", +"s+ c #CCC8CC", +"t+ c #D4D0D4", +"u+ c #464546", +"v+ c #080808", +"w+ c #575557", +"x+ c #8DB05F", +"y+ c #8AAE5B", +"z+ c #8AAE5A", +"A+ c #86AC55", +"B+ c #85AB53", +"C+ c #84AA52", +"D+ c #83AA51", +"E+ c #82A74F", +"F+ c #81A451", +"G+ c #E8D3D4", +"H+ c #E9D3D4", +"I+ c #E9D4D5", +"J+ c #DDCACB", +"K+ c #B094DE", +"L+ c #B69CE1", +"M+ c #BAA2E2", +"N+ c #C0AAE4", +"O+ c #C6B1E6", +"P+ c #CBB9E7", +"Q+ c #D0C0E9", +"R+ c #D4C5EC", +"S+ c #525352", +"T+ c #6C6B6C", +"U+ c #626263", +"V+ c #4E4D4E", +"W+ c #4C4C4C", +"X+ c #818081", +"Y+ c #535253", +"Z+ c #101010", +"`+ c #222122", +" @ c #393839", +".@ c #6B8844", +"+@ c #79994C", +"@@ c #7FA34E", +"#@ c #80A54D", +"$@ c #7B9D4D", +"%@ c #D0C5C4", +"&@ c #D0C6C5", +"*@ c #D1C6C5", +"=@ c #C1B8B6", +"-@ c #8B8181", +";@ c #B59EDA", +">@ c #BBA4DE", +",@ c #AE9ACC", +"'@ c #545354", +")@ c #59585A", +"!@ c #858485", +"~@ c #838183", +"{@ c #6D6B6D", +"]@ c #595959", +"^@ c #312C38", +"/@ c #43404B", +" . + @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ ", +" # $ % & * @ = = - ; > , ' ) ! @ @ ~ { ] ^ / ( _ : @ < @ [ } | 1 2 3 4 5 6 @ ", +" 7 8 9 0 @ a @ b b c d e f g h i @ @ j k l k k k k m n @ @ o p 2 q r s s s s t ", +" u v w x y z @ b A h @ B C D @ @ @ @ E F G @ @ @ H F I J @ @ K L M @ @ @ @ @ @ @ ", +" N O O P Q R @ b S T @ @ U V W @ @ X Y Z @ @ ` ...@ ", +" +.@.O #.$.%.&.v @ *.=.-.@ @ @ @ @ @ @ @ ;.>.,.@ @ '.).@ @ !.~.{.@ @ @ @ @ @ @ ", +" ].^./.O (._.9 :.<. @ [.}.|.1.2.3.4.5.6.@ @ 7.8.9.@ @ 8.0.@ @ a.b.c.d.e.f.g.h.i.@ ", +" j.k.l.m.n.o.p.q.r. @ s.t.u.v.w.x.y.z.A.@ @ B.C.D.@ @ E.F.@ @ G.H.I.J.e.e.e.e.e.@ ", +" K.L.M.N.O.P.9 k.Q.y R. @ S.T.U.@ @ @ @ V.W.@ @ X.Y.Z.@ @ Y.`.@ @ G.G. +@ @ @ @ @ @ @ ", +" .+++@+#+$+<.%+&+*+@ %+ @ =+-+;+@ @ >+,+'+@ @ )+,+@ @ !+~+{+@ ", +" ]+^+ /./+(+_+:+<+[+%. @ }+|+1+@ @ 2+3+4+@ @ 5+6+7+@ @ !+!+8+@ ", +" 9+0+a+b+c+d+e+f+ @ g+h+i+@ @ @ @ @ @ @ @ j+j+k+@ @ @ l+j+j+m+@ @ !+n+o+@ @ @ @ @ @ @ ", +" p+q+r+s+t+u+v+w+ @ x+y+z+A+B+C+D+E+F+@ @ G+H+I+H+H+H+H+H+J+@ @ !+K+L+M+N+O+P+Q+R+@ ", +" S+T+U+V+W+X+Y+Z+`+ @ @ .@.@.@.@.@+@@@#@$@@ @ %@%@&@&@&@*@=@-@@ @ !+;@>@,@N+N+N+N+N+@ ", +" '@)@!@~@{@]@ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ ^@/@@ @ @ @ @ @ @ "}; diff --git a/eworkpanel/icons/favourites.xpm b/eworkpanel/icons/favourites.xpm new file mode 100644 index 0000000..a108d09 --- /dev/null +++ b/eworkpanel/icons/favourites.xpm @@ -0,0 +1,150 @@ +/* XPM */ +static char * favourites_xpm[] = { +"16 15 132 2", +" c None", +". c #EDCFD2", +"+ c #F3E6E9", +"@ c #FEE0E0", +"# c #FED2D0", +"$ c #EDB0B2", +"% c #DE6062", +"& c #F1CDCD", +"* c #F3CECE", +"= c #F6D2D2", +"- c #ECCACA", +"; c #DBA2A7", +"> c #F0C0C2", +", c #FEEDED", +"' c #FEE2E2", +") c #FECFCF", +"! c #FEBDBF", +"~ c #FEB3B3", +"{ c #FD9595", +"] c #DB5F62", +"^ c #FBB0B1", +"/ c #FEA7A7", +"( c #FEACAB", +"_ c #FEB9B9", +": c #FEC8C9", +"< c #FED3D3", +"[ c #FEDDDE", +"} c #FEDBDB", +"| c #FED2D2", +"1 c #FEC6C6", +"2 c #FEB7B7", +"3 c #FEA8A9", +"4 c #FE9C9C", +"5 c #FA6C6B", +"6 c #F78282", +"7 c #FE7E7E", +"8 c #FE8988", +"9 c #FEADAE", +"0 c #FEBABA", +"a c #FEC9CA", +"b c #FEC7C7", +"c c #FEC4C4", +"d c #FEAFAE", +"e c #FE9A9A", +"f c #FE7374", +"g c #FC4949", +"h c #9D5054", +"i c #FB5756", +"j c #FE7475", +"k c #FE8484", +"l c #FE9393", +"m c #FEA1A1", +"n c #FEABAB", +"o c #FEB7B8", +"p c #FEB4B4", +"q c #FEA4A5", +"r c #FE8A89", +"s c #FE6969", +"t c #FE4A4A", +"u c #FC3738", +"v c #A33F41", +"w c #FD4748", +"x c #FE6A6A", +"y c #FE7777", +"z c #FE8586", +"A c #FE9292", +"B c #FE9B9B", +"C c #FEA2A3", +"D c #FEA3A4", +"E c #FE8F8F", +"F c #FE7979", +"G c #FE6363", +"H c #FE5757", +"I c #FA3535", +"J c #9A5053", +"K c #F32D2F", +"L c #FE5C5C", +"M c #FE6565", +"N c #FE7171", +"O c #FE7B7C", +"P c #FE8181", +"Q c #FE8383", +"R c #FE7C7B", +"S c #FE7272", +"T c #FF9500", +"U c #FE5454", +"V c #FE4545", +"W c #F73E3D", +"X c #7E2A2B", +"Y c #E03E3E", +"Z c #FE4B4B", +"` c #FE5C5D", +" . c #FE6D6D", +".. c #FE7373", +"+. c #FE6B6C", +"@. c #FE4C4D", +"#. c #6A2324", +"$. c #B56767", +"%. c #F13A3A", +"&. c #FE5352", +"*. c #FE5A59", +"=. c #FE6161", +"-. c #FE6665", +";. c #FFFF1A", +">. c #FFC600", +",. c #CC4040", +"'. c #FE4D4C", +"). c #FE5353", +"!. c #FE5857", +"~. c #FE5959", +"{. c #FFFF5D", +"]. c #FFFF8C", +"^. c #FFFFB6", +"/. c #BF4948", +"(. c #F74A4A", +"_. c #FE4747", +":. c #FD4647", +"<. c #FD4A4B", +"[. c #FE4A4B", +"}. c #FFFFCC", +"|. c #5A292A", +"1. c #B24949", +"2. c #F84848", +"3. c #FE3D3E", +"4. c #F83738", +"5. c #A43D3D", +"6. c #D44F4F", +"7. c #9A3837", +"8. c #EC2525", +"9. c #75302F", +"0. c #8F3A3B", +"a. c #BF4242", +" . + @ # $ % ", +" & * = - ; > , ' ) ! ~ { ] ", +" ^ / ( _ : < [ } | 1 2 3 4 5 ", +"6 7 8 4 9 0 1 a b c 0 d e f g h ", +"i j k l m n ~ 2 o p q r s t u v ", +"w x y z A B C D 4 E F G H t I J ", +"K L M N O P k Q R S T T U V W X ", +"Y Z ` M ...y T T +.T T @.T T #.", +"$.%.&.*.=.-.T ;.>.T ;.;.T >.;.T ", +" ,.V '.).!.~.T {.].^.^.].{.T ", +" /.(._.:.<.[.T >.}.}.>.T |. ", +" 1.2.3.4.T {.].^.^.].{.T ", +" 5.6.T ;.>.T ;.;.T >.;.T ", +" 7.T T 8.T T T T ", +" 9.0.a.T T "}; diff --git a/eworkpanel/icons/file.xpm b/eworkpanel/icons/file.xpm new file mode 100644 index 0000000..2c1accf --- /dev/null +++ b/eworkpanel/icons/file.xpm @@ -0,0 +1,88 @@ +/* XPM */ +static char * file_xpm[] = { +"16 16 69 1", +" c None", +". c #C6C6D5", +"+ c #9494AD", +"@ c #FBFBFC", +"# c #F8F8FA", +"$ c #F4F4F7", +"% c #EEEEF2", +"& c #EAEAF0", +"* c #DEDEE7", +"= c #E0E0E9", +"- c #C1C8D5", +"; c #BEC5D3", +"> c #BBC1CF", +", c #B8BFCE", +"' c #AFB5C7", +") c #C9C9D7", +"! c #F5F5F8", +"~ c #F0F0F4", +"{ c #E4E4EB", +"] c #C0C7D4", +"^ c #BBC2D0", +"/ c #B9C0CE", +"( c #B3B9CA", +"_ c #DBDBE5", +": c #CDCDDA", +"< c #BFBFD0", +"[ c #F7F7F9", +"} c #F2F2F6", +"| c #E7E7EE", +"1 c #E3E3EA", +"2 c #D0D0DC", +"3 c #C4C4D3", +"4 c #C2C2D1", +"5 c #FAFAFB", +"6 c #BDC3D1", +"7 c #B4BACB", +"8 c #AEB4C7", +"9 c #9EA3B9", +"0 c #9BA1B6", +"a c #F9F9FA", +"b c #DCDCE5", +"c c #D6D6E1", +"d c #D2D2DE", +"e c #D1D1DD", +"f c #CECEDB", +"g c #BCC3D1", +"h c #B6BDCD", +"i c #B0B7C7", +"j c #AAB0C3", +"k c #AAAFC2", +"l c #A6ACBF", +"m c #A5ABBF", +"n c #E5E5EC", +"o c #DFDFE8", +"p c #DDDDE6", +"q c #DADAE4", +"r c #D7D7E2", +"s c #B5BBCB", +"t c #B1B8C8", +"u c #ADB3C6", +"v c #A9AFC1", +"w c #EFEFF3", +"x c #E8E8EE", +"y c #E6E6ED", +"z c #B6BCCC", +"A c #B2B8C9", +"B c #ABB1C3", +"C c #F3F3F6", +"D c #E1E1E9", +" ........+ ", +" .@#$%&*=.+ ", +" .@-;>,'=.)+ ", +" .@#!~%{=++++ ", +" .@];^/(=_:<+ ", +" .@[!}~|1234+ ", +" .5];6>7890.+ ", +" .a$}%&bcdef+ ", +" .!g^hijklmd+ ", +" .!$%n1opqrc+ ", +" .[^s(t8ujvc+ ", +" .[wxy{=obqr+ ", +" .$z7(AiuBkr+ ", +" .Cx|n{Do_qr+ ", +" .~xxyt8obqr+ ", +" ++++++++++++ "}; diff --git a/eworkpanel/icons/find.xpm b/eworkpanel/icons/find.xpm new file mode 100644 index 0000000..846f71a --- /dev/null +++ b/eworkpanel/icons/find.xpm @@ -0,0 +1,205 @@ +/* XPM */ +static char * find_xpm[] = { +"16 16 186 2", +" c None", +". c #71A0D1", +"+ c #7FACD8", +"@ c #79A5D0", +"# c #719FC8", +"$ c #6293BE", +"% c #90BBE5", +"& c #B1D5F2", +"* c #E4F7FF", +"= c #F6FDFF", +"- c #F7FFFF", +"; c #ECF8FF", +"> c #A4CAE2", +", c #346386", +"' c #8FBAE4", +") c #DCF4FF", +"! c #FBFFFF", +"~ c #FBFCFF", +"{ c #F4FAFF", +"] c #EBF7FF", +"^ c #E7F4FF", +"/ c #E9FAFF", +"( c #BAE3FD", +"_ c #13446B", +": c #719FD0", +"< c #B7D7F2", +"[ c #F7FEFF", +"} c #F7FCFF", +"| c #F1F9FF", +"1 c #EBF6FF", +"2 c #E4F3FF", +"3 c #DDEFFE", +"4 c #CAE5FD", +"5 c #C3E7FF", +"6 c #528AB6", +"7 c #85AFD9", +"8 c #EFFCFF", +"9 c #F7FBFF", +"0 c #EEF7FF", +"a c #EAF6FE", +"b c #E6F3FE", +"c c #DFF0FE", +"d c #CDE5FD", +"e c #B4D9FC", +"f c #B8DBFF", +"g c #A8D4FE", +"h c #003258", +"i c #76A4D0", +"j c #E5F6FF", +"k c #EAF5FF", +"l c #E6F3FF", +"m c #E2F1FE", +"n c #D4E9FE", +"o c #BFDDFC", +"p c #B0D3FB", +"q c #ABD0FA", +"r c #AFD2FD", +"s c #97C3F4", +"t c #002F52", +"u c #699FCF", +"v c #C5E8FF", +"w c #C3E1FD", +"x c #C4E1FE", +"y c #C1DDFC", +"z c #AFD2FB", +"A c #A8CCFA", +"B c #A5C8F9", +"C c #A1C3F8", +"D c #A3C2FA", +"E c #91BBF9", +"F c #003157", +"G c #325881", +"H c #8FC0ED", +"I c #BCDEFF", +"J c #AED2FC", +"K c #ABCEFA", +"L c #A6C8F9", +"M c #9FC0F8", +"N c #98B9F7", +"O c #91B1F5", +"P c #96B4FF", +"Q c #2F67A1", +"R c #000C16", +"S c #618ABF", +"T c #4B7EAC", +"U c #B6DBFF", +"V c #B3D2FF", +"W c #A2C4F8", +"X c #9BBCF8", +"Y c #91B0F6", +"Z c #89A6F5", +"` c #8AA2FD", +" . c #5F8AF0", +".. c #54879C", +"+. c #8B7F00", +"@. c #ABCCFF", +"#. c #758492", +"$. c #3A6FA2", +"%. c #6EA0DB", +"&. c #A4C3FF", +"*. c #93B2FE", +"=. c #88A5FD", +"-. c #7895F6", +";. c #386CC4", +">. c #586674", +",. c #F5FC73", +"'. c #FCE56A", +"). c #754200", +"!. c #A1C6FF", +"~. c #F8F8FD", +"{. c #95A1AD", +"]. c #214561", +"^. c #1E5A90", +"/. c #195287", +"(. c #175189", +"_. c #134783", +":. c #1A2628", +"<. c #C0710D", +"[. c #DCA026", +"}. c #DBC095", +"|. c #E6C07B", +"1. c #774500", +"2. c #A1C5FE", +"3. c #F6FAFF", +"4. c #E8EEFD", +"5. c #B4C2DE", +"6. c #77859B", +"7. c #5D697A", +"8. c #596679", +"9. c #5D6A7D", +"0. c #5372A1", +"a. c #22170E", +"b. c #854B0C", +"c. c #C08330", +"d. c #E2C692", +"e. c #E5BF7B", +"f. c #784700", +"g. c #F0F6FE", +"h. c #DDEAFF", +"i. c #CDDEFF", +"j. c #C4D7F9", +"k. c #BCD0F1", +"l. c #B3CAF1", +"m. c #B8CDF2", +"n. c #83B2F8", +"o. c #89510C", +"p. c #E1C694", +"q. c #E3BC75", +"r. c #7E4C01", +"s. c #A6C9FF", +"t. c #F1F6FF", +"u. c #D9E7FF", +"v. c #D1E2FF", +"w. c #CFE1FF", +"x. c #CCE0FF", +"y. c #C2D9FF", +"z. c #C7DEFF", +"A. c #8ABBFF", +"B. c #0F3162", +"C. c #874F09", +"D. c #C88C3C", +"E. c #C39748", +"F. c #B3700D", +"G. c #A4C7FE", +"H. c #EDF4FE", +"I. c #D6E4FE", +"J. c #CDDEFE", +"K. c #C9DCFE", +"L. c #C7DBFE", +"M. c #BDD6FE", +"N. c #C3DAFF", +"O. c #87B8FF", +"P. c #0E3162", +"Q. c #844F0D", +"R. c #925B19", +"S. c #623901", +"T. c #4988E5", +"U. c #5691E5", +"V. c #528EE5", +"W. c #508CE3", +"X. c #508BE3", +"Y. c #4F8BE3", +"Z. c #4D8AE3", +"`. c #4F8BE4", +" + c #478DF3", +".+ c #241400", +" . + @ # $ ", +" % & * = - ; > , ", +" ' ) ! ~ { ] ^ / ( _ ", +": < [ } | 1 2 3 4 5 6 ", +"7 8 9 0 a b c d e f g h ", +"i j k l m n o p q r s t ", +"u v w x y z A B C D E F ", +"G H I J K L M N O P Q R ", +"S T U V W X Y Z ` ...+. ", +"@.#.$.%.&.*.=.-.;.>.,.'.). ", +"!.~.{.].^./.(._.:.<.[.}.|.1. ", +"2.3.4.5.6.7.8.9.0.a.b.c.d.e.f. ", +"2.g.h.i.j.k.l.m.n. o.c.p.q.r.", +"s.t.u.v.w.x.y.z.A.B. C.D.E.F.", +"G.H.I.J.K.L.M.N.O.P. Q.R.S.", +"T.U.V.W.X.Y.Z.`. + .+ "}; diff --git a/eworkpanel/icons/help.xpm b/eworkpanel/icons/help.xpm new file mode 100644 index 0000000..a96d196 --- /dev/null +++ b/eworkpanel/icons/help.xpm @@ -0,0 +1,138 @@ +/* XPM */ +static char * help_xpm[] = { +"16 16 119 2", +" c None", +". c #724700", +"+ c #774800", +"@ c #856D3C", +"# c #985817", +"$ c #8E6106", +"% c #8C5E00", +"& c #6A4C19", +"* c #797A7B", +"= c #D0D4DB", +"- c #EEF5F5", +"; c #EBB3B2", +"> c #ED2423", +", c #D51E23", +"' c #9A2423", +") c #C6CFD7", +"! c #FFFFFF", +"~ c #FFDBDB", +"{ c #FF6767", +"] c #FF6A6A", +"^ c #F95354", +"/ c #D52A2D", +"( c #4B3000", +"_ c #6A4500", +": c #C9343A", +"< c #FFBABB", +"[ c #DEDEDE", +"} c #949999", +"| c #735959", +"1 c #7E2020", +"2 c #B03E3E", +"3 c #F76868", +"4 c #FA8989", +"5 c #DBC5C7", +"6 c #583600", +"7 c #7F5902", +"8 c #751E21", +"9 c #FF2828", +"0 c #FF4F4F", +"a c #BE8B8B", +"b c #E9D8D8", +"c c #B1B4B9", +"d c #7B4F0E", +"e c #CB262C", +"f c #FF4A4A", +"g c #DE3232", +"h c #7D8080", +"i c #FBFBFB", +"j c #EAECF0", +"k c #8A795C", +"l c #823E0E", +"m c #EB2626", +"n c #FF4B4B", +"o c #901414", +"p c #DEE3E3", +"q c #FBFFFF", +"r c #9F9B8C", +"s c #EA6867", +"t c #FD7E7E", +"u c #6D2020", +"v c #C7A6A6", +"w c #FDE0E0", +"x c #917675", +"y c #EAE9E6", +"z c #717171", +"A c #CD3333", +"B c #FF7373", +"C c #8C1F20", +"D c #8F6A26", +"E c #D5D8DC", +"F c #A1A2A2", +"G c #E44242", +"H c #F86D70", +"I c #95321F", +"J c #875603", +"K c #9B9A9B", +"L c #FCFCFE", +"M c #E9EDED", +"N c #B61C1C", +"O c #FA6666", +"P c #D65E63", +"Q c #703E15", +"R c #835000", +"S c #DEE4E7", +"T c #FBECEC", +"U c #D94C4C", +"V c #730808", +"W c #B3AEAE", +"X c #F39393", +"Y c #FD7778", +"Z c #823135", +"` c #493100", +" . c #E68788", +".. c #EF3F3F", +"+. c #D11818", +"@. c #BA3F3F", +"#. c #BDBEBE", +"$. c #DEE0E0", +"%. c #F8FAFA", +"&. c #FCFFFF", +"*. c #A47177", +"=. c #644100", +"-. c #BA5960", +";. c #EF7A7D", +">. c #FD6B6D", +",. c #FD9595", +"'. c #FAFCFD", +"). c #F8FBFE", +"!. c #DADDE2", +"~. c #868A8F", +"{. c #5E3E00", +"]. c #8B492D", +"^. c #A14336", +"/. c #9A5655", +"(. c #A29E96", +"_. c #9E937C", +":. c #6E5935", +"<. c #472C00", +"[. c #643F00", +" . + @ # $ % ", +" & * = - ; > , ' ", +" ) ! ! ! ~ { ] ^ / ( ", +"_ : < ! [ } | 1 2 3 4 5 6 ", +"7 8 9 0 a b ! c ", +"d e f g h i j k ", +"l m n o p q r ", +" s t u v w x ", +" y ! z A B C ", +"D E ! F G H I ", +"J K L M N O P Q ", +"R S T U V W X Y Z ` ", +" .] ..+.@.#.$.%.&.*. =. ", +" -.;.>.,.'.).!.~. ", +" ( {. ].^./.(._.:.<.[. ", +" "}; diff --git a/eworkpanel/icons/keyboard.xpm b/eworkpanel/icons/keyboard.xpm new file mode 100644 index 0000000..e2e9390 --- /dev/null +++ b/eworkpanel/icons/keyboard.xpm @@ -0,0 +1,164 @@ +/* XPM */ +static char * keyboard_xpm[] = { +"16 16 145 2", +" c None", +". c #5071B8", +"+ c #B9CBF5", +"@ c #E2ECFC", +"# c #4D6497", +"$ c #B7FBFA", +"% c #ACEBFA", +"& c #A9CCED", +"* c #F5F5FF", +"= c #F3F5FF", +"- c #C7D8FE", +"; c #465D92", +"> c #A3D2C3", +", c #ADEEE0", +"' c #B4F4E6", +") c #B4FFFD", +"! c #ADFAED", +"~ c #B1E4D7", +"{ c #D8E8EF", +"] c #DDE4FF", +"^ c #A1BDFD", +"/ c #324778", +"( c #7DCBB1", +"_ c #8BE8BD", +": c #92F7E7", +"< c #95FAF2", +"[ c #92F2E0", +"} c #89E1B7", +"| c #78D69D", +"1 c #6FCA96", +"2 c #B6D5E8", +"3 c #A3BDFF", +"4 c #90B0F8", +"5 c #2D4274", +"6 c #35C36D", +"7 c #6CE3C4", +"8 c #6EF8FC", +"9 c #70F9FF", +"0 c #6DE1C4", +"a c #66D196", +"b c #60CE98", +"c c #2CB87D", +"d c #3FA685", +"e c #9EB9FF", +"f c #89ABFD", +"g c #799CEC", +"h c #1B2E5A", +"i c #1FB789", +"j c #02C093", +"k c #31E1F3", +"l c #4BEAFF", +"m c #4EE6F9", +"n c #4CCE95", +"o c #45C47B", +"p c #2DB974", +"q c #09A044", +"r c #118E5C", +"s c #89A8E6", +"t c #8FB0FE", +"u c #7498EA", +"v c #6183D2", +"w c #00B1BC", +"x c #00B9A0", +"y c #00BFA4", +"z c #0BCFFF", +"A c #13CDF7", +"B c #13B762", +"C c #0BAB37", +"D c #009F30", +"E c #00903C", +"F c #1080A5", +"G c #88A1D3", +"H c #99B8FF", +"I c #759AEB", +"J c #6387D9", +"K c #5D81D4", +"L c #06A6F8", +"M c #00AB94", +"N c #00A92D", +"O c #00B694", +"P c #00BCF2", +"Q c #00B4D6", +"R c #00A675", +"S c #009528", +"T c #008462", +"U c #1272BA", +"V c #91A5CE", +"W c #A3C0FF", +"X c #7EA2F4", +"Y c #6589DC", +"Z c #4968B1", +"` c #45A7E6", +" . c #0095B6", +".. c #009E35", +"+. c #00A34E", +"@. c #00ABE1", +"#. c #00A8FF", +"$. c #0099B0", +"%. c #008430", +"&. c #006C79", +"*. c #2368A7", +"=. c #A0AFD1", +"-. c #AFC8FF", +";. c #86A8F8", +">. c #5270B4", +",. c #0D86C5", +"'. c #008844", +"). c #0093A6", +"!. c #0095E8", +"~. c #008FE1", +"{. c #0082A4", +"]. c #006D6B", +"^. c #0055A0", +"/. c #5B7EA7", +"(. c #BAC7E5", +"_. c #BBD2FF", +":. c #7995D2", +"<. c #097067", +"[. c #0073BC", +"}. c #0074C8", +"|. c #0070C3", +"1. c #0061B4", +"2. c #0050A4", +"3. c #3E6EA5", +"4. c #AEB6C7", +"5. c #D5E2FF", +"6. c #95ABD9", +"7. c #182646", +"8. c #1D6199", +"9. c #175EA3", +"0. c #12589D", +"a. c #4174A9", +"b. c #7D91AA", +"c. c #B6BCC7", +"d. c #DFE8F7", +"e. c #A5B6D9", +"f. c #192848", +"g. c #5D7B9F", +"h. c #D4D9E1", +"i. c #F0F4FC", +"j. c #B7C5E3", +"k. c #243458", +"l. c #92B0F2", +"m. c #ABBBD7", +"n. c #28385C", +" . ", +" + @ # ", +" $ % & * = - ; ", +" > , ' ) ! ~ { ] ^ / ", +" ( _ : < [ } | 1 2 3 4 5 ", +" 6 7 8 9 0 a b c d e f g h ", +"i j k l m n o p q r s t u v ", +"w x y z A B C D E F G H I J K ", +"L M N O P Q R S T U V W X Y Z ", +"` ...+.@.#.$.%.&.*.=.-.;.>. ", +" ,.'.).!.~.{.].^./.(._.:. ", +" <.[.}.|.1.2.3.4.5.6.7. ", +" 8.9.0.a.b.c.d.e.f. ", +" g.h.i.j.k. ", +" l.m.n. ", +" "}; diff --git a/eworkpanel/icons/lock.xpm b/eworkpanel/icons/lock.xpm new file mode 100644 index 0000000..c238f08 --- /dev/null +++ b/eworkpanel/icons/lock.xpm @@ -0,0 +1,165 @@ +/* XPM */ +static char * lock_xpm[] = { +"16 16 146 2", +" c None", +". c #006495", +"+ c #2D81AA", +"@ c #267CA6", +"# c #247CA6", +"$ c #237BA4", +"% c #1F7BA4", +"& c #1A78A5", +"* c #1777A2", +"= c #1677A2", +"- c #1275A0", +"; c #1577A2", +"> c #006395", +", c #227DA6", +"' c #9EC2D8", +") c #238FB9", +"! c #2D93BD", +"~ c #2E93BD", +"{ c #2593BD", +"] c #3792BE", +"^ c #4694BE", +"/ c #5295C0", +"( c #5999BF", +"_ c #5E99C2", +": c #6B9CC3", +"< c #90ABC9", +"[ c #086F9E", +"} c #9CC0D8", +"| c #006BA4", +"1 c #0078AA", +"2 c #007BAE", +"3 c #007CAF", +"4 c #2491BE", +"5 c #59A6CC", +"6 c #63A9CD", +"7 c #3F8FBB", +"8 c #3B88B5", +"9 c #458CB6", +"0 c #4C8FBA", +"a c #5590BB", +"b c #85A7C7", +"c c #006396", +"d c #2A80AA", +"e c #3797BD", +"f c #0077AA", +"g c #007EB1", +"h c #007FB1", +"i c #6FBAD9", +"j c #FFFFFF", +"k c #71A8C9", +"l c #5090BB", +"m c #5992BB", +"n c #6095BC", +"o c #78A0C5", +"p c #06719F", +"q c #2B92BD", +"r c #2C93BF", +"s c #ECFCFF", +"t c #7DB5D4", +"u c #85B6D5", +"v c #659BC0", +"w c #5F95BC", +"x c #679ABD", +"y c #7DA1C4", +"z c #006C9E", +"A c #0B80B2", +"B c #9ECEE6", +"C c #539AC2", +"D c #418AB6", +"E c #4A8FB8", +"F c #8FBBD8", +"G c #99BED9", +"H c #659ABD", +"I c #729CC2", +"J c #7CA2C3", +"K c #006A9C", +"L c #027DB1", +"M c #2382B3", +"N c #68ABCE", +"O c #A7D0E7", +"P c #BCD7EB", +"Q c #92BAD4", +"R c #6E9BC0", +"S c #769EBE", +"T c #7FA4C7", +"U c #006B9C", +"V c #1A7FB2", +"W c #3B90BB", +"X c #FBFFFF", +"Y c #EEF9FF", +"Z c #739CBE", +"` c #7FA4C5", +" . c #80A6C7", +".. c #00699C", +"+. c #2683B3", +"@. c #6EACCE", +"#. c #CAE4F3", +"$. c #B4D4E9", +"%. c #B9D5E9", +"&. c #BFD9EB", +"*. c #7BA1C4", +"=. c #85A8C6", +"-. c #85ABCA", +";. c #006799", +">. c #3086B4", +",. c #77AECF", +"'. c #82B2D2", +"). c #C6DAEC", +"!. c #7EA6C5", +"~. c #91AECA", +"{. c #7EACCC", +"]. c #006499", +"^. c #7EB1D0", +"/. c #89B3D2", +"(. c #C9DDEE", +"_. c #88AAC9", +":. c #95B2CC", +"<. c #81B1CE", +"[. c #006399", +"}. c #5F99C2", +"|. c #F6FFFF", +"1. c #ECF8FF", +"2. c #EFF9FF", +"3. c #F0FAFF", +"4. c #8CAFCA", +"5. c #9DB6D0", +"6. c #89B6D2", +"7. c #006296", +"8. c #649AC0", +"9. c #4D8FBA", +"0. c #DEEFFB", +"a. c #F1FBFF", +"b. c #F3FCFF", +"c. c #DBE9F6", +"d. c #93B3CE", +"e. c #A7BED4", +"f. c #89B6D1", +"g. c #006397", +"h. c #91ABCA", +"i. c #A4BDD3", +"j. c #D5D4E3", +"k. c #3797BF", +"l. c #87B5D1", +"m. c #9DBFD8", +"n. c #3596BF", +"o. c #005F95", +" . + @ # $ % & * = - ; > ", +" , ' ) ! ~ { ] ^ / ( _ : < [ ", +". } | 1 2 3 4 5 6 7 8 9 0 a b c ", +"d e f g h i j j j j k l m n o p ", +"@ q 2 h r j s t u j j v w x y z ", +"# ~ 3 A B j C D E F j G H I J K ", +"$ { L M N O D E l m P Q R S T U ", +"% ] V W X j j j j j j Y Z ` ...", +"& ^ +.@.j #.$.%.P &.Y j *.=.-.;.", +"* / >.,.j '.m w H R ).j !.~.{.].", +"= ( 8 ^.j /.w H R Z (.j _.:.<.[.", +"- }.9 '.j |.1.Y 2.3.j j 4.5.6.7.", +"; 8.9.v 0.1.Y 2.3.a.b.c.d.e.f.g.", +"> h.a n x I S ` =.~.:.5.i.j.k.> ", +" [ b o y J T .-.{.<.l.m.n.o. ", +" c p z K U ..;.].[.7.7.> "}; diff --git a/eworkpanel/icons/logout.xpm b/eworkpanel/icons/logout.xpm new file mode 100644 index 0000000..ef1ed7d --- /dev/null +++ b/eworkpanel/icons/logout.xpm @@ -0,0 +1,25 @@ +/* XPM */ +static char * logout_xpm[] = { +"16 16 6 1", +" c None", +". c #8B8B8B", +"+ c #7F7F7F", +"@ c #296FC4", +"# c #4C4C4C", +"$ c #7E7E7E", +" ", +" ", +" ...........+ ", +" .@@@@@@@@@@+# ", +" .@@@@@@@@@@+# ", +" .@@@@@@@@@@+# ", +" .@@@@@@@@@@+# ", +" .@@@@@@@@@@+# ", +" .@@@@@@@@@@+# ", +" .@@@@@@@@@@+# ", +" +++$++++++++# ", +" ###.+++##### ", +" .+++# ", +" .+++++++# ", +" ", +" "}; diff --git a/eworkpanel/icons/mini_penguin.xpm b/eworkpanel/icons/mini_penguin.xpm new file mode 100644 index 0000000..2b1f91c --- /dev/null +++ b/eworkpanel/icons/mini_penguin.xpm @@ -0,0 +1,124 @@ +/* XPM */ +static char * mini_penguin_xpm[] = { +"15 15 106 2", +" c None", +". c #4A484A", +"+ c #454345", +"@ c #996523", +"# c #3A332A", +"$ c #706D70", +"% c #282726", +"& c #434243", +"* c #8D5F22", +"= c #603A08", +"- c #030303", +"; c #050504", +"> c #000000", +", c #131313", +"' c #404040", +") c #2F2E2F", +"! c #787578", +"~ c #494749", +"{ c #0E0E0E", +"] c #4C4B4C", +"^ c #7B7B7B", +"/ c #F8F4F8", +"( c #F7F4F7", +"_ c #A5A3A5", +": c #2F2F2F", +"< c #3B3B3B", +"[ c #4A4C4A", +"} c #949295", +"| c #FFFBFF", +"1 c #E2DEE2", +"2 c #3E3D3E", +"3 c #0F0F0F", +"4 c #353435", +"5 c #7D7C7D", +"6 c #757275", +"7 c #817F81", +"8 c #F3EFF3", +"9 c #757475", +"0 c #121212", +"a c #191919", +"b c #343334", +"c c #A19DA1", +"d c #6F6C6F", +"e c #A9A7A9", +"f c #E2DFE2", +"g c #2C2B2C", +"h c #010101", +"i c #1E1D1C", +"j c #2A2A2B", +"k c #1F1F1F", +"l c #616061", +"m c #F4F0F4", +"n c #9E9D9E", +"o c #CCC9CC", +"p c #F6F3F6", +"q c #212021", +"r c #4A494B", +"s c #232323", +"t c #777677", +"u c #E7E3E7", +"v c #878587", +"w c #B3B0B2", +"x c #FCF8FC", +"y c #171717", +"z c #ADAAAD", +"A c #878687", +"B c #676667", +"C c #AFABAF", +"D c #F6F2F6", +"E c #6C6A6C", +"F c #282728", +"G c #C1BDC1", +"H c #BAB7BA", +"I c #060606", +"J c #515051", +"K c #CAC6C9", +"L c #BEBABE", +"M c #585558", +"N c #C4C0C4", +"O c #CECACE", +"P c #252525", +"Q c #020202", +"R c #4A4848", +"S c #ACA9AB", +"T c #B3B0B3", +"U c #CCC8CC", +"V c #D4D0D4", +"W c #464546", +"X c #080808", +"Y c #575557", +"Z c #525352", +"` c #6C6B6C", +" . c #626263", +".. c #4E4D4E", +"+. c #4C4C4C", +"@. c #818081", +"#. c #535253", +"$. c #101010", +"%. c #222122", +"&. c #393839", +"*. c #545354", +"=. c #59585A", +"-. c #858485", +";. c #838183", +">. c #6D6B6D", +",. c #595959", +" . + ", +" @ # $ % & ", +" * = - ; > , ", +" ' ) ! ~ { ] ", +" ^ / ( _ : < ", +" [ } | 1 2 3 4 ) ", +" 5 6 7 8 9 0 - a b ", +" c d e f g h i j k ", +" l m n o p q - d r { s ", +" t u v w x b y z A > y ", +" B C 7 D E F G H I 3 ", +" J K L M N O P Q ", +" R S T U V W X Y ", +" Z ` ...+.@.#.$.%.&. ", +" *.=.-.;.>.,. "}; diff --git a/eworkpanel/icons/panel.xpm b/eworkpanel/icons/panel.xpm new file mode 100644 index 0000000..eea973e --- /dev/null +++ b/eworkpanel/icons/panel.xpm @@ -0,0 +1,199 @@ +/* XPM */ +static char * panel_xpm[] = { +"16 16 180 2", +" c None", +". c #C2D4D4", +"+ c #D4E0DD", +"@ c #DAE4DD", +"# c #D6E6E7", +"$ c #A0C0E0", +"% c #799BBF", +"& c #7EA0C1", +"* c #83A5C7", +"= c #8DAECE", +"- c #99B9D5", +"; c #B4D0E8", +"> c #BDD6EB", +", c #C1DEF6", +"' c #6A97CD", +") c #4A85D7", +"! c #3272CD", +"~ c #2063C1", +"{ c #175BB5", +"] c #1455A9", +"^ c #105098", +"/ c #79A1CD", +"( c #CEECFF", +"_ c #6989AF", +": c #469D2C", +"< c #5EC647", +"[ c #41942B", +"} c #33592C", +"| c #94A9AD", +"1 c #97BBE2", +"2 c #629AE3", +"3 c #5695F2", +"4 c #3C81E9", +"5 c #2A72DF", +"6 c #1C65D1", +"7 c #0D55BA", +"8 c #3371BE", +"9 c #C6E2FE", +"0 c #9FC3E8", +"a c #559D36", +"b c #8AD768", +"c c #89D968", +"d c #70D657", +"e c #5FBF51", +"f c #3972A0", +"g c #68A0F3", +"h c #5D9BF0", +"i c #4085E7", +"j c #2D76DD", +"k c #1D66CE", +"l c #185EBD", +"m c #92B8E5", +"n c #CBEAFF", +"o c #597692", +"p c #56A136", +"q c #548A47", +"r c #7C9F61", +"s c #9CB054", +"t c #86D155", +"u c #7B9B51", +"v c #5086CF", +"w c #69A1F1", +"x c #498BE9", +"y c #337ADF", +"z c #1A64CD", +"A c #6C9EDC", +"B c #D9F1FF", +"C c #95B9E2", +"D c #509435", +"E c #72A867", +"F c #8CC064", +"G c #93CB67", +"H c #86CE58", +"I c #A9B655", +"J c #3268A7", +"K c #5B97EA", +"L c #5997ED", +"M c #397FE1", +"N c #3A7CD8", +"O c #C1DBF7", +"P c #C2E3FF", +"Q c #556E8F", +"R c #52902E", +"S c #8EB256", +"T c #73C153", +"U c #79C15C", +"V c #A0CF6A", +"W c #A5B04F", +"X c #2960A0", +"Y c #3781E6", +"Z c #4D90ED", +"` c #3E84E3", +" . c #92BBEE", +".. c #D6EFFF", +"+. c #82A9D6", +"@. c #418928", +"#. c #62AB57", +"$. c #7BB955", +"%. c #638E56", +"&. c #81C651", +"*. c #ABB550", +"=. c #5D83AA", +"-. c #3E87E9", +";. c #277AEA", +">. c #4F90E8", +",. c #CBE3FA", +"'. c #A3CEFF", +"). c #42628D", +"!. c #2F8114", +"~. c #48AA2D", +"{. c #5B9B41", +"]. c #449D35", +"^. c #7EC451", +"/. c #A3B253", +"(. c #778790", +"_. c #A3C8F5", +":. c #63A4F6", +"<. c #A6CAF6", +"[. c #C1E0FE", +"}. c #5695E5", +"|. c #2D423A", +"1. c #2C7E0F", +"2. c #41A723", +"3. c #537F3D", +"4. c #518A41", +"5. c #70B84B", +"6. c #213A0C", +"7. c #4A5B6F", +"8. c #9AB5D2", +"9. c #B4D5F9", +"0. c #6DA5F4", +"a. c #619CDB", +"b. c #313B27", +"c. c #2D800F", +"d. c #5BB136", +"e. c #5C8E3F", +"f. c #54943D", +"g. c #67AC44", +"h. c #3A4641", +"i. c #929997", +"j. c #AAABA8", +"k. c #A4B0B8", +"l. c #A0C8F6", +"m. c #A3C8F8", +"n. c #B7D9F8", +"o. c #596C76", +"p. c #287010", +"q. c #53A42F", +"r. c #6DB546", +"s. c #71AE50", +"t. c #82A2AD", +"u. c #DEF1FF", +"v. c #EDFCFF", +"w. c #EAF9FF", +"x. c #E5F3FD", +"y. c #C2DFF9", +"z. c #96C6FC", +"A. c #7FBFFF", +"B. c #2E4B5F", +"C. c #214512", +"D. c #38831C", +"E. c #419624", +"F. c #5C7982", +"G. c #B5D4F4", +"H. c #CDE9FF", +"I. c #D2E8FC", +"J. c #C0E0FE", +"K. c #A7D5FF", +"L. c #7CADDC", +"M. c #4D739E", +"N. c #25303B", +"O. c #1F400F", +"P. c #4C5D71", +"Q. c #97BCE5", +"R. c #C1E5FF", +"S. c #9FC4DB", +"T. c #5B7A92", +"U. c #252B30", +"V. c #415678", +"W. c #2C3134", +" . + @ ", +" # $ % & & * = - ; > ", +" , ' ) ! ~ { ] ^ / ( _ ", +": < [ } | 1 2 3 4 5 6 7 8 9 0 ", +"a b c d e f g h i j k l m n o ", +"p q r s t u v w x y z A B C ", +"D E F G H I J K L M N O P Q ", +"R S T U V W X Y Z ` ...+. ", +"@.#.$.%.&.*.=.-.;.>.,.'.). ", +"!.~.{.].^./.(._.:.<.[.}.|. ", +"1.2.3.4.5.6. 7.8.9.0.a.b. ", +"c.d.e.f.g.h.i.j.k.l.m.n.o. ", +" p.q.r.s.t.u.v.w.x.y.z.A.B. ", +" C.D.E.F.G.H.I.J.K.L.M.N. ", +" O. P.Q.R.S.T.U. ", +" V.W. "}; diff --git a/eworkpanel/icons/penguin.xpm b/eworkpanel/icons/penguin.xpm new file mode 100644 index 0000000..7862e3f --- /dev/null +++ b/eworkpanel/icons/penguin.xpm @@ -0,0 +1,358 @@ +/* XPM */ +static char * penguin_xpm[] = { +"32 32 323 2", +" c None", +". c #A5A5A5", +"+ c #727272", +"@ c #555555", +"# c #6B6B6B", +"$ c #7D7D7D", +"% c #A4A4A4", +"& c #A7A7A7", +"* c #848484", +"= c #868686", +"- c #979797", +"; c #999999", +"> c #959595", +", c #8B8B8B", +"' c #737373", +") c #757575", +"! c #808080", +"~ c #777777", +"{ c #A2A2A2", +"] c #A0A0A0", +"^ c #9C9C9C", +"/ c #969696", +"( c #909090", +"_ c #898989", +": c #838383", +"< c #767676", +"[ c #3F3F3F", +"} c #616161", +"| c #ADADAD", +"1 c #EAEAEA", +"2 c #F4F4F4", +"3 c #B9B9B9", +"4 c #929292", +"5 c #8D8D8D", +"6 c #878787", +"7 c #7E7E7E", +"8 c #747474", +"9 c #6A6A6A", +"0 c #636363", +"a c #292929", +"b c #474747", +"c c #575757", +"d c #6F6F6F", +"e c #A3A3A3", +"f c #EBEBEB", +"g c #FCFCFC", +"h c #FEFEFE", +"i c #F5F5F5", +"j c #BCBCBC", +"k c #858585", +"l c #7F7F7F", +"m c #7A7A7A", +"n c #7B7B7B", +"o c #6C6C6C", +"p c #424242", +"q c #000000", +"r c #4A4A4A", +"s c #6D6D6D", +"t c #444444", +"u c #E0E0E0", +"v c #FDFDFD", +"w c #FFFFFF", +"x c #FBFBFB", +"y c #989898", +"z c #E2E2E2", +"A c #F3F3F3", +"B c #E8E8E8", +"C c #B5B5B5", +"D c #1B1B1B", +"E c #010101", +"F c #6E6E6E", +"G c #212121", +"H c #5B5B5B", +"I c #BABABA", +"J c #F2F2F2", +"K c #F9F9F9", +"L c #FAFAFA", +"M c #B4B4B4", +"N c #ECECEC", +"O c #F8F8F8", +"P c #0B0B0B", +"Q c #3A3A3A", +"R c #EEEEEE", +"S c #F7F7F7", +"T c #BBBBBB", +"U c #C2C2C2", +"V c #8F8F8F", +"W c #ABABAB", +"X c #CBCBCB", +"Y c #040404", +"Z c #535353", +"` c #060606", +" . c #464646", +".. c #4C4C4C", +"+. c #D0D0D0", +"@. c #E1E1E1", +"#. c #EFEFEF", +"$. c #696969", +"%. c #656565", +"&. c #565656", +"*. c #F1F1F1", +"=. c #BFBFBF", +"-. c #050505", +";. c #101010", +">. c #7E7D7D", +",. c #5E5E5E", +"'. c #030303", +"). c #3D3D3D", +"!. c #434343", +"~. c #CDCDCD", +"{. c #D9D9D9", +"]. c #DFDFDF", +"^. c #9B9B9B", +"/. c #676767", +"(. c #E6E6E6", +"_. c #D1D1D1", +":. c #919191", +"<. c #020202", +"[. c #070707", +"}. c #0D0D0D", +"|. c #363536", +"1. c #242424", +"2. c #C1C1C1", +"3. c #CACACA", +"4. c #F3F370", +"5. c #FEFE55", +"6. c #FEFE57", +"7. c #FEFE53", +"8. c #FEFE4F", +"9. c #FFF043", +"0. c #FAD554", +"a. c #D5D5D5", +"b. c #080808", +"c. c #111111", +"d. c #5C5C5C", +"e. c #1A1A1A", +"f. c #090909", +"g. c #2C2C2C", +"h. c #3B3B3B", +"i. c #595959", +"j. c #B1B1B1", +"k. c #C4C49E", +"l. c #F3F364", +"m. c #FFFF45", +"n. c #FFFE42", +"o. c #FFF23E", +"p. c #FFD33D", +"q. c #F2D69D", +"r. c #171717", +"s. c #404040", +"t. c #0A0A0A", +"u. c #373737", +"v. c #F9F9DB", +"w. c #FDFD5B", +"x. c #FFF339", +"y. c #FFCE36", +"z. c #F1CB8D", +"A. c #DEDDDD", +"B. c #E4E4E4", +"C. c #666666", +"D. c #0E0E0E", +"E. c #2D2D2D", +"F. c #0C0C0C", +"G. c #F5F2CA", +"H. c #FCD952", +"I. c #F2C481", +"J. c #DDDCDB", +"K. c #D8D7D7", +"L. c #D8D8D8", +"M. c #3C3C3C", +"N. c #222222", +"O. c #2A2A2A", +"P. c #202020", +"Q. c #CFCFCF", +"R. c #F0F0F0", +"S. c #E2E1E1", +"T. c #D9D8D9", +"U. c #D3D3D3", +"V. c #D6D6D6", +"W. c #D4D4D4", +"X. c #1C1C1C", +"Y. c #232323", +"Z. c #141414", +"`. c #131313", +" + c #F6F6F6", +".+ c #EFEEEF", +"++ c #DBDBDB", +"@+ c #DCDCDC", +"#+ c #C5C5C5", +"$+ c #4D4D4D", +"%+ c #1D1D1D", +"&+ c #282828", +"*+ c #121212", +"=+ c #3E3E3E", +"-+ c #3C3B3B", +";+ c #AEAEAE", +">+ c #DDDDDD", +",+ c #E5E5E5", +"'+ c #F3F2F2", +")+ c #CCCCCC", +"!+ c #B0B0B0", +"~+ c #303030", +"{+ c #454545", +"]+ c #B7B6B7", +"^+ c #A4A3A3", +"/+ c #ADACAC", +"(+ c #282727", +"_+ c #4F4F4F", +":+ c #C4C4C4", +"<+ c #E7E7E7", +"[+ c #C3C3C3", +"}+ c #B6B6B6", +"|+ c #A8A8A8", +"1+ c #8E8E8E", +"2+ c #353535", +"3+ c #EDEDED", +"4+ c #E9E9E9", +"5+ c #C7C7C7", +"6+ c #A1A1A1", +"7+ c #8C8C8C", +"8+ c #343434", +"9+ c #D7D7D7", +"0+ c #E3E3E3", +"a+ c #B2B2B2", +"b+ c #A6A6A6", +"c+ c #9A9A9A", +"d+ c #8A8A8A", +"e+ c #545353", +"f+ c #BDBDBD", +"g+ c #C9C9C9", +"h+ c #B7B7B7", +"i+ c #ACACAC", +"j+ c #9E9E9E", +"k+ c #939393", +"l+ c #888888", +"m+ c #4B4B4B", +"n+ c #DADADA", +"o+ c #DEDEDE", +"p+ c #CECECE", +"q+ c #AFAFAF", +"r+ c #BEBEBE", +"s+ c #C6C6C6", +"t+ c #B3B3B3", +"u+ c #434242", +"v+ c #C0C0C0", +"w+ c #A9A9A9", +"x+ c #AAAAAA", +"y+ c #FCFCD4", +"z+ c #FCFC98", +"A+ c #F8F76E", +"B+ c #F6F14B", +"C+ c #F1E64C", +"D+ c #DFD474", +"E+ c #CEC69B", +"F+ c #BFBEBC", +"G+ c #A7A7A0", +"H+ c #C1C0A4", +"I+ c #E2E2C6", +"J+ c #F2F2B9", +"K+ c #F6F386", +"L+ c #F3F056", +"M+ c #EBDF5B", +"N+ c #FDFA99", +"O+ c #FDF896", +"P+ c #FDF88F", +"Q+ c #FDF481", +"R+ c #FDED67", +"S+ c #F8DA40", +"T+ c #F2C73B", +"U+ c #EDBB4A", +"V+ c #DBAF67", +"W+ c #BEB19E", +"X+ c #B8B088", +"Y+ c #E0D377", +"Z+ c #F5EDB0", +"`+ c #F9F2BF", +" @ c #FCF4B8", +".@ c #FCF2A1", +"+@ c #F7E46A", +"@@ c #EFC83B", +"#@ c #E0A53D", +"$@ c #CC895E", +"%@ c #FCE136", +"&@ c #FCE13D", +"*@ c #FBE254", +"=@ c #FADE5A", +"-@ c #F9D754", +";@ c #F7C444", +">@ c #F2AA35", +",@ c #EB9031", +"'@ c #E17832", +")@ c #D66A33", +"!@ c #BB8061", +"~@ c #CC9F4E", +"{@ c #E8AE44", +"]@ c #EEBC62", +"^@ c #F1C373", +"/@ c #F1C273", +"(@ c #ECB55F", +"_@ c #E29C3E", +":@ c #D37C2B", +"<@ c #BA5527", +"[@ c #90251E", +"}@ c #F2C767", +"|@ c #F1B64E", +"1@ c #EEA740", +"2@ c #EC9537", +"3@ c #E57F33", +"4@ c #DF6B36", +"5@ c #D65C3E", +"6@ c #CD5B4C", +"7@ c #C66E63", +"8@ c #856559", +"9@ c #A7886A", +"0@ c #D28C60", +"a@ c #CF7347", +"b@ c #CB6137", +"c@ c #C7562E", +"d@ c #BF4E29", +"e@ c #B7462A", +"f@ c #AC4233", +"g@ c #A04340", +"h@ c #9A5555", +" ", +" . + @ @ # $ % ", +" & * = - ; ; > , ' ) - ", +" ! ~ { . ] ^ / ( _ : < [ # ", +" } ! | 1 2 3 4 5 6 7 8 9 0 a b ", +" c d e f g h i j k l < m n o p q r ", +" s t = u g v h w x y < | z A B C D E F ", +" / G H I J K L x L M ; { N v x O A ^ E P n ", +" b Q @ u R J i S T U V W - L O J f X E Y Z ", +" ` ...+.@.B f #.$.9 %.+ &.2 *.f @.=.E -.;.>. ", +" ,.'.).!.4 ~.{.].z ^./.~ C > N (.u _.:.<.[.}.) ", +" |.Y 1.Q ..e 2.3.4.5.6.7.8.9.0.a.X ] a '.b.c.d. ", +" e.` f.g.h.i.| j.k.l.m.n.o.p.q.].{.F '.-.P r.!. ", +" s.t.-.E ;.u.W S K L v.w.x.y.z.@.u A.B.C.` D.e.E. ", +" F.E <.q q d *.i S K O G.H.I.J.K.a.L.L._.M.c.D N.F ", +" O.q q E q P.Q.f R.i O S 2 N S.T.U.V.L.W.X e e.X.Y.Z.[ ", +" H E.`.'.E E q s @.B R J +S +.+B u ++@+K.+.#+j $+%+&+&+*+=+ ", +" -+}.<.Z.;+>+,+f *.i + +'+R (.z >+a.)+=.!+! ~+{+]+^+/+ ", +" (+c.<._+:+L.u B R J 2 2 *.R <+@.{.Q.[+}+|+1+2+.. ", +" G E : [+U.@+B.1 R #.R.3+4+z @+U.5+T | 6+7+h.&. ", +" 8+Y { 2.Q.9+u (.1 f 1 B 0+>+a.X =.a+b+c+d+[ e+ ", +" p f.|+f+g+U.++u 0+,+B.z >+9+~.[+h+i+j+k+l+M.m+ ", +" O.j+h+:+~.a.n+o+].o+n+V.p+#+j q+e - 1+$ p ", +" [ d+a+r+s+~.U.9+9+a.U.~.s+j t+b+^.:.l+$.u+ ", +" d - h+v+#+)+p+p+~.g+U j t+w+j+> 7++ d ", +" # x+3 2.#+5+s+[+=.3 a+W { c+( ~ s ", +" y+z+A+B+C+D+E+F+f+I }+q+x+G+H+I+J+K+L+M+ ", +" N+O+P+Q+R+S+T+U+V+W+j.;+& X+Y+Z+`+ @.@+@@@#@$@ ", +" %@&@*@=@-@;@>@,@'@)@!@c+- :.~@{@]@^@/@(@_@:@<@[@ ", +" }@|@1@2@3@4@5@6@7@8@ 9@0@a@b@c@d@e@f@g@h@ ", +" ", +" "}; diff --git a/eworkpanel/icons/programs.xpm b/eworkpanel/icons/programs.xpm new file mode 100644 index 0000000..98d7cc5 --- /dev/null +++ b/eworkpanel/icons/programs.xpm @@ -0,0 +1,155 @@ +/* XPM */ +static char * programs_xpm[] = { +"16 16 136 2", +" c None", +". c #469FFF", +"+ c #4193FF", +"@ c #4499FF", +"# c #2C63AC", +"$ c #4DA0FF", +"% c #B5D9FB", +"& c #AAD3FB", +"* c #ADD3FB", +"= c #89C4FF", +"- c #184888", +"; c #4495FF", +"> c #AED5FB", +", c #6DB3F9", +"' c #6FB2F9", +") c #6BAEF8", +"! c #67ABF6", +"~ c #549FF9", +"{ c #3E91FF", +"] c #ACD4FB", +"^ c #6BAEF9", +"/ c #6CAFF8", +"( c #66AAF7", +"_ c #5DA3F6", +": c #74AEF7", +"< c #9EC4F8", +"[ c #92BCF7", +"} c #8DB5F5", +"| c #88B1F3", +"1 c #83ABF2", +"2 c #80A8F0", +"3 c #87AEF5", +"4 c #0940B7", +"5 c #AAD2FB", +"6 c #67ACF8", +"7 c #68ABF8", +"8 c #61A4F7", +"9 c #5B9FF5", +"0 c #5399F3", +"a c #498FF1", +"b c #3F85EF", +"c c #367CEB", +"d c #2E73E8", +"e c #286BE6", +"f c #2164E2", +"g c #2163E5", +"h c #023AB6", +"i c #4394FF", +"j c #A7D0FA", +"k c #63A9F7", +"l c #61A7F7", +"m c #5BA0F6", +"n c #5499F4", +"o c #4B90F2", +"p c #4186EF", +"q c #377DEB", +"r c #2E73E7", +"s c #266AE5", +"t c #2062E2", +"u c #1C5DDF", +"v c #1A5CE2", +"w c #A4CEF9", +"x c #5DA5F7", +"y c #5DA1F6", +"z c #559AF4", +"A c #4C91F3", +"B c #4489F1", +"C c #3A7FED", +"D c #3075E9", +"E c #276BE5", +"F c #2062E1", +"G c #1B5CDE", +"H c #1758DB", +"I c #1857DE", +"J c #0239B6", +"K c #A1CBF9", +"L c #589FF6", +"M c #559BF5", +"N c #4F96F3", +"O c #478CF2", +"P c #3D84F0", +"Q c #3378EB", +"R c #2B6EE7", +"S c #2265E3", +"T c #1C5DDE", +"U c #1757DB", +"V c #1554DA", +"W c #1555DD", +"X c #0139B5", +"Y c #4696FF", +"Z c #FFFFFF", +"` c #FBFBFB", +" . c #F2F2F2", +".. c #E9E9E9", +"+. c #E0E0E0", +"@. c #D7D7D7", +"#. c #D4D4D4", +"$. c #A9A9A9", +"%. c #BABABA", +"&. c #9E9990", +"*. c #0A3DAF", +"=. c #FEFEFE", +"-. c #F8F8F8", +";. c #F1F1F1", +">. c #E8E8E8", +",. c #DCDCDC", +"'. c #D6D6D6", +"). c #D2D2D2", +"!. c #A7A7A7", +"~. c #B7B7B7", +"{. c #929292", +"]. c #BAB6AC", +"^. c #0E41B3", +"/. c #F0F0F0", +"(. c #E5E5E5", +"_. c #DDDDDD", +":. c #D3D3D3", +"<. c #D0D0D0", +"[. c #ABABAB", +"}. c #B5B5B5", +"|. c #939393", +"1. c #ADADAD", +"2. c #938E85", +"3. c #0A3DAE", +"4. c #FFFFFE", +"5. c #F4F4F4", +"6. c #EDEDED", +"7. c #DBDBDB", +"8. c #AEAEAE", +"9. c #969696", +"0. c #878787", +"a. c #AFABA1", +"b. c #0D40B2", +"c. c #0037B2", +"d. c #0034A8", +"e. c #0038B6", +" ", +" . + @ # ", +" $ % & * = - ", +"; > , ' ) ! ~ { + + + + + . ", +"; ] ^ / ( _ : < [ } | 1 2 3 4 ", +"; 5 6 7 8 9 0 a b c d e f g h ", +"i j k l m n o p q r s t u v h ", +"i w x y z A B C D E F G H I J ", +"i K L M N O P Q R S T U V W X ", +"Y Z Z Z Z ` ...+.@.#.$.%.&.*. ", +"Y Z Z =.-.;.>.,.'.).!.~.{.].^. ", +"Y Z =.-./.(._.:.<.[.}.|.1.2.3. ", +"Y 4.5.6.(.7.#.<.1.8.9.!.0.a.b. ", +" c.d.d.d.d.d.d.d.d.d.d.d.e. ", +" ", +" "}; diff --git a/eworkpanel/icons/programs_user.xpm b/eworkpanel/icons/programs_user.xpm new file mode 100644 index 0000000..26f4c98 --- /dev/null +++ b/eworkpanel/icons/programs_user.xpm @@ -0,0 +1,178 @@ +/* XPM */ +static char * programs_user_xpm[] = { +"18 18 157 2", +" c None", +". c #4193FF", +"+ c #ACD4FB", +"@ c #AAD3FB", +"# c #A9D1FB", +"$ c #A7CFFA", +"% c #72B6F9", +"& c #70B3F9", +"* c #6DAFF8", +"= c #67ABF7", +"- c #62A8F6", +"; c #70B1F9", +"> c #6DB0F8", +", c #68ABF7", +"' c #63A8F6", +") c #5CA1F6", +"! c #99C2F8", +"~ c #95BEF7", +"{ c #8FB9F6", +"] c #8BB3F4", +"^ c #86AFF2", +"/ c #82AAF2", +"( c #7FA7EF", +"_ c #7CA4EF", +": c #0034A8", +"< c #6CAFF8", +"[ c #69ACF8", +"} c #63A6F7", +"| c #5DA1F6", +"1 c #569CF4", +"2 c #4E94F2", +"3 c #448AF0", +"4 c #3B81ED", +"5 c #3379E9", +"6 c #2C70E7", +"7 c #3770E2", +"8 c #7290DC", +"9 c #7C89D2", +"0 c #1B3BA1", +"a c #A6CFFB", +"b c #69ACF7", +"c c #63A8F7", +"d c #5DA2F6", +"e c #579BF5", +"f c #4F94F2", +"g c #468AF1", +"h c #3C81ED", +"i c #5B8DE6", +"j c #4B7FE3", +"k c #2C69E1", +"l c #A59DCE", +"m c #EBDAE1", +"n c #F2C4C8", +"o c #B16686", +"p c #A3CDFA", +"q c #63A9F7", +"r c #5EA2F6", +"s c #589DF5", +"t c #4F94F3", +"u c #488DF2", +"v c #5189E7", +"w c #E4ABB9", +"x c #FCBDBD", +"y c #F9C2C5", +"z c #ECB7BF", +"A c #FFDCDB", +"B c #FFD1D1", +"C c #FFB3B2", +"D c #FF9091", +"E c #D8676A", +"F c #A1CBFA", +"G c #5EA3F6", +"H c #579CF5", +"I c #5198F4", +"J c #4A8FF2", +"K c #7A8DD2", +"L c #DE7E8C", +"M c #FF7373", +"N c #FF8889", +"O c #FFA8A7", +"P c #FFC1C0", +"Q c #FFC2C3", +"R c #FFB8B7", +"S c #FE9F9E", +"T c #FF6D6D", +"U c #E94647", +"V c #FFFFFF", +"W c #FDFDFD", +"X c #E97777", +"Y c #F54443", +"Z c #FF5D5D", +"` c #FF7A7B", +" . c #FF8F8F", +".. c #FF9B9C", +"+. c #FF8988", +"@. c #FE6363", +"#. c #FF3939", +"$. c #E53031", +"%. c #FAFAFA", +"&. c #F3F3F3", +"*. c #DCA0A2", +"=. c #EA4142", +"-. c #FF4646", +";. c #FF5C5D", +">. c #FE6B6C", +",. c #FF7171", +"'. c #FF6B6A", +"). c #FF5A59", +"!. c #FF4848", +"~. c #FF3535", +"{. c #DA2E2E", +"]. c #E8E8E8", +"^. c #DDDBDB", +"/. c #D48383", +"(. c #FD2F2F", +"_. c #FF4B4A", +":. c #FE5555", +"<. c #FF5958", +"[. c #FF5655", +"}. c #FF4C4C", +"|. c #FF3D3E", +"1. c #FF2C2C", +"2. c #BF3436", +"3. c #F6F6F6", +"4. c #EFEFEF", +"5. c #DEDEDE", +"6. c #D7D7D7", +"7. c #CFCDCD", +"8. c #D54444", +"9. c #FF3635", +"0. c #FF3D3D", +"a. c #FE4241", +"b. c #FF4141", +"c. c #FE3939", +"d. c #FA2A2A", +"e. c #EE2929", +"f. c #883435", +"g. c #263B97", +"h. c #BD3840", +"i. c #FE2F2E", +"j. c #FE2829", +"k. c #F62829", +"l. c #F12324", +"m. c #F41717", +"n. c #AA3C3D", +"o. c #000000", +"p. c #290E0F", +"q. c #993031", +"r. c #D72F2F", +"s. c #E92021", +"t. c #E81213", +"u. c #B52526", +"v. c #4E2E2F", +"w. c #551A1A", +"x. c #9F2C2C", +"y. c #B62527", +"z. c #542021", +" ", +" ", +" . . . . ", +" . + @ # $ . ", +". + % & * = - . . . . . . . . ", +". @ ; > , ' ) ! ~ { ] ^ / ( _ : ", +". # < [ } | 1 2 3 4 5 6 7 8 9 0 ", +". a b c d e f g h i j k l m n o ", +". p q r s t u v w x y z A B C D E ", +". F G H I J K L M N O P Q R S T U ", +". V V V V W X Y Z ` .....+.@.#.$. ", +". V V V %.&.*.=.-.;.>.,.'.).!.~.{. ", +". V V %.&.].^./.(._.:.<.[.}.|.1.2. ", +". V 3.4.].5.6.7.8.9.0.a.b.c.d.e.f. ", +" : : : : : : : g.h.i.j.k.l.m.n. ", +" o.o.o.o.o.o.p.q.r.s.t.u.v. ", +" w.x.y.z. ", +" "}; diff --git a/eworkpanel/icons/run.xpm b/eworkpanel/icons/run.xpm new file mode 100644 index 0000000..63958bf --- /dev/null +++ b/eworkpanel/icons/run.xpm @@ -0,0 +1,177 @@ +/* XPM */ +static char * run_xpm[] = { +"16 16 158 2", +" c None", +". c #2D2D52", +"+ c #454584", +"@ c #555589", +"# c #6A6A91", +"$ c #262655", +"% c #4A4A8C", +"& c #595995", +"* c #5D5D9B", +"= c #6969A6", +"- c #7E7EB3", +"; c #9898C8", +"> c #5E5E81", +", c #39396B", +"' c #2F2F68", +") c #414184", +"! c #63639A", +"~ c #7272A6", +"{ c #7E7EB1", +"] c #8787B9", +"^ c #8C8CBC", +"/ c #AFAFD2", +"( c #ACACD7", +"_ c #21214E", +": c #2E2E62", +"< c #3F3F84", +"[ c #50508B", +"} c #9E9EC5", +"| c #C4C4DF", +"1 c #C0C0DC", +"2 c #A9A9CF", +"3 c #9595C2", +"4 c #9A9AC6", +"5 c #A6A6CD", +"6 c #AAAAD2", +"7 c #6C6C99", +"8 c #28285D", +"9 c #555591", +"0 c #B8B8D5", +"a c #BEBEDB", +"b c #8989BB", +"c c #6868A4", +"d c #8B8BB6", +"e c #AEAED2", +"f c #ADADD1", +"g c #BDBDDB", +"h c #D7D7F0", +"i c #7676A1", +"j c #202045", +"k c #4B4B8A", +"l c #A8A8CC", +"m c #BBBBDA", +"n c #7878B1", +"o c #464681", +"p c #29295A", +"q c #38385A", +"r c #ADADD7", +"s c #BCBCDB", +"t c #C5C5DF", +"u c #DDDDEE", +"v c #A8A8D3", +"w c #1A1A36", +"x c #2F2F54", +"y c #555596", +"z c #7272A7", +"A c #C6C6E0", +"B c #8383B8", +"C c #474785", +"D c #0C0C1E", +"E c #2E2E4D", +"F c #B2B2DC", +"G c #CCCCE4", +"H c #D1D1E7", +"I c #C3C3DE", +"J c #ABABD1", +"K c #52528E", +"L c #555597", +"M c #6A6AA3", +"N c #9191BE", +"O c #B5B5D7", +"P c #565692", +"Q c #0A0A1D", +"R c #8787AF", +"S c #CACAE5", +"T c #B4B4D6", +"U c #8B8BBB", +"V c #7171AA", +"W c #42427D", +"X c #464676", +"Y c #8E8EBC", +"Z c #454582", +"` c #8E8EB9", +" . c #D2D2EC", +".. c #DADAEB", +"+. c #CDCDE4", +"@. c #8A8ABB", +"#. c #5B5B99", +"$. c #3A3A76", +"%. c #7171AC", +"&. c #9898C5", +"*. c #A0A0CA", +"=. c #57578F", +"-. c #373758", +";. c #8A8AB1", +">. c #D3D3ED", +",. c #D3D3E7", +"'. c #E6E6F2", +"). c #E7E7F3", +"!. c #7C7CB1", +"~. c #353570", +"{. c #8181B6", +"]. c #9F9FC9", +"^. c #A6A6CB", +"/. c #7878A2", +"(. c #BBBBE1", +"_. c #D1D1E9", +":. c #DEDEEE", +"<. c #F6F6FB", +"[. c #F3F3FA", +"}. c #8383B2", +"|. c #111125", +"1. c #6C6C8E", +"2. c #A1A1CF", +"3. c #B7B7D8", +"4. c #B5B5D6", +"5. c #BCBCDA", +"6. c #C8C8E5", +"7. c #D5D5E9", +"8. c #D7D7EA", +"9. c #D2D2E7", +"0. c #EFEFF7", +"a. c #EEEEF7", +"b. c #B1B1D4", +"c. c #9898C7", +"d. c #40406E", +"e. c #5B5B7F", +"f. c #AEAED9", +"g. c #B5B5D8", +"h. c #CFCFE8", +"i. c #D4D4E8", +"j. c #D8D8EA", +"k. c #B2B2D4", +"l. c #ABABD3", +"m. c #9797C7", +"n. c #6666A5", +"o. c #28285B", +"p. c #313160", +"q. c #BBBBD6", +"r. c #EEEEFB", +"s. c #363672", +"t. c #454576", +"u. c #333364", +"v. c #2A2A5D", +"w. c #9999C4", +"x. c #7070A9", +"y. c #393975", +"z. c #52528F", +"A. c #41417D", +" . + @ # ", +" $ % & * = - ; > ", +" , ' ) ! ~ { ] ^ / ( _ ", +" : < [ } | 1 2 3 4 5 6 7 ", +" 8 9 0 a b c [ d e f g h i ", +" j k l m n o p q r s t u v w ", +"x y z A B C D E F G H I J K ", +"L M N O P Q R S H T U V W ", +"X V Y 5 Z ` ...+.@.#.$. ", +" %.&.*.=. -.;.>.,.'.).!.~. ", +" {.].2 ^./.(._.:.'.<.[.}.|. ", +"1.2.3.4.5.6.7.8.9.0.a.b.c.d. ", +" e.f.g.h.i.j.k.U ^ l.m.n.o. ", +" p.=.q.r.I @.#.s.t.u.v. ", +" w.6 x.y. ", +" z.A. "}; diff --git a/eworkpanel/icons/showdesktop.xpm b/eworkpanel/icons/showdesktop.xpm new file mode 100644 index 0000000..b419121 --- /dev/null +++ b/eworkpanel/icons/showdesktop.xpm @@ -0,0 +1,138 @@ +/* XPM */ +static char * showdesktop_xpm[] = { +"16 16 119 2", +" c None", +". c #FEDB6F", +"+ c #8F6346", +"@ c #F8C400", +"# c #FEBD09", +"$ c #A75416", +"% c #FED105", +"& c #FB9611", +"* c #E7C21D", +"= c #FECE20", +"- c #BD6418", +"; c #41A0EE", +"> c #5AA9F6", +", c #8DB7B8", +"' c #F9DA36", +") c #FEB635", +"! c #99BFE7", +"~ c #BBD1ED", +"{ c #DAE0F3", +"] c #EEDA7B", +"^ c #FEDC48", +"/ c #D09959", +"( c #B8CFE9", +"_ c #FBF6F8", +": c #F6F0F3", +"< c #EDEBF5", +"[ c #E8DDD1", +"} c #FEDE68", +"| c #FED261", +"1 c #7C879F", +"2 c #1F6BD1", +"3 c #5FC0F9", +"4 c #93DBFD", +"5 c #BDE0F2", +"6 c #F0EDF3", +"7 c #EDEDF5", +"8 c #E9EBF7", +"9 c #E7D8CB", +"0 c #FCE0AC", +"a c #DEB78C", +"b c #4972B9", +"c c #256AD8", +"d c #2262C3", +"e c #83D8FE", +"f c #D1F8FE", +"g c #CFF8FE", +"h c #B3E6FB", +"i c #D7E3F0", +"j c #F6F3F7", +"k c #F0F2F9", +"l c #DDCEC9", +"m c #B3958B", +"n c #CCBEC4", +"o c #88A0CE", +"p c #225DC8", +"q c #1D5FD7", +"r c #1D67DB", +"s c #60B0DE", +"t c #CBFEFE", +"u c #CAF5FE", +"v c #AAE6FE", +"w c #B5DAF3", +"x c #F5F2F6", +"y c #F2F3F8", +"z c #E8E2E6", +"A c #D5CCD2", +"B c #DDDEEB", +"C c #E4E0E7", +"D c #6891D7", +"E c #1053D6", +"F c #0B4CD8", +"G c #256EE4", +"H c #52A0CF", +"I c #AEEDFE", +"J c #B1E7FE", +"K c #97D3F9", +"L c #DCE7F3", +"M c #FDF9FB", +"N c #F9F8FC", +"O c #FCFBFD", +"P c #F9F5F7", +"Q c #F8F2F2", +"R c #BEC5DE", +"S c #2F69D0", +"T c #4D90F1", +"U c #59A1FE", +"V c #4693CB", +"W c #9BE0FE", +"X c #95D7FE", +"Y c #A9D3F3", +"Z c #F2F1F3", +"` c #D7DEE9", +" . c #B5C6E0", +".. c #83A4D6", +"+. c #6290D3", +"@. c #6CA3E1", +"#. c #73B1F3", +"$. c #447CC4", +"%. c #3983C3", +"&. c #87D5FE", +"*. c #8CCFFD", +"=. c #76B3ED", +"-. c #5396E1", +";. c #4089E2", +">. c #4393F0", +",. c #50A6FE", +"'. c #3F84D6", +"). c #102F60", +"!. c #3170AC", +"~. c #74C5FE", +"{. c #6FBDFE", +"]. c #53A8FE", +"^. c #52ABFE", +"/. c #4191EC", +"(. c #163F77", +"_. c #2864A4", +":. c #79C8FE", +"<. c #4299F8", +"[. c #1C5399", +" . + ", +" @ # $ ", +" % & ", +" * = - ", +" ; > , ' ) ", +" ! ~ { ] ^ / ", +" ( _ : < [ } | 1 2 ", +" 3 4 5 6 7 8 9 0 a b c d ", +"e f g h i j k l m n o p q r ", +"s t u v w x y z A B C D E F G ", +" H I J K L M N O P Q R S T U ", +" V W X Y Z ` ...+.@.#.$. ", +" %.&.*.=.-.;.>.,.'.). ", +" !.~.{.].^./.(. ", +" _.:.<.[. ", +" "}; diff --git a/eworkpanel/icons/shutdown.xpm b/eworkpanel/icons/shutdown.xpm new file mode 100644 index 0000000..a33811e --- /dev/null +++ b/eworkpanel/icons/shutdown.xpm @@ -0,0 +1,160 @@ +/* XPM */ +static char * shutdown_xpm[] = { +"16 16 141 2", +" c None", +". c #A01105", +"+ c #B14030", +"@ c #AF3829", +"# c #AE3829", +"$ c #AF3526", +"% c #AC3525", +"& c #AC3423", +"* c #AC3122", +"= c #AC3120", +"- c #AA2E20", +"; c #AC3421", +"> c #9F1005", +", c #DDB593", +"' c #C6714C", +") c #C77954", +"! c #C87C54", +"~ c #C87E58", +"{ c #CA8158", +"] c #C98159", +"^ c #CC855A", +"/ c #CA875C", +"( c #CA8A5E", +"_ c #CE8F63", +": c #D5A576", +"< c #A72718", +"[ c #DCB492", +"} c #B23E18", +"| c #B8532E", +"1 c #B95831", +"2 c #BC5C36", +"3 c #BD6038", +"4 c #D39173", +"5 c #D59376", +"6 c #C06B43", +"7 c #C26E48", +"8 c #C4724B", +"9 c #C4754E", +"0 c #C67953", +"a c #D39E72", +"b c #A01205", +"c c #B03F2F", +"d c #C87C57", +"e c #B8522C", +"f c #BB5E37", +"g c #C46B49", +"h c #F7D4C5", +"i c #FFFFFF", +"j c #F3D0BF", +"k c #CA815D", +"l c #C67B54", +"m c #C77E57", +"n c #D09468", +"o c #A82B19", +"p c #C77753", +"q c #F8D7C8", +"r c #DCA288", +"s c #E3B097", +"t c #FFEFE5", +"u c #FFFAF3", +"v c #CD8863", +"w c #C8825C", +"x c #CF9469", +"y c #A72413", +"z c #E2AB93", +"A c #C26D46", +"B c #F2CFBD", +"C c #EEC6B3", +"D c #C57750", +"E c #E5B59E", +"F c #F0CDBA", +"G c #C98661", +"H c #D1956B", +"I c #A72312", +"J c #C87754", +"K c #C3714A", +"L c #FFF0E6", +"M c #FFF2E8", +"N c #CA8963", +"O c #D0976D", +"P c #A52110", +"Q c #D8997B", +"R c #C4744D", +"S c #FFF0E7", +"T c #C8815A", +"U c #ECC5B1", +"V c #D7A07F", +"W c #D19B72", +"X c #A51F0E", +"Y c #D89B7E", +"Z c #FFF1E7", +"` c #C98560", +" . c #EDC7B2", +".. c #DCAC90", +"+. c #D29D76", +"@. c #A51D0C", +"#. c #CC815E", +"$. c #CA8862", +"%. c #FFF5EC", +"&. c #D39977", +"*. c #D79F79", +"=. c #A21B09", +"-. c #DBA285", +";. c #FADFD1", +">. c #F1CFBC", +",. c #E9C0A9", +"'. c #F9DED0", +"). c #D59E7F", +"!. c #D4A17D", +"~. c #A21907", +"{. c #CA8A5F", +"]. c #CF8B6A", +"^. c #E2B39A", +"/. c #E3B59B", +"(. c #FCE4D5", +"_. c #FFFFF9", +":. c #D9A185", +"<. c #D5A283", +"[. c #D7A685", +"}. c #A21705", +"|. c #AC3422", +"1. c #CC8A5F", +"2. c #C5764F", +"3. c #FDE7DA", +"4. c #D49E7F", +"5. c #DAA98D", +"6. c #D7A585", +"7. c #A21905", +"8. c #D5A677", +"9. c #CF926E", +"0. c #E1B195", +"a. c #E1B59A", +"b. c #D9A88B", +"c. c #E5C8AE", +"d. c #C77C57", +"e. c #9F1105", +"f. c #D7A582", +"g. c #DBB092", +"h. c #C77955", +"i. c #A01201", +"j. c #A11703", +" . + @ # $ % & * = - ; > ", +" @ , ' ) ! ~ { ] ^ / ( _ : < ", +". [ } | 1 2 3 4 5 6 7 8 9 0 a b ", +"c d e f g h i i i i j k l m n o ", +"@ p 1 g i i q r s t i u v w x y ", +"# ! 2 h i z A B C D E i F G H I ", +"$ ~ J i q A K t L l m M i N O P ", +"% { 4 i Q K R L S m T U i V W X ", +"& ] 5 i Y R D S Z T ` .i ..+.@.", +"* ^ #.i j D l Z M ` $.%.i &.*.=.", +"= / 7 t i -.m ;.>.$.,.i '.).!.~.", +"- {.8 ].i i ;.^./.(.i _.:.<.[.}.", +"|.1.2.l v ;.i i i i 3.:.4.5.6.7.", +"> 8.0 m w G 9.0.a.&.).<.b.c.d.e.", +" < a n x H O W +.*.!.f.g.h.i. ", +" b o y I P X @.=.~.}.j.e. "}; diff --git a/eworkpanel/icons/sound.xpm b/eworkpanel/icons/sound.xpm new file mode 100644 index 0000000..6c44b4a --- /dev/null +++ b/eworkpanel/icons/sound.xpm @@ -0,0 +1,162 @@ +/* XPM */ +static char * sound_xpm[] = { +"16 16 143 2", +" c None", +". c #7094A6", +"+ c #6D99A9", +"@ c #73949A", +"# c #6A9BB4", +"$ c #6D828C", +"% c #54595B", +"& c #A0D0E7", +"* c #689BB2", +"= c #5890AB", +"- c #536771", +"; c #2A2A2A", +"> c #424242", +", c #5C5C5C", +"' c #86BBD8", +") c #608191", +"! c #084268", +"~ c #A0D9F5", +"{ c #131313", +"] c #272727", +"^ c #404040", +"/ c #565656", +"( c #787C7E", +"_ c #4B83A5", +": c #001A2E", +"< c #022136", +"[ c #055087", +"} c #94D2F0", +"| c #435D6A", +"1 c #B9B9B9", +"2 c #F6F6F6", +"3 c #CCCCCC", +"4 c #595959", +"5 c #757575", +"6 c #4E8EB3", +"7 c #557384", +"8 c #15546E", +"9 c #005080", +"0 c #55B8EA", +"a c #A5EBFF", +"b c #8BCCEE", +"c c #2B2C2C", +"d c #E9E9E9", +"e c #F5F5F5", +"f c #F8F8F8", +"g c #8F8F8F", +"h c #7B7B7B", +"i c #638CA4", +"j c #447089", +"k c #5C8F9C", +"l c #98DBE9", +"m c #8DDBFF", +"n c #86D4FD", +"o c #72BEE5", +"p c #777777", +"q c #DFDFDF", +"r c #EBEBEB", +"s c #EFEFEF", +"t c #E1E1E1", +"u c #7D7D7D", +"v c #78A8C1", +"w c #29648D", +"x c #1D5D82", +"y c #55AED3", +"z c #54B1D8", +"A c #58B3DB", +"B c #65BBE3", +"C c #B2B2B2", +"D c #D1D1D1", +"E c #DCDCDC", +"F c #DEDEDE", +"G c #D8D8D8", +"H c #858585", +"I c #909A9F", +"J c #1C608D", +"K c #033B57", +"L c #0881A2", +"M c #329ABD", +"N c #359BBF", +"O c #55B1DB", +"P c #A1A1A1", +"Q c #B5B5B5", +"R c #C2C2C2", +"S c #C4C4C4", +"T c #C3C3C3", +"U c #8C8C8C", +"V c #95A0A6", +"W c #145683", +"X c #033241", +"Y c #004F65", +"Z c #0083A5", +"` c #0082A1", +" . c #49AAD8", +".. c #787878", +"+. c #A4A4A4", +"@. c #ABABAB", +"#. c #ACACAC", +"$. c #A7A7A7", +"%. c #999999", +"&. c #65A3C1", +"*. c #10507C", +"=. c #0D323C", +"-. c #00212D", +";. c #00556C", +">. c #00738D", +",. c #2CA1CF", +"'. c #737474", +"). c #797979", +"!. c #8B8B8B", +"~. c #919191", +"{. c #3E80A0", +"]. c #185775", +"^. c #001015", +"/. c #02141A", +"(. c #001A27", +"_. c #069BCE", +":. c #4D8FA4", +"<. c #484848", +"[. c #3A3A3A", +"}. c #A6A6A6", +"|. c #B0B0B0", +"1. c #01588A", +"2. c #13576F", +"3. c #001C2E", +"4. c #0096C8", +"5. c #9C9C9C", +"6. c #A2A2A2", +"7. c #AAAAAA", +"8. c #B3B3B3", +"9. c #B1BCBF", +"0. c #003C6B", +"a. c #003968", +"b. c #67A2B5", +"c. c #006596", +"d. c #074E6B", +"e. c #003764", +"f. c #5399B1", +"g. c #ADBDC3", +"h. c #006E9D", +"i. c #003562", +"j. c #023B5E", +"k. c #01375C", +"l. c #044262", +" . + @ ", +" # $ % & * ", +" = - ; > , ' ) ", +" ! ~ { ] ^ / ( _ ", +" : < [ } | 1 2 3 4 5 6 7 ", +" 8 9 0 a b c d e f g h i j ", +" k l m n o p q r s t u v w ", +" x y z A B C D E F G H I J ", +" K L M N O P Q R S T U V W ", +" X Y Z ` ...+.@.#.$.%.&.*. ", +" =.-.;.>.,.'.).U !.~.+.{.]. ", +" ^./.(._.:.<.[.4 }.|.1.2. ", +" 3.4.5.6.7.8.9.0. ", +" a.b.C 1 R c.d. ", +" e.f.g.h.i. ", +" j.k.l. "}; diff --git a/eworkpanel/icons/sound_penguin.xpm b/eworkpanel/icons/sound_penguin.xpm new file mode 100644 index 0000000..ccf41c7 --- /dev/null +++ b/eworkpanel/icons/sound_penguin.xpm @@ -0,0 +1,202 @@ +/* XPM */ +static char * sound_xpm[] = { +"16 16 183 2", +" c None", +". c #3B9929", +"+ c #4EAB37", +"@ c #49B437", +"# c #49B335", +"$ c #4EBC38", +"% c #368E23", +"& c #6A9A3F", +"* c #69AA41", +"= c #83B64E", +"- c #7FB24E", +"; c #8ACB6A", +"> c #69CB52", +", c #6FCB53", +"' c #7EA568", +") c #636764", +"! c #757475", +"~ c #5D5D5D", +"{ c #6D9832", +"] c #9EBB60", +"^ c #A0D777", +"/ c #5B9146", +"( c #515550", +"_ c #667467", +": c #7D9A7B", +"< c #C7C4C8", +"[ c #AFAEAF", +"} c #8F8F8F", +"| c #757575", +"1 c #424242", +"2 c #6D9941", +"3 c #73A644", +"4 c #7FCC5B", +"5 c #679149", +"6 c #181C17", +"7 c #5F5C5F", +"8 c #E5E1E6", +"9 c #FFFFFF", +"0 c #EBEBED", +"a c #969697", +"b c #C9CACB", +"c c #C6C6C6", +"d c #4C4C4C", +"e c #679133", +"f c #77AB43", +"g c #75BF55", +"h c #8FC968", +"i c #577144", +"j c #727274", +"k c #F5F4F5", +"l c #FEFEFD", +"m c #CCCCCB", +"n c #858587", +"o c #D4D5D3", +"p c #9E9E9E", +"q c #111111", +"r c #5E8E3A", +"s c #66A437", +"t c #4E803D", +"u c #78856B", +"v c #333B2D", +"w c #4F4E4F", +"x c #B8B8BA", +"y c #D9D9D7", +"z c #DDDE79", +"A c #D6D04B", +"B c #E8CB87", +"C c #D5D4D7", +"D c #535354", +"E c #0A0A0A", +"F c #262626", +"G c #3D7530", +"H c #629C39", +"I c #3B8727", +"J c #355B2C", +"K c #070707", +"L c #1C1C1C", +"M c #9A9A9A", +"N c #DDDDE1", +"O c #F4F5B9", +"P c #FFDB56", +"Q c #E5D1BA", +"R c #CCCDD0", +"S c #3A3A3A", +"T c #090909", +"U c #212121", +"V c #508C32", +"W c #68AE44", +"X c #19350F", +"Y c #000000", +"Z c #3D3D3D", +"` c #EFEFEF", +" . c #FEFEFE", +".. c #FCFBFD", +"+. c #EFE7DF", +"@. c #E1E1E5", +"#. c #E8E8E8", +"$. c #B1B1B1", +"%. c #242424", +"&. c #141414", +"*. c #478B2B", +"=. c #336C1D", +"-. c #122209", +";. c #050404", +">. c #8A8A8B", +",. c #F0F0F0", +"'. c #F2F1F1", +"). c #F7F7F8", +"!. c #F3F5F7", +"~. c #E9E9E9", +"{. c #D8D8D8", +"]. c #C4C4C4", +"^. c #5F5F5F", +"/. c #171717", +"(. c #468528", +"_. c #47902A", +":. c #5A754D", +"<. c #2A2729", +"[. c #BABABA", +"}. c #E0E0E0", +"|. c #ECECEC", +"1. c #DFDFDF", +"2. c #C9C9C9", +"3. c #7C7C7C", +"4. c #252525", +"5. c #488828", +"6. c #2B7013", +"7. c #404A3D", +"8. c #445D3F", +"9. c #B8B7B9", +"0. c #D3D3D3", +"a. c #E1E1E1", +"b. c #E4E4E4", +"c. c #DEDEDE", +"d. c #CFCFCF", +"e. c #B7B7B7", +"f. c #A0A0A0", +"g. c #4D842E", +"h. c #5A8F41", +"i. c #759257", +"j. c #69865B", +"k. c #A19DA7", +"l. c #C3C3CA", +"m. c #D0D1D4", +"n. c #D4D4D4", +"o. c #CDCDCD", +"p. c #BBBBBC", +"q. c #A1A1A3", +"r. c #8C8C91", +"s. c #515259", +"t. c #3E7829", +"u. c #335D28", +"v. c #1F4719", +"w. c #335426", +"x. c #8A9A66", +"y. c #CDCBA1", +"z. c #C7C9BA", +"A. c #C2C4C5", +"B. c #BABABB", +"C. c #A9ACAC", +"D. c #AEB1AA", +"E. c #A3A686", +"F. c #002510", +"G. c #002A0F", +"H. c #33581C", +"I. c #E3E665", +"J. c #FFF16C", +"K. c #FFCE45", +"L. c #EBA553", +"M. c #B19D92", +"N. c #999A99", +"O. c #D8BB79", +"P. c #FEE2A2", +"Q. c #FDDD7F", +"R. c #E7A330", +"S. c #753517", +"T. c #A47822", +"U. c #B17126", +"V. c #A54C22", +"W. c #7F2817", +"X. c #974520", +"Y. c #903B1F", +"Z. c #78241A", +" ", +" . + + @ # $ % ", +"& * = - ; > , ' ) ! ~ ", +"{ ] ^ / ( _ : < [ } | 1 ", +"2 3 4 5 6 7 8 9 0 a b c d ", +"e f g h i j k l m n o 9 p q ", +"r s t u v w x y z A B C D E F ", +"G H I J K L M N O P Q R S T U ", +" V W X Y Z ` ...+.@.#.$.%.&. ", +" *.=.-.;.>.,.'.).!.~.{.].^./.Y ", +" (._.:.<.[.}.|.,.|.1.2.$.3.4. ", +" 5.6.7.8.9.0.a.b.c.d.e.f.| ", +" g.h.i.j.k.l.m.n.o.p.q.r.s. ", +" t.u.v.w.x.y.z.A.B.C.D.E. ", +" F.G.H.I.J.K.L.M.N.O.P.Q.R.S. ", +" T.U.V.W. X.Y.Z. "}; diff --git a/eworkpanel/icons/tux.xpm b/eworkpanel/icons/tux.xpm new file mode 100644 index 0000000..71220b5 --- /dev/null +++ b/eworkpanel/icons/tux.xpm @@ -0,0 +1,91 @@ +/* XPM */ +static char * tux_xpm[] = { +"18 18 70 1", +" c None", +". c #000000", +"+ c #363636", +"@ c #5A5A5A", +"# c #0E0E0E", +"$ c #0D0D0D", +"% c #151515", +"& c #999999", +"* c #909090", +"= c #9C9C9C", +"- c #555555", +"; c #998B54", +"> c #E2CD41", +", c #BFAB31", +"' c #675930", +") c #131313", +"! c #81702D", +"~ c #E4BE29", +"{ c #DAAB05", +"] c #6A4411", +"^ c #343434", +"/ c #232323", +"( c #C8C8C5", +"_ c #DED4AF", +": c #E5DEB5", +"< c #939291", +"[ c #1A1A1A", +"} c #878787", +"| c #F5F5F5", +"1 c #EBEBEB", +"2 c #F0F0F0", +"3 c #DADADA", +"4 c #3B3B3B", +"5 c #DEDEDE", +"6 c #F7F7F7", +"7 c #F1F1F1", +"8 c #E8E8E8", +"9 c #7E7E7E", +"0 c #606060", +"a c #C4C4C4", +"b c #E9E9E9", +"c c #ECECEC", +"d c #575757", +"e c #141414", +"f c #58564D", +"g c #F0DE76", +"h c #4A3E00", +"i c #DBDBDB", +"j c #E4E4E4", +"k c #A99E88", +"l c #9F9149", +"m c #534508", +"n c #54472D", +"o c #B5A74B", +"p c #F8D505", +"q c #DCBB00", +"r c #6D6957", +"s c #B9B9B9", +"t c #A2A2A2", +"u c #4D4A41", +"v c #F7DB31", +"w c #E6C70C", +"x c #917F0F", +"y c #7B6D11", +"z c #8B7500", +"A c #5F4D00", +"B c #070500", +"C c #232116", +"D c #C7B134", +"E c #836E00", +" ", +" ", +" ", +" ..+@ ", +" #$%%. ", +" &*=-. ", +" ;>,') ", +" !~{]^ ", +" /(_:<[ ", +" }|1234. ", +" .561789. ", +" .0abc3de ", +" fgh^ijklmn ", +" opqrstuvwx ", +" yzAB..CDE ", +" ", +" ", +" "}; diff --git a/eworkpanel/item.cpp b/eworkpanel/item.cpp new file mode 100644 index 0000000..b1951c8 --- /dev/null +++ b/eworkpanel/item.cpp @@ -0,0 +1,127 @@ +#include "item.h" +#include "mainmenu.h" + +void layout_menu(EItemGroup *g, void *) { + g->add_items(); +} + +EItemGroup::EItemGroup(MainMenu *menu, int type, const char *name) +: fltk::Item_Group(name) +{ + m_modified = 0; + m_menu = menu; + m_gtype = type; + about_to_show = (fltk::Callback*)layout_menu; + m_access = true; +} + +void EItemGroup::add_items() +{ + struct stat s; + if(lstat(dir(), &s) == 0) { + if(!m_modified) { + m_modified = s.st_mtime; + } + if(m_modified != s.st_mtime) { + //dir has changed.. + m_modified = s.st_mtime; + clear(); + } + } + + if(!children() && access()) { + begin(); + if(group_type()==BROWSER_GROUP) + menu()->scan_filebrowser(dir()); + else if(group_type()==APP_GROUP) + menu()->scan_programitems(dir()); + end(); + } +} + +static fltk::Menu_Button *popupMenu=0; +static const char *dir = 0; + +void cb_menu(fltk::Widget *wid, long user_data) +{ + if(!dir) return; + char cmd[FL_PATH_MAX]; + + EDE_Config pGlobalConfig(find_config_file("ede.conf", false)); + + // we can't use Fl_String here, because gcc3.2.3 bug, so we will use + // plain char with stupid FL_PATH_MAX + switch(user_data) { + case 1: { + char term[FL_PATH_MAX]; + pGlobalConfig.get("Terminal", "Terminal", term, 0, sizeof(term)); + if(pGlobalConfig.error() && !term[0] || (strlen(term) == 0)) + strncpy(term, "xterm", sizeof(term)); + + snprintf(cmd, sizeof(cmd)-1, "cd %s; %s\n", dir, term); + } + break; + + case 2: { + char browser[FL_PATH_MAX]; + pGlobalConfig.get("Web", "Browser", browser, 0, sizeof(browser)); + if(pGlobalConfig.error() && !browser[0] || (strlen(browser) == 0)) + strncpy(browser, "mozilla", sizeof(browser)); + + snprintf(cmd, sizeof(cmd)-1, "%s %s\n", browser, dir); + } + break; + + case 0: + fltk::exit_modal(); + default: + return; + } + + fltk::start_child_process(cmd, false); +} + +int popup_menu() +{ + if(!popupMenu) { + popupMenu = new fltk::Menu_Button(0,0,0,0,0); + popupMenu->parent(0); + popupMenu->type(fltk::Menu_Button::POPUP3); + + popupMenu->add(_("Open with terminal..."),0,(fltk::Callback*)cb_menu,(void*)1); + popupMenu->add(_("Open with browser..."),0,(fltk::Callback*)cb_menu,(void*)2); + popupMenu->add(new fltk::Menu_Divider()); + popupMenu->add(_("Close Menu"),0,(fltk::Callback*)cb_menu,(void*)0); + } + return popupMenu->popup(); +} + +int EItemGroup::handle(int event) +{ + if(event == FL_RELEASE) { + if( fltk::event_button() == 3) { + ::dir = this->dir(); + int ret = popup_menu(); + ::dir = 0; + if(ret) return 0; + } + return 1; + } + return fltk::Item_Group::handle(event); +} + +int EItem::handle(int event) +{ + if(event==FL_RELEASE) { + if(type()==FILE) { + if(fltk::event_button() == 3) { + ::dir = this->dir(); + int ret = popup_menu(); + ::dir = 0; + return 1; + } + if(((EItemGroup*)parent())->group_type()==BROWSER_GROUP) return 1; + } + } + return fltk::Item::handle(event); +} diff --git a/eworkpanel/item.h b/eworkpanel/item.h new file mode 100644 index 0000000..f5e56f6 --- /dev/null +++ b/eworkpanel/item.h @@ -0,0 +1,98 @@ +#ifndef _ITEM_H_ +#define _ITEM_H_ + +#include +#include +#include +#include + +/*#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "EDE_Config.h" +#include + + +class MainMenu; + +enum { + NO_TYPE = 0, + APP_GROUP, + BROWSER_GROUP +}; + +class EItemGroup : public fltk::Item_Group { +public: + EItemGroup(MainMenu *menu, int type, const char *name=0); + ~EItemGroup() { } + + void add_items(); + + int handle(int event); + + int group_type() const { return m_gtype; } + void group_type(int val) { m_gtype = val; } + + bool access() const { return m_access; } + void access(bool val) { m_access = val; } + +// void dir(const Fl_String &dir) { m_dir = dir; } + void dir(const char *dir) { strcpy(m_dir, dir); } + const char *dir() const { return m_dir; } + + MainMenu *menu() { return m_menu; } + +private: + long m_modified; + int m_gtype; + char* m_dir; + bool m_access; + MainMenu *m_menu; +}; + +class EItem : public fltk::Item { +public: + EItem(MainMenu *menu, const char *name=0) : fltk::Item(name) { m_menu = menu; } + + enum { FILE=fltk::Item::NO_EXECUTE+1 }; + + int handle(int event); + + const char* dir() const { return ((EItemGroup*)parent())->dir(); } + + void exec(const char *exec) { strcpy(m_exec, exec); } +// void exec(const Fl_String &exec) { m_exec = exec; } + const char* exec() const { return m_exec; } + + void filename(const char *filename) { strcpy(m_filename, filename); } +// void filename(const Fl_String &filename) { m_filename = filename; } + const char* filename() const { return m_filename; } + + MainMenu *menu() const { return m_menu; } + +private: + char* m_filename; + char* m_exec; + MainMenu *m_menu; +}; + +#endif diff --git a/eworkpanel/keyboardchooser.cpp b/eworkpanel/keyboardchooser.cpp new file mode 100644 index 0000000..0b34ec0 --- /dev/null +++ b/eworkpanel/keyboardchooser.cpp @@ -0,0 +1,303 @@ +// Copyright (c) 2000. - 2005. EDE Authors +// This program is licenced under terms of the +// GNU General Public Licence version 2 or newer. +// See COPYING for details. + +#include "keyboardchooser.h" + +#define MAX_KEYBOARDS 5 + +KeyboardChooser *kbcapplet; + +static fltk::Image keyboard_pix((const char **)keyboard_xpm); + +void setKeyboard(const char* pKbdLayout) +{ + if(!pKbdLayout.empty()) { + char* proc = (char*)malloc(strlen("setxkbmap ")+strlen(pKbdLayout)); + proc = strcpy(proc, "setxkbmap "); + pKbdLayout = strcat(proc,pKbdLayout); + fltk::start_child_process(proc, false); + + char pShortKbd[2]; + strncpy(pShortKbd, pKbdLayout, 2); + kbcapplet->tooltip(pKbdLayout); + kbcapplet->label(pShortKbd); + kbcapplet->redraw(); + } +} + +// count occurences of character within string +int strcount(const char *string, int character) +{ + char *p = string; + int counter; + while (p != 0) + if (p++ == character) counter++; + return counter; +} + +void CB_setKeyboard(fltk::Item *item, void *pData) +{ + EDE_Config pGlobalConfig(find_config_file("ede.conf", true)); + if (!pGlobalConfig.error() && item) { + char* kbdname = item->field_name(); + + pGlobalConfig.set("Keyboard", "Layout", kbdname); + pGlobalConfig.flush(); + setKeyboard(kbdname); + + // update history + char* recentlist; + pGlobalConfig.get("Keyboard", "RecentKeyboards", recentlist, ""); + + if (strstr(recentlist, kbdname) != NULL) return; + if (strcount(recentlist, '|') > MAX_KEYBOARDS) + recentlist = strchr(recentlist, '|'); + + recentlist = realloc(recentlist, strlen(recentlist)+strlen(kbdname)+1); + strcat(recentlist, "|"); + strcat(recentlist, kbdname); + + pGlobalConfig.set("Keyboard", "RecentKeyboards", recentlist); + pGlobalConfig.flush(); + + // refresh menu list + for (int i=0; ichildren(); i++) { + if (strcmp(kbcapplet->child(i)->field_name(),kbdname) != 0) return; + } + fltk::Item *mKbdItem = new fltk::Item(item->label()); + mKbdItem->field_name(kbdname); + mKbdItem->callback((fltk::Callback*)CB_setKeyboard); + mKbdItem->image(keyboard_pix); + kbcapplet->insert(*mKbdItem,0); + } +} + +// in case something fails, this function will produce a +// static list of keymaps +void addKeyboardsOld(KeyboardChooser *mPanelMenu) +{ + char *countries[49] = { + "us", "en_US", "us_intl", "am", "az", "by", "be", "br", + "bg", "ca", "cz", "cz_qwerty", "dk", "dvorak", "ee", + "fi", "fr", "fr_CH", "de", "de_CH", "el", "hr", "hu", + "is", "il", "it", "jp", "lt", "lt_std", "lt_p", "lv", + "mk", "no", "pl", "pt", "ro", "ru", "sr", "si", + "sk", "sk_qwerty", "es", "se", "th", "ua", "gb", "vn", + "nec/jp", "tr" + }; + + mPanelMenu->begin(); + fltk::Item *mKbdItem = new fltk::Item("English (US)"); + mKbdItem->field_name("us"); + mKbdItem->callback((Fl_Callback*)CB_setKeyboard); + mKbdItem->image(keyboard_pix); + new fltk::Divider(10, 5); + fltk::Item_Group *more = new fltk::Item_Group(_("More...")); + mPanelMenu->end(); + + more->begin(); + for (int i=0; i<49; i++) + { + fltk::Item *mKbdItem = new fltk::Item(countries[i]); + mKbdItem->field_name(countries[i]); + mKbdItem->callback((Fl_Callback*)CB_setKeyboard); + mKbdItem->image(keyboard_pix); + } + more->end(); +} + +void addKeyboards(KeyboardChooser *mPanelMenu) +{ + const char* X11DirList[2] = {"/usr/X11R6/lib/X11/", "/usr/local/X11R6/lib/X11/"}; + const char* rulesFileList[2] = {"xkb/rules/xorg.lst", "xkb/rules/xfree86.lst"}; + char* xdir, xfilename; + FILE *fp; + char kbdnames[300][15]; + char kbddescriptions[300][50]; + EDE_Config pGlobalConfig(fl_find_config_file("ede.conf", true)); + + // First look for directory + for(int ii=0; ii<2; ii++) + if( fltk::is_dir(X11DirList[ii]) ) { + xdir = strdup(X11DirList[ii]); + goto step2; + } + addKeyboardsOld(mPanelMenu); return; + + // Look for filename +step2: + for(int ii=0; ii<2; ii++) { + xfilename = (char*) malloc(strlen(xdir)+strlen(rulesFileList[ii])); + strcpy(xfilename,xdir) + strcat(xfilename,rulesFileList[ii]); + if( fltk::file_exists(xfilename) ) + goto step3; + } + addKeyboardsOld(mPanelMenu); return; + + // now load layouts into widget... +step3: + fp = fopen(xfilename, "r"); + if(!fp) { + addKeyboardsOld(mPanelMenu); return; + } + + + // warning: ugly code ahead (parser) + char line[256]; line[0]='\0'; + while ((!feof(fp)) && (!strstr(line,"! layout"))) { + fgets(line,255,fp); + } + int kbdno = 0; + while ((!feof(fp) && (strcmp(line,"\n")))) { + fgets(line,255,fp); + int i=0, j=0; + char name[10]; + char description[200]; + while((line[i] != 13) && (line[i] != 10)) { + while ((line[i] == 32) || (line[i] == 9)) + i++; + while ((line[i] != 32) && (line[i] != 9)) + name[j++] = line[i++]; + name[j] = 0; j=0; + while ((line[i] == 32) || (line[i] == 9)) + i++; + while ((line[i] != 13) && (line[i] != 10)) + description[j++] = line[i++]; + description[j] = 0; + } + strcpy (kbdnames[kbdno],name); + strcpy (kbddescriptions[kbdno++],description); + } + fclose(fp); + + + // now populate the menu + // main menu with "More..." + mPanelMenu->begin(); + char* recentlist; + pGlobalConfig.get("Keyboard", "RecentKeyboards", recentlist, ""); + for (int i = 0; i < kbdno; i++) { + if (strchr(recentlist,kbdnames[i]) != NULL) { + fltk::Item *mKbdItem = new fltk::Item(kbddescriptions[i]); + mKbdItem->field_name(kbdnames[i]); + mKbdItem->callback((Fl_Callback*)CB_setKeyboard); + mKbdItem->image(keyboard_pix); + } + } + new fltk::Divider(10, 5); + fltk::Item_Group *more = new fltk::Item_Group(_("More...")); + mPanelMenu->end(); + + more->begin(); + for (int i=0;ifield_name(kbdnames[i]); + mKbdItem->callback((Fl_Callback*)CB_setKeyboard); + mKbdItem->image(keyboard_pix); + } + more->end(); + + +/* for (int i=0; ilayouts.num_desc; i++) + { + mPanelMenu->begin(); + Fl_Item *mKbdItem = new Fl_Item(rules->layouts.desc[i].name); + mKbdItem->callback((Fl_Callback*)CB_setKeyboard); + mKbdItem->image(keyboard_pix); + mPanelMenu->end(); + }*/ + return; +} + + +void getKeyboard(KeyboardChooser *mButton) +{ + char* pKbdLayout; + EDE_Config pGlobalConfig(find_config_file("ede.conf", true)); + pGlobalConfig.get("Keyboard", "Layout", pKbdLayout, "us"); + setKeyboard(pKbdLayout); +} + + + +// ---------------------------- +// KeyboardChooser class +// ---------------------------- + +KeyboardChooser::KeyboardChooser(int x, int y, int w, int h, fltk::Boxtype up_c, fltk::Boxtype down_c, const char *label) + : fltk::Menu_Button(x, y, w, h, label) +{ + kbcapplet = this; + + m_open = false; + Height = 0; + up = up_c; + down = down_c; + + anim_speed(2); + anim_flags(BOTTOM_TO_TOP); + + addKeyboards(this); + getKeyboard(this); + +} + +void KeyboardChooser::draw() +{ + fltk::Boxtype box = up; + fltk::Flags flags; + fltk::Color color; + + if (!active_r()) { + flags = fltk::INACTIVE; + color = this->color(); + } else if (belowmouse()) { + flags = fltk::HIGHLIGHT; + color = highlight_color(); + if (!color) color = this->color(); + box = down; + } else { + flags = 0; + color = this->color(); + } + + if(!box->fills_rectangle()) { + fltk::push_clip(0, 0, this->w(), this->h()); + parent()->draw_group_box(); + fltk::pop_clip(); + } + + box->draw(0, 0, this->w(), this->h(), color, flags); + + int x,y,w,h; + x = y = 0; + w = this->w(); h = this->h(); + box->inset(x,y,w,h); + draw_inside_label(x,y,w,h,flags); +} + +void KeyboardChooser::calculate_height() +{ + fltk::Style *s = fltk::Style::find("Menu"); + Height = s->box->dh(); + for(int n=0; nvisible()) continue; + fltk::font(i->label_font(), i->label_size()); + Height += i->height()+s->leading; + } +} + +int KeyboardChooser::popup() +{ + m_open = true; + calculate_height(); + int retval = fltk::Menu_::popup(0, 0-Height);//, w(), h()); + m_open = false; + return retval; +} diff --git a/eworkpanel/keyboardchooser.h b/eworkpanel/keyboardchooser.h new file mode 100644 index 0000000..d157201 --- /dev/null +++ b/eworkpanel/keyboardchooser.h @@ -0,0 +1,60 @@ +// Copyright (c) 2000. - 2005. EDE Authors +// This program is licenced under terms of the +// GNU General Public Licence version 2 or newer. +// See COPYING for details. + +#ifndef keyboardchooser_h +#define keyboardchooser_h + +/*#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include "EDE_Config.h" +#include +#include +#include +#include + +#include "icons/keyboard.xpm" + + +class KeyboardChooser : public fltk::Menu_Button +{ +public: + KeyboardChooser(int, int, int, int, fltk::Boxtype, fltk::Boxtype, const char *l=0); + void calculate_height(); + + virtual void draw(); + virtual int popup(); + + virtual void preferred_size(int &w, int &h) const { w=this->w(); } + + bool is_open() { return m_open; } + +private: + int Height; + fltk::Boxtype up, down; + bool m_open; +}; + +#endif diff --git a/eworkpanel/locale/hu.po b/eworkpanel/locale/hu.po new file mode 100644 index 0000000..60246e0 --- /dev/null +++ b/eworkpanel/locale/hu.po @@ -0,0 +1,179 @@ +msgid "" +msgstr "" +"Project-Id-Version: \n" +"POT-Creation-Date: \n" +"PO-Revision-Date: 2005-02-09 11:23+0100\n" +"Last-Translator: Nemeth Otto \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: aboutdialog.cpp:14 +msgid "About Equinox Desktop Environment" +msgstr "Az Equinox Desktop Environment -ről" + +#: aboutdialog.cpp:17 +msgid "Equinox Desktop Environment " +msgstr "Equinox Desktop Environment " + +#: aboutdialog.cpp:25 +msgid " This program is based in part on the work of FLTK project (www.fltk.org). This program is free software, you can redistribute it and/or modify it under the terms of GNU General Public License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any later version. This program 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 General Public License for more details. You should have received a copy of the GNU General Public Licence along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA" +msgstr "" + +#: aboutdialog.cpp:38 +#: logoutdialog.cpp:220 +msgid "&OK" +msgstr "&OK" + +#: aboutdialog.cpp:42 +msgid "label" +msgstr "címke" + +#: aboutdialog.cpp:43 +msgid "(C)Copyright 2000-2004 EDE Authors" +msgstr "(C)Copyright 2000-2004 EDE Authors" + +#: cpumonitor.cpp:194 +#, c-format +msgid "" +"CPU Load:\n" +"User: %d%%\n" +"Nice: %d%%\n" +"Sys: %d%%\n" +"Idle: %d%%" +msgstr "" +"CPU terh.:\n" +"User: %d%%\n" +"Nice: %d%%\n" +"Sys: %d%%\n" +"Idle: %d%%" + +#: item.cpp:91 +msgid "Open with terminal..." +msgstr "Megnyitás terminálban..." + +#: item.cpp:92 +msgid "Open with browser..." +msgstr "Megnyitás böngészővel..." + +#: item.cpp:94 +msgid "Close Menu" +msgstr "Menü bezárása" + +#: keyboardchooser.cpp:86 +#: keyboardchooser.cpp:179 +msgid "More..." +msgstr "Egyéb..." + +#: logoutdialog.cpp:92 +msgid "You are not allowed to restart !" +msgstr "Nincs megfelelő jogosultságod az újraindításhoz !" + +#: logoutdialog.cpp:111 +msgid "You are not allowed to shutdown !" +msgstr "Nincs megfelelő jogosultságod a leállításhoz !" + +#: logoutdialog.cpp:185 +msgid "Logout" +msgstr "Kilépés" + +#: logoutdialog.cpp:194 +msgid "&logout from the current session" +msgstr "&kijelentkezés" + +#: logoutdialog.cpp:197 +msgid "Logout from the current session." +msgstr "Kijelentkezés." + +#: logoutdialog.cpp:200 +msgid "&restart the computer" +msgstr "a számítógép új&raindítása" + +#: logoutdialog.cpp:203 +msgid "Restart the computer." +msgstr "A számítógép újraindítása." + +#: logoutdialog.cpp:205 +msgid "Restart the computer. You do not have privileges to do that." +msgstr "Újraindítás - Nincs megfelelő jogosultságod." + +#: logoutdialog.cpp:210 +msgid "&shut down the computer" +msgstr "a &számítógép leállítása" + +#: logoutdialog.cpp:213 +msgid "Shut down the computer." +msgstr "A számítógép leállítása." + +#: logoutdialog.cpp:215 +msgid "Shut down the computer. You do not have privileges to do that." +msgstr "Leállítás - Nincs megfelelő jogosultságod." + +#: logoutdialog.cpp:224 +msgid "&Cancel" +msgstr "Mégs&em" + +#: logoutdialog.cpp:228 +msgid "Logout, restart or shut down the computer?" +msgstr "Kijelentkezés, újraindítás vagy leállítás?" + +#: mainmenu.cpp:45 +msgid "Welcome to the Equinox Desktop Environment." +msgstr "Üdvözöllel az Equinox Desktop Environment-ben." + +#: mainmenu_scan.cpp:45 +msgid "Open Directory.." +msgstr "Könyvtár megnyitása..." + +#: taskbutton.cpp:165 +msgid " Close " +msgstr "Bezárás" + +#: taskbutton.cpp:167 +msgid " Kill" +msgstr "Kilövés" + +#: taskbutton.cpp:172 +msgid " Minimize" +msgstr "Minimalizálás" + +#: taskbutton.cpp:173 +msgid " Restore" +msgstr "Visszaállítás" + +#: workpanel.cpp:253 +#, c-format +msgid "" +"Received: %ld kB (%.1f kB/s)\n" +"Sent: %ld kB (%.1f kB/s)\n" +"Duration: %d min %d sec" +msgstr "" +"Fogadott: %ld kB (%.1f kB/s)\n" +"Küldött: %ld kB (%.1f kB/s)\n" +"Időtartam: %d perc %d másodperc" + +#: workpanel.cpp:331 +msgid "Workspace" +msgstr "Munkaterület" + +#: workpanel.cpp:465 +msgid "Show desktop" +msgstr "Asztal megjelenítése" + +#: workpanel.cpp:479 +msgid "Workspaces" +msgstr "Munkaterületek" + +#: workpanel.cpp:523 +msgid "Settings" +msgstr "Beállítások" + +#: workpanel.cpp:528 +msgid "About EDE..." +msgstr "Az EDÉ-ről..." + +#: workpanel.cpp:597 +msgid "Volume control" +msgstr "Hangerőszabályzó" + diff --git a/eworkpanel/locale/id.po b/eworkpanel/locale/id.po new file mode 100644 index 0000000..2b3f035 --- /dev/null +++ b/eworkpanel/locale/id.po @@ -0,0 +1,257 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR Free Software Foundation, Inc. +# FIRST AUTHOR , YEAR. +# +msgid "" +msgstr "" +"Project-Id-Version: eworkpanel\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2005-02-04 11:48+0100\n" +"PO-Revision-Date: 2002-11-29 16:05+0700\n" +"Last-Translator: Bambang Purnomosidi D. P. \n" +"Language-Team: id \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=iso-8859-2\n" +"Content-Transfer-Encoding: 8bit\n" + +#: aboutdialog.cpp:14 +msgid "About Equinox Desktop Environment" +msgstr "Tentang Equinox Desktop Environment" + +#: aboutdialog.cpp:17 +#, fuzzy +msgid "Equinox Desktop Environment " +msgstr "Tentang Equinox Desktop Environment" + +#: aboutdialog.cpp:25 +msgid "" +" This program is based in part on the work of FLTK project (www.fltk.org). " +"This program is free software, you can redistribute it and/or modify it " +"under the terms of GNU General Public License as published by the Free " +"Software Foundation, either version 2 of the License, or (at your option) " +"any later version. This program 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 General " +"Public License for more details. You should have received a copy of the GNU " +"General Public Licence along with this program; if not, write to the Free " +"Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA" +msgstr "" +"Program ini berbasis pada hasil pekerjaan proyek FLTK (www.fltk.org). " +"Program ini adalah free software, anda bisa mendistribusikan kembali dan/" +"atau memodifikasinya dengan syarat-syarat yang diatur pada GNU General " +"Public License, versi 2 atau versi yang lebih baru. Program ini " +"didistribusikan dengan harapan akan berguna, tetapi TANPA JAMINAN; bahkan " +"tanpa jaminan daya jual dan tujuan-tujuan tertentu. Lihat GNU General Public " +"License untuk lebih jelasnya. Anda seharusnya telah menerima salinan GNU " +"General Public License bersama dengan program ini; jikat tidak, silahkan " +"minta ke Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, " +"USA." + +#: aboutdialog.cpp:38 logoutdialog.cpp:220 +msgid "&OK" +msgstr "&OK" + +#: aboutdialog.cpp:42 +msgid "label" +msgstr "" + +#: aboutdialog.cpp:43 +msgid "(C)Copyright 2000-2004 EDE Authors" +msgstr "" + +#: cpumonitor.cpp:194 +#, c-format +msgid "" +"CPU Load:\n" +"User: %d%%\n" +"Nice: %d%%\n" +"Sys: %d%%\n" +"Idle: %d%%" +msgstr "" + +#: item.cpp:91 +#, fuzzy +msgid "Open with terminal..." +msgstr "Buka dengan xterm.." + +#: item.cpp:92 +#, fuzzy +msgid "Open with browser..." +msgstr "Buka dengan browser.." + +#: item.cpp:94 +msgid "Close Menu" +msgstr "Menu Tutup" + +#: keyboardchooser.cpp:86 keyboardchooser.cpp:179 +msgid "More..." +msgstr "" + +#: logoutdialog.cpp:92 +msgid "You are not allowed to restart !" +msgstr "" + +#: logoutdialog.cpp:111 +msgid "You are not allowed to shutdown !" +msgstr "" + +#: logoutdialog.cpp:185 +msgid "Logout" +msgstr "Logout" + +#: logoutdialog.cpp:194 +msgid "&logout from the current session" +msgstr "&logut dari sessi saat ini" + +#: logoutdialog.cpp:197 +msgid "Logout from the current session." +msgstr "Logout dari sessi saat ini." + +#: logoutdialog.cpp:200 +msgid "&restart the computer" +msgstr "$restart komputer" + +#: logoutdialog.cpp:203 +#, fuzzy +msgid "Restart the computer." +msgstr "$restart komputer" + +#: logoutdialog.cpp:205 +msgid "Restart the computer. You do not have privileges to do that." +msgstr "" + +#: logoutdialog.cpp:210 +msgid "&shut down the computer" +msgstr "&shut down komputer" + +#: logoutdialog.cpp:213 +#, fuzzy +msgid "Shut down the computer." +msgstr "&shut down komputer" + +#: logoutdialog.cpp:215 +msgid "Shut down the computer. You do not have privileges to do that." +msgstr "" + +#: logoutdialog.cpp:224 +msgid "&Cancel" +msgstr "&Batalkan" + +#: logoutdialog.cpp:228 +msgid "Logout, restart or shut down the computer?" +msgstr "Logout, restart atau shut down komputer?" + +#: mainmenu.cpp:45 +msgid "Welcome to the Equinox Desktop Environment." +msgstr "Selamat datang di Equinox Desktop Environment." + +#: mainmenu_scan.cpp:45 +msgid "Open Directory.." +msgstr "Buka Direktori.." + +#: taskbutton.cpp:165 +#, fuzzy +msgid " Close " +msgstr "Menu Tutup" + +#: taskbutton.cpp:167 +msgid " Kill" +msgstr "" + +#: taskbutton.cpp:172 +msgid " Minimize" +msgstr "" + +#: taskbutton.cpp:173 +msgid " Restore" +msgstr "" + +#: workpanel.cpp:253 +#, c-format +msgid "" +"Received: %ld kB (%.1f kB/s)\n" +"Sent: %ld kB (%.1f kB/s)\n" +"Duration: %d min %d sec" +msgstr "" +"Diterima: %ld kB (%.1f kB/detik)\n" +"Dikirim: %ld kB (%.1f kB/detik)\n" +"Durasi: %d menit %d detik" + +#: workpanel.cpp:331 +msgid "Workspace" +msgstr "Ruangkerja" + +#: workpanel.cpp:465 +msgid "Show desktop" +msgstr "" + +#: workpanel.cpp:479 +msgid "Workspaces" +msgstr "Ruangkerja" + +#: workpanel.cpp:523 +msgid "Settings" +msgstr "Seting" + +#: workpanel.cpp:528 +msgid "About EDE..." +msgstr "Tentang EDE..." + +#: workpanel.cpp:597 +msgid "Volume control" +msgstr "Kontrol volume" + +#~ msgid "CPU Load: %3.2f %3.2f %3.2f, %d processes." +#~ msgstr "CPU Load: %3.2f %3.2f %3.2f, %d processes." + +#~ msgid "&Programs" +#~ msgstr "&Program" + +#~ msgid "&Favourites" +#~ msgstr "&Favorit" + +#~ msgid "F&ind" +#~ msgstr "Car&i" + +#~ msgid "&Help" +#~ msgstr "&Pertolongan" + +#~ msgid "&About" +#~ msgstr "&Tentang" + +#~ msgid "&Run..." +#~ msgstr "&Jalankan..." + +#~ msgid "&Panel" +#~ msgstr "&Panel" + +#~ msgid "Edit panels menu" +#~ msgstr "Menu edit panel" + +#~ msgid "Panel settings" +#~ msgstr "Seting panel" + +#~ msgid "Control panel" +#~ msgstr "Panel kontrol" + +#~ msgid "Install new software" +#~ msgstr "Install perangkat lunak baru" + +#~ msgid "L&ock screen" +#~ msgstr "L&ock layar" + +#~ msgid "&Logout" +#~ msgstr "&Logout" + +#~ msgid "Restart the computer. This action is only allowed to \"root\" user!" +#~ msgstr "Restart komputer. Hanya diijinkan untuk root !" + +#~ msgid "" +#~ "Shut down the computer. This action is only allowed to \"root\" user!" +#~ msgstr "Shut down komputer. Hanya diijinkan untuk root !" + +#~ msgid "&User programs" +#~ msgstr "Program-program &User" + +#~ msgid "&Browser" +#~ msgstr "&Browser" diff --git a/eworkpanel/locale/messages.pot b/eworkpanel/locale/messages.pot new file mode 100644 index 0000000..24187ed --- /dev/null +++ b/eworkpanel/locale/messages.pot @@ -0,0 +1,185 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2005-02-04 11:48+0100\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=CHARSET\n" +"Content-Transfer-Encoding: 8bit\n" + +#: aboutdialog.cpp:14 +msgid "About Equinox Desktop Environment" +msgstr "" + +#: aboutdialog.cpp:17 +msgid "Equinox Desktop Environment " +msgstr "" + +#: aboutdialog.cpp:25 +msgid "" +" This program is based in part on the work of FLTK project (www.fltk.org). " +"This program is free software, you can redistribute it and/or modify it " +"under the terms of GNU General Public License as published by the Free " +"Software Foundation, either version 2 of the License, or (at your option) " +"any later version. This program 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 General " +"Public License for more details. You should have received a copy of the GNU " +"General Public Licence along with this program; if not, write to the Free " +"Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA" +msgstr "" + +#: aboutdialog.cpp:38 logoutdialog.cpp:220 +msgid "&OK" +msgstr "" + +#: aboutdialog.cpp:42 +msgid "label" +msgstr "" + +#: aboutdialog.cpp:43 +msgid "(C)Copyright 2000-2004 EDE Authors" +msgstr "" + +#: cpumonitor.cpp:194 +#, c-format +msgid "" +"CPU Load:\n" +"User: %d%%\n" +"Nice: %d%%\n" +"Sys: %d%%\n" +"Idle: %d%%" +msgstr "" + +#: item.cpp:91 +msgid "Open with terminal..." +msgstr "" + +#: item.cpp:92 +msgid "Open with browser..." +msgstr "" + +#: item.cpp:94 +msgid "Close Menu" +msgstr "" + +#: keyboardchooser.cpp:86 keyboardchooser.cpp:179 +msgid "More..." +msgstr "" + +#: logoutdialog.cpp:92 +msgid "You are not allowed to restart !" +msgstr "" + +#: logoutdialog.cpp:111 +msgid "You are not allowed to shutdown !" +msgstr "" + +#: logoutdialog.cpp:185 +msgid "Logout" +msgstr "" + +#: logoutdialog.cpp:194 +msgid "&logout from the current session" +msgstr "" + +#: logoutdialog.cpp:197 +msgid "Logout from the current session." +msgstr "" + +#: logoutdialog.cpp:200 +msgid "&restart the computer" +msgstr "" + +#: logoutdialog.cpp:203 +msgid "Restart the computer." +msgstr "" + +#: logoutdialog.cpp:205 +msgid "Restart the computer. You do not have privileges to do that." +msgstr "" + +#: logoutdialog.cpp:210 +msgid "&shut down the computer" +msgstr "" + +#: logoutdialog.cpp:213 +msgid "Shut down the computer." +msgstr "" + +#: logoutdialog.cpp:215 +msgid "Shut down the computer. You do not have privileges to do that." +msgstr "" + +#: logoutdialog.cpp:224 +msgid "&Cancel" +msgstr "" + +#: logoutdialog.cpp:228 +msgid "Logout, restart or shut down the computer?" +msgstr "" + +#: mainmenu.cpp:45 +msgid "Welcome to the Equinox Desktop Environment." +msgstr "" + +#: mainmenu_scan.cpp:45 +msgid "Open Directory.." +msgstr "" + +#: taskbutton.cpp:165 +msgid " Close " +msgstr "" + +#: taskbutton.cpp:167 +msgid " Kill" +msgstr "" + +#: taskbutton.cpp:172 +msgid " Minimize" +msgstr "" + +#: taskbutton.cpp:173 +msgid " Restore" +msgstr "" + +#: workpanel.cpp:253 +#, c-format +msgid "" +"Received: %ld kB (%.1f kB/s)\n" +"Sent: %ld kB (%.1f kB/s)\n" +"Duration: %d min %d sec" +msgstr "" + +#: workpanel.cpp:331 +msgid "Workspace" +msgstr "" + +#: workpanel.cpp:465 +msgid "Show desktop" +msgstr "" + +#: workpanel.cpp:479 +msgid "Workspaces" +msgstr "" + +#: workpanel.cpp:523 +msgid "Settings" +msgstr "" + +#: workpanel.cpp:528 +msgid "About EDE..." +msgstr "" + +#: workpanel.cpp:597 +msgid "Volume control" +msgstr "" diff --git a/eworkpanel/locale/ru.po b/eworkpanel/locale/ru.po new file mode 100644 index 0000000..103031b --- /dev/null +++ b/eworkpanel/locale/ru.po @@ -0,0 +1,248 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR Free Software Foundation, Inc. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2005-02-04 11:48+0100\n" +"PO-Revision-Date: 2002-11-28 HO:MI+ZONE\n" +"Last-Translator: aabbvv \n" +"Language-Team: RUSSIAN \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=koi8-r\n" +"Content-Transfer-Encoding: 8bit\n" + +#: aboutdialog.cpp:14 +msgid "About Equinox Desktop Environment" +msgstr " " + +#: aboutdialog.cpp:17 +#, fuzzy +msgid "Equinox Desktop Environment " +msgstr " " + +#: aboutdialog.cpp:25 +msgid "" +" This program is based in part on the work of FLTK project (www.fltk.org). " +"This program is free software, you can redistribute it and/or modify it " +"under the terms of GNU General Public License as published by the Free " +"Software Foundation, either version 2 of the License, or (at your option) " +"any later version. This program 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 General " +"Public License for more details. You should have received a copy of the GNU " +"General Public Licence along with this program; if not, write to the Free " +"Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA" +msgstr "" + +#: aboutdialog.cpp:38 logoutdialog.cpp:220 +msgid "&OK" +msgstr "&OK" + +#: aboutdialog.cpp:42 +msgid "label" +msgstr "" + +#: aboutdialog.cpp:43 +msgid "(C)Copyright 2000-2004 EDE Authors" +msgstr "" + +#: cpumonitor.cpp:194 +#, c-format +msgid "" +"CPU Load:\n" +"User: %d%%\n" +"Nice: %d%%\n" +"Sys: %d%%\n" +"Idle: %d%%" +msgstr "" + +#: item.cpp:91 +#, fuzzy +msgid "Open with terminal..." +msgstr " .." + +#: item.cpp:92 +#, fuzzy +msgid "Open with browser..." +msgstr ".." + +#: item.cpp:94 +msgid "Close Menu" +msgstr " " + +#: keyboardchooser.cpp:86 keyboardchooser.cpp:179 +msgid "More..." +msgstr "" + +#: logoutdialog.cpp:92 +msgid "You are not allowed to restart !" +msgstr "" + +#: logoutdialog.cpp:111 +msgid "You are not allowed to shutdown !" +msgstr "" + +#: logoutdialog.cpp:185 +msgid "Logout" +msgstr "" + +#: logoutdialog.cpp:194 +msgid "&logout from the current session" +msgstr "& " + +#: logoutdialog.cpp:197 +msgid "Logout from the current session." +msgstr " " + +#: logoutdialog.cpp:200 +msgid "&restart the computer" +msgstr " " + +#: logoutdialog.cpp:203 +#, fuzzy +msgid "Restart the computer." +msgstr " " + +#: logoutdialog.cpp:205 +msgid "Restart the computer. You do not have privileges to do that." +msgstr "" + +#: logoutdialog.cpp:210 +msgid "&shut down the computer" +msgstr " " + +#: logoutdialog.cpp:213 +#, fuzzy +msgid "Shut down the computer." +msgstr " " + +#: logoutdialog.cpp:215 +msgid "Shut down the computer. You do not have privileges to do that." +msgstr "" + +#: logoutdialog.cpp:224 +msgid "&Cancel" +msgstr "&" + +#: logoutdialog.cpp:228 +msgid "Logout, restart or shut down the computer?" +msgstr ", ?" + +#: mainmenu.cpp:45 +msgid "Welcome to the Equinox Desktop Environment." +msgstr " Equinox Desktop Environment." + +#: mainmenu_scan.cpp:45 +msgid "Open Directory.." +msgstr " .." + +#: taskbutton.cpp:165 +#, fuzzy +msgid " Close " +msgstr " " + +#: taskbutton.cpp:167 +msgid " Kill" +msgstr "" + +#: taskbutton.cpp:172 +msgid " Minimize" +msgstr "" + +#: taskbutton.cpp:173 +msgid " Restore" +msgstr "" + +#: workpanel.cpp:253 +#, c-format +msgid "" +"Received: %ld kB (%.1f kB/s)\n" +"Sent: %ld kB (%.1f kB/s)\n" +"Duration: %d min %d sec" +msgstr "" +": %ld (%.1f /)\n" +": %ld (%.1f /)\n" +": %d %d " + +#: workpanel.cpp:331 +msgid "Workspace" +msgstr " " + +#: workpanel.cpp:465 +msgid "Show desktop" +msgstr "" + +#: workpanel.cpp:479 +msgid "Workspaces" +msgstr " " + +#: workpanel.cpp:523 +msgid "Settings" +msgstr "" + +#: workpanel.cpp:528 +msgid "About EDE..." +msgstr " EDE..." + +#: workpanel.cpp:597 +msgid "Volume control" +msgstr " " + +#~ msgid "CPU Load: %3.2f %3.2f %3.2f, %d processes." +#~ msgstr " : %3.2f %3.2f %3.2f, %d ." + +#~ msgid "&Programs" +#~ msgstr "" + +#~ msgid "&Favourites" +#~ msgstr "" + +#~ msgid "F&ind" +#~ msgstr "" + +#~ msgid "&Help" +#~ msgstr "" + +#~ msgid "&About" +#~ msgstr " " + +#~ msgid "&Run..." +#~ msgstr "..." + +#~ msgid "&Panel" +#~ msgstr "" + +#~ msgid "Edit panels menu" +#~ msgstr " " + +#~ msgid "Panel settings" +#~ msgstr " " + +#~ msgid "Control panel" +#~ msgstr " " + +#~ msgid "Install new software" +#~ msgstr " " + +#~ msgid "L&ock screen" +#~ msgstr "& " + +#~ msgid "&Logout" +#~ msgstr "" + +#~ msgid "Restart the computer. This action is only allowed to \"root\" user!" +#~ msgstr ". \"root\"!" + +#~ msgid "" +#~ "Shut down the computer. This action is only allowed to \"root\" user!" +#~ msgstr ". \"root\"!" + +#~ msgid "&User programs" +#~ msgstr " " + +#~ msgid "&Browser" +#~ msgstr ".." diff --git a/eworkpanel/locale/sk.po b/eworkpanel/locale/sk.po new file mode 100644 index 0000000..07b6f53 --- /dev/null +++ b/eworkpanel/locale/sk.po @@ -0,0 +1,259 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR Free Software Foundation, Inc. +# FIRST AUTHOR , YEAR. +# +msgid "" +msgstr "" +"Project-Id-Version: eworkpanel 1.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2005-02-04 11:48+0100\n" +"PO-Revision-Date: 2002-04-21 14:50+0200\n" +"Last-Translator: Martin Pekar \n" +"Language-Team: Slovak \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: aboutdialog.cpp:14 +msgid "About Equinox Desktop Environment" +msgstr "O Equinox Desktop Environment" + +#: aboutdialog.cpp:17 +#, fuzzy +msgid "Equinox Desktop Environment " +msgstr "O Equinox Desktop Environment" + +#: aboutdialog.cpp:25 +msgid "" +" This program is based in part on the work of FLTK project (www.fltk.org). " +"This program is free software, you can redistribute it and/or modify it " +"under the terms of GNU General Public License as published by the Free " +"Software Foundation, either version 2 of the License, or (at your option) " +"any later version. This program 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 General " +"Public License for more details. You should have received a copy of the GNU " +"General Public Licence along with this program; if not, write to the Free " +"Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA" +msgstr "" +"Tento program je z časti založený na práci projektu FLTK (www.fltk.org)." +"Tento program je voľný softvér, môžete ho redistribuovať a/alebo modifikovať " +"podľa podmienok licencie GNU General Public License publikovanej nadáciou " +"the Free Software Foundation, buď verzie 2 tejto licencie, alebo (podľa " +"vášho uváženia) ľubovoľnej novšej verzie. Tento program je distribuovaný v " +"nádeji, že bude užitočný, ale BEZ AKEJKOĽVEK ZÁRUKY; dokonca bez obsiahnutej " +"záruky OBCHODOVATEĽNOSTI alebo VÝHOD PRE URČITÝ ÚČEL. Ďalšie podrobnosti " +"hľadajte v licencii GNU General Public License. S týmto programom by ste " +"mali dostať kópiu licencie GNU General Public Licence; ak nie, napíšte do " +"nadácie the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA " +"02139, USA." + +#: aboutdialog.cpp:38 logoutdialog.cpp:220 +msgid "&OK" +msgstr "&OK" + +#: aboutdialog.cpp:42 +msgid "label" +msgstr "" + +#: aboutdialog.cpp:43 +msgid "(C)Copyright 2000-2004 EDE Authors" +msgstr "" + +#: cpumonitor.cpp:194 +#, c-format +msgid "" +"CPU Load:\n" +"User: %d%%\n" +"Nice: %d%%\n" +"Sys: %d%%\n" +"Idle: %d%%" +msgstr "" + +#: item.cpp:91 +#, fuzzy +msgid "Open with terminal..." +msgstr "Otvoriť v xterme.." + +#: item.cpp:92 +#, fuzzy +msgid "Open with browser..." +msgstr "Otvoriť v prehliadači.." + +#: item.cpp:94 +msgid "Close Menu" +msgstr "Zavrieť ponuku" + +#: keyboardchooser.cpp:86 keyboardchooser.cpp:179 +msgid "More..." +msgstr "" + +#: logoutdialog.cpp:92 +msgid "You are not allowed to restart !" +msgstr "" + +#: logoutdialog.cpp:111 +msgid "You are not allowed to shutdown !" +msgstr "" + +#: logoutdialog.cpp:185 +msgid "Logout" +msgstr "Odhlásenie" + +#: logoutdialog.cpp:194 +msgid "&logout from the current session" +msgstr "&odhlásiť sa z aktuálneho sedenia" + +#: logoutdialog.cpp:197 +msgid "Logout from the current session." +msgstr "Odhlásenie sa z aktuálneho sedenia." + +#: logoutdialog.cpp:200 +msgid "&restart the computer" +msgstr "&reštarťovať počítač" + +#: logoutdialog.cpp:203 +#, fuzzy +msgid "Restart the computer." +msgstr "&reštarťovať počítač" + +#: logoutdialog.cpp:205 +msgid "Restart the computer. You do not have privileges to do that." +msgstr "" + +#: logoutdialog.cpp:210 +msgid "&shut down the computer" +msgstr "&vypnúť počítač" + +#: logoutdialog.cpp:213 +#, fuzzy +msgid "Shut down the computer." +msgstr "&vypnúť počítač" + +#: logoutdialog.cpp:215 +msgid "Shut down the computer. You do not have privileges to do that." +msgstr "" + +#: logoutdialog.cpp:224 +msgid "&Cancel" +msgstr "&Zrušiť" + +#: logoutdialog.cpp:228 +msgid "Logout, restart or shut down the computer?" +msgstr "Odhlásiť sa, reštartovať alebo vypnúť počítač?" + +#: mainmenu.cpp:45 +msgid "Welcome to the Equinox Desktop Environment." +msgstr "Vitajte v Equinox Desktop Environment." + +#: mainmenu_scan.cpp:45 +msgid "Open Directory.." +msgstr "Otvoriť adresár.." + +#: taskbutton.cpp:165 +#, fuzzy +msgid " Close " +msgstr "Zavrieť ponuku" + +#: taskbutton.cpp:167 +msgid " Kill" +msgstr "" + +#: taskbutton.cpp:172 +msgid " Minimize" +msgstr "" + +#: taskbutton.cpp:173 +msgid " Restore" +msgstr "" + +#: workpanel.cpp:253 +#, c-format +msgid "" +"Received: %ld kB (%.1f kB/s)\n" +"Sent: %ld kB (%.1f kB/s)\n" +"Duration: %d min %d sec" +msgstr "" +"Prijatých : %ld kB (%.1f kB/s)\n" +"Odoslaných : %ld kB (%.1f kB/s)\n" +"Čas trvania: %d minút %d sekúnd" + +#: workpanel.cpp:331 +msgid "Workspace" +msgstr "Pracovná plocha" + +#: workpanel.cpp:465 +msgid "Show desktop" +msgstr "" + +#: workpanel.cpp:479 +msgid "Workspaces" +msgstr "Pracovné plochy" + +#: workpanel.cpp:523 +msgid "Settings" +msgstr "Nastavenia" + +#: workpanel.cpp:528 +msgid "About EDE..." +msgstr "O EDE..." + +#: workpanel.cpp:597 +msgid "Volume control" +msgstr "Nastavenie hlasitosti" + +#~ msgid "CPU Load: %3.2f %3.2f %3.2f, %d processes." +#~ msgstr "Zaťaženie procesora: %3.2f %3.2f %3.2f, %d procesov." + +#~ msgid "&Programs" +#~ msgstr "&Programy" + +#~ msgid "&Favourites" +#~ msgstr "&Obľúbené" + +#~ msgid "F&ind" +#~ msgstr "N&ájsť" + +#~ msgid "&Help" +#~ msgstr "&Nápoveda" + +#~ msgid "&About" +#~ msgstr "&O programe" + +#~ msgid "&Run..." +#~ msgstr "&Spustiť..." + +#~ msgid "&Panel" +#~ msgstr "&Panel" + +#~ msgid "Edit panels menu" +#~ msgstr "Editovať ponuku panelu" + +#~ msgid "Panel settings" +#~ msgstr "Nastavenie panela" + +#~ msgid "Control panel" +#~ msgstr "Kontrólny panel" + +#~ msgid "Install new software" +#~ msgstr "Inštalovať nový softvér" + +#~ msgid "L&ock screen" +#~ msgstr "&Zablokovať obrazovku" + +#~ msgid "&Logout" +#~ msgstr "&Odhlásenie" + +#~ msgid "Restart the computer. This action is only allowed to \"root\" user!" +#~ msgstr "" +#~ "Reštartovanie počítača. Táto akcia je povolená iba \"root\" užívateľovi!" + +#~ msgid "" +#~ "Shut down the computer. This action is only allowed to \"root\" user!" +#~ msgstr "Vypnúť počítač. Táto akcia je povolená iba \"root\" užívateľovi!" + +#~ msgid "&User programs" +#~ msgstr "&Užívateľove programy" + +#~ msgid "&Browser" +#~ msgstr "&Prehliadač" diff --git a/eworkpanel/locale/sr.po b/eworkpanel/locale/sr.po new file mode 100644 index 0000000..6839057 --- /dev/null +++ b/eworkpanel/locale/sr.po @@ -0,0 +1,257 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR Free Software Foundation, Inc. +# FIRST AUTHOR , YEAR. +# +msgid "" +msgstr "" +"Project-Id-Version: eworkpanel 1.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2005-02-04 11:48+0100\n" +"PO-Revision-Date: 2002-12-02 04:33+0100\n" +"Last-Translator: Dejan Lekic \n" +"Language-Team: LINUKS.org T.T. \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: aboutdialog.cpp:14 +msgid "About Equinox Desktop Environment" +msgstr "О Иквинокс Десктоп Окружењу" + +#: aboutdialog.cpp:17 +#, fuzzy +msgid "Equinox Desktop Environment " +msgstr "О Иквинокс Десктоп Окружењу" + +#: aboutdialog.cpp:25 +msgid "" +" This program is based in part on the work of FLTK project (www.fltk.org). " +"This program is free software, you can redistribute it and/or modify it " +"under the terms of GNU General Public License as published by the Free " +"Software Foundation, either version 2 of the License, or (at your option) " +"any later version. This program 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 General " +"Public License for more details. You should have received a copy of the GNU " +"General Public Licence along with this program; if not, write to the Free " +"Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA" +msgstr "" +"Овај програм је базиран на FLTK пројекту (www.fltk.org). Овај програм је " +"слободан софтвер, можете га редистрибуирати и/или модификовати под условима " +"постављеним GNU General Public лиценцом објављеном од стране Free Software " +"Foundation, било да је то верзија 2 Лиценце, или (опционо) било која каснија " +"верзија. Овај програм је дистрибуиран у нади да ће бити употребљив, али БЕЗ " +"ИКАКВИХ ГАРАНЦИЈА; чак без имплицитне гаранције ПРОДАЈЕ РОБЕ или ПОГОДНОСТИ " +"ЗА НЕКУ СПЕЦИФИЧНУ НАМЕНУ. Погледајте \"GNU General Public License\" за више " +"детаља. Требало би да сте добили копију \"GNU General Public License\" " +"лиценце заједно са овим програмом; ако нисте, пишите на Free Software " +"Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA." + +#: aboutdialog.cpp:38 logoutdialog.cpp:220 +msgid "&OK" +msgstr "&ОК" + +#: aboutdialog.cpp:42 +msgid "label" +msgstr "" + +#: aboutdialog.cpp:43 +msgid "(C)Copyright 2000-2004 EDE Authors" +msgstr "" + +#: cpumonitor.cpp:194 +#, c-format +msgid "" +"CPU Load:\n" +"User: %d%%\n" +"Nice: %d%%\n" +"Sys: %d%%\n" +"Idle: %d%%" +msgstr "" + +#: item.cpp:91 +#, fuzzy +msgid "Open with terminal..." +msgstr "Отвори са икс-терм-ом." + +#: item.cpp:92 +#, fuzzy +msgid "Open with browser..." +msgstr "Отвори са браузером..." + +#: item.cpp:94 +msgid "Close Menu" +msgstr "Затвори мени" + +#: keyboardchooser.cpp:86 keyboardchooser.cpp:179 +msgid "More..." +msgstr "" + +#: logoutdialog.cpp:92 +msgid "You are not allowed to restart !" +msgstr "" + +#: logoutdialog.cpp:111 +msgid "You are not allowed to shutdown !" +msgstr "" + +#: logoutdialog.cpp:185 +msgid "Logout" +msgstr "Излогуј" + +#: logoutdialog.cpp:194 +msgid "&logout from the current session" +msgstr "Из&логуј ме из тренутне сесије" + +#: logoutdialog.cpp:197 +msgid "Logout from the current session." +msgstr "Излогуј ме из тренутне сесије." + +#: logoutdialog.cpp:200 +msgid "&restart the computer" +msgstr "&Рестартуј рачунар" + +#: logoutdialog.cpp:203 +#, fuzzy +msgid "Restart the computer." +msgstr "&Рестартуј рачунар" + +#: logoutdialog.cpp:205 +msgid "Restart the computer. You do not have privileges to do that." +msgstr "" + +#: logoutdialog.cpp:210 +msgid "&shut down the computer" +msgstr "&Угаси рачунар" + +#: logoutdialog.cpp:213 +#, fuzzy +msgid "Shut down the computer." +msgstr "&Угаси рачунар" + +#: logoutdialog.cpp:215 +msgid "Shut down the computer. You do not have privileges to do that." +msgstr "" + +#: logoutdialog.cpp:224 +msgid "&Cancel" +msgstr "&Одустани" + +#: logoutdialog.cpp:228 +msgid "Logout, restart or shut down the computer?" +msgstr "Излогуј ме, рестартуј или угаси рачунар?" + +#: mainmenu.cpp:45 +msgid "Welcome to the Equinox Desktop Environment." +msgstr "Добродошли у Иквинокс Десктоп Окружење." + +#: mainmenu_scan.cpp:45 +msgid "Open Directory.." +msgstr "Отвори директоријум..." + +#: taskbutton.cpp:165 +#, fuzzy +msgid " Close " +msgstr "Затвори мени" + +#: taskbutton.cpp:167 +msgid " Kill" +msgstr "" + +#: taskbutton.cpp:172 +msgid " Minimize" +msgstr "" + +#: taskbutton.cpp:173 +msgid " Restore" +msgstr "" + +#: workpanel.cpp:253 +#, c-format +msgid "" +"Received: %ld kB (%.1f kB/s)\n" +"Sent: %ld kB (%.1f kB/s)\n" +"Duration: %d min %d sec" +msgstr "" +"Дошло: %ld kB (%.1f kB/s)\n" +"Послато: %ld kB (%.1f kB/s)\n" +"Трајање: %d min %d sec" + +#: workpanel.cpp:331 +msgid "Workspace" +msgstr "Радна површина" + +#: workpanel.cpp:465 +msgid "Show desktop" +msgstr "" + +#: workpanel.cpp:479 +msgid "Workspaces" +msgstr "Радне површине" + +#: workpanel.cpp:523 +msgid "Settings" +msgstr "Подешавања" + +#: workpanel.cpp:528 +msgid "About EDE..." +msgstr "О ЕДЕ-у..." + +#: workpanel.cpp:597 +msgid "Volume control" +msgstr "Контрола звука" + +#~ msgid "CPU Load: %3.2f %3.2f %3.2f, %d processes." +#~ msgstr "CPU Лоад: %3.2f %3.2f %3.2f, %d процеса." + +#~ msgid "&Programs" +#~ msgstr "&Програми" + +#~ msgid "&Favourites" +#~ msgstr "&Омиљени" + +#~ msgid "F&ind" +#~ msgstr "&Тражи" + +#~ msgid "&Help" +#~ msgstr "По&моћ" + +#~ msgid "&About" +#~ msgstr "&О..." + +#~ msgid "&Run..." +#~ msgstr "&Старт" + +#~ msgid "&Panel" +#~ msgstr "П&анел" + +#~ msgid "Edit panels menu" +#~ msgstr "Едитуј панел меније" + +#~ msgid "Panel settings" +#~ msgstr "Панел подешавање" + +#~ msgid "Control panel" +#~ msgstr "Контролни панел" + +#~ msgid "Install new software" +#~ msgstr "Инсталирај нови софтвер" + +#~ msgid "L&ock screen" +#~ msgstr "&Закључај екран" + +#~ msgid "&Logout" +#~ msgstr "&Излогуј ме" + +#~ msgid "Restart the computer. This action is only allowed to \"root\" user!" +#~ msgstr "Рестартуј рачунар. Ова акција је дозвољена само \"root\" кориснику!" + +#~ msgid "" +#~ "Shut down the computer. This action is only allowed to \"root\" user!" +#~ msgstr "Угаси рачунар. Ова акција је дозвољена само \"root\" кориснику!" + +#~ msgid "&User programs" +#~ msgstr "&Кориснички програми" + +#~ msgid "&Browser" +#~ msgstr "&Браузер" diff --git a/eworkpanel/logoutdialog.cpp b/eworkpanel/logoutdialog.cpp new file mode 100644 index 0000000..1bb4146 --- /dev/null +++ b/eworkpanel/logoutdialog.cpp @@ -0,0 +1,240 @@ +// generated by Fast Light User Interface Designer (fluid) version 2,0003 + +// Work Panel for EDE is (C) Copyright 2000-2002 by Martin Pekar, +// this program is provided under the terms of GNU GPL v.2, see file COPYING for more information. +// Improvements by Vedran Ljubovic (c) 2005. + + +#include "logoutdialog.h" +#include +/*#include +#include + +#include // X stuff +#include +#include // icons*/ + +#include +#include + +#include // X stuff +#include +#include // icons + +// widgets +fltk::Window* windowLogoutDialog; +fltk::Round_Button* logoutRadioItemLogoutDialog; +fltk::Round_Button* restartRadioItemLogoutDialog; +fltk::Round_Button* shutdownRadioItemLogoutDialog; + +// graphics +static fltk::Image penguin_pix((const char **)penguin_xpm); + +// globals +bool dmAvailable; +char *xdm_fifo; +bool canShutdown; +bool sdForceNow; +bool sdTryNow; + + +// This function looks what a user can do and sets other +// global variables +void checkPermissions() +{ + char* xdm_env = getenv("XDM_MANAGED"); + if (strcmp(xdm_env,"") == 0) + dmAvailable = false; + else + dmAvailable = true; + + // shutting down via XDM fifo + if (dmAvailable) { +// Fl_String_List xdm_env_list = Fl_String_List(xdm_env,","); +// xdm_fifo = xdm_env_list.item(0); + xdm_fifo = strtok(xdm_env, ","); + if (xdm_fifo[0] != '/') { // broken config + dmAvailable = false; + xdm_fifo = strdup(""); + } + + canShutdown = sdForceNow = sdTryNow = false; + char* token; + while (token = strtok(NULL, ",") { + if (strcmp(token,"maysd") == 0) canShutdown = true; + if (strcmp(token,"fn") == 0) sdForceNow = true; + if (strcmp(token,"tn") == 0) sdTryNow = true; + } + } + + // the old way + if (!dmAvailable) { + // shutdown cmd with no params shouldn't do anything... + if (fltk::start_child_process("shutdown") == 127) + canShutdown = false; + } +} + + +// Logout using XDM messaging +void newLogoutFunction() { + + if ((logoutRadioItemLogoutDialog->value()==0) && + (restartRadioItemLogoutDialog->value()==0) && + (shutdownRadioItemLogoutDialog->value() == 0)) + // this shoudn't happen... + return; + + if (restartRadioItemLogoutDialog->value()==1) + { + if (!canShutdown) { + fltk::alert (_("You are not allowed to restart !")); + return; + } + + FILE *fd = fopen(xdm_fifo, "w"); + char* method; + if (sdForceNow) + method = strdup("shutdown\treboot\tforcenow\n"); + else if (sdTryNow) + method = strdup("shutdown\treboot\ttrynow\n"); + else + method = strdup("shutdown\treboot\tschedule\n"); + fputs (method, fd); + fclose (fd); + } + + if (shutdownRadioItemLogoutDialog->value() == 1) + { + if (!canShutdown) { + fltk::alert (_("You are not allowed to shutdown !")); + return; + } + + FILE *fd = fopen(xdm_fifo, "w"); + char* method; + if (sdForceNow) + method = strdup("shutdown\thalt\tforcenow\n"); + else if (sdTryNow) + method = strdup("shutdown\thalt\ttrynow\n"); + else + method = strdup("shutdown\thalt\tschedule\n"); + fputs ((char *)method, fd); + fclose (fd); + } + + XCloseDisplay(fltk::display); + //XSetCloseDownMode(fl_display, DestroyAll); + XKillClient(fltk::display, AllTemporary); + //XUngrabServer(fl_display); + //fl_close_display(); + exit(0); +} + + +// "brute force" logout function +// (in case XDM is not available) +void oldLogoutFunction() { + if (logoutRadioItemLogoutDialog->value()==1) + { + XCloseDisplay(fltk::display); + //XSetCloseDownMode(fl_display, DestroyAll); + XKillClient(fltk::display, AllTemporary); + //XUngrabServer(fl_display); + //fl_close_display(); + exit(0); + } + + if (restartRadioItemLogoutDialog->value()==1) + { + if(fltk::start_child_process( "shutdown -r now" ) != 0) + fltk::alert("You are not alowed to reboot !"); + } + + if (shutdownRadioItemLogoutDialog->value() == 1) + { + if(fltk::start_child_process( "shutdown -h now" ) != 0) + fltk::alert("You are not alowed to shutdown !"); + } +} + + +// Determine logout type +void LogoutFunction(fltk::Widget *, void *) { + if (dmAvailable) + newLogoutFunction(); + else + oldLogoutFunction(); +} + + + +// Main logout UI and control +static void cb_Cancel(fltk::Button*, void*) { + windowLogoutDialog->hide(); +} + +void LogoutDialog(fltk::Widget*, void *) { + // first see what options are available + checkPermissions(); + + // draw GUI + fltk::Window* w; + { + fltk::Window* o = windowLogoutDialog = new fltk::Window(171, 160, 330, 190, _("Logout")); + w = o; + { + fltk::Group* o = new fltk::Group(5, 12, 55, 45); + o->image(penguin_pix); + o->align(FL_ALIGN_CENTER|FL_ALIGN_INSIDE); + o->end(); + } + { + fltk::Round_Button* o = logoutRadioItemLogoutDialog = new fltk::Round_Button(80, 67, 225, 20, _("&logout from the current session")); + o->type(fltk::Round_Button::RADIO); + o->value(1); + o->tooltip(_("Logout from the current session.")); + } + { + fltk::Round_Button* o = restartRadioItemLogoutDialog = new fltk::Round_Button(80, 88, 225, 20, _("&restart the computer")); + o->type(fltk::Round_Button::RADIO); + if (canShutdown) + o->tooltip(_("Restart the computer.")); + else { + o->tooltip(_("Restart the computer. You do not have privileges to do that.")); + o->deactivate(); + } + } + { + fltk::Round_Button* o = shutdownRadioItemLogoutDialog = new fltk::Round_Button(80, 110, 225, 20, _("&shut down the computer")); + o->type(fltk::Round_Button::RADIO); + if (canShutdown) + o->tooltip(_("Shut down the computer.")); + else { + o->tooltip(_("Shut down the computer. You do not have privileges to do that.")); + o->deactivate(); + } + } + { + fltk::Button* o = new fltk::Button(85, 157, 80, 25, _("&OK")); + o->callback((fltk::Callback*)LogoutFunction); + } + { + fltk::Button* o = new fltk::Button(170, 157, 80, 25, _("&Cancel")); + o->callback((fltk::Callback*)cb_Cancel); + } + { + fltk::Box* o = new fltk::Box(65, 7, 260, 63, _("Logout, restart or shut down the computer?")); + o->label_size(18); + o->align(132|fltk::ALIGN_INSIDE); + } + + new fltk::Divider(60, 130, 210, 20, ""); + o->x( Fl::info().w/2 - (o->w()/2) ); + o->y( (Fl::info().h/2) - (o->h()/2) ); + o->set_modal(); + o->end(); + } + windowLogoutDialog->end(); + windowLogoutDialog->show(); +} diff --git a/eworkpanel/logoutdialog.fld b/eworkpanel/logoutdialog.fld new file mode 100644 index 0000000..e37f215 --- /dev/null +++ b/eworkpanel/logoutdialog.fld @@ -0,0 +1,76 @@ +# data file for the FLTK User Interface Designer (FLUID) +version 2,0003 +images_dir ./ +i18n +header_name {.h} +code_name {.cpp} +gridx 5 +gridy 5 +snap 3 +decl {// Work Panel for EDE is (C) Copyright 2000-2002 by Martin Pekar, this program is provided under the terms of GNU GPL v.2, see file COPYING for more information.} {} + +decl {\#include } {} + +decl {\#include } {} + +decl {\#include } {} + +Function {LogoutFunction(Fl_Widget *, void *)} {selected return_type void +} { + code {if (logoutRadioItemLogoutDialog->value()==1) { + exit(0); +} +if (restartRadioItemLogoutDialog->value()==1) + fl_start_child_process( "shutdown -r now" ); +if (shutdownRadioItemLogoutDialog->value() == 1) + fl_start_child_process( "shutdown -h now" );} {} +} + +Function {LogoutDialog(Fl_Widget*, void *)} {return_type void +} { + Fl_Window windowLogoutDialog { + label Logout open + xywh {171 160 330 190} set_xy hide + extra_code {o->x( Fl::info().w/2 - (o->w()/2) ); +o->y( (Fl::info().h/2) - (o->h()/2) );} modal + } { + Fl_Group {} {open + xywh {5 12 55 45} align 16 image {icons/penguin.xpm} + } {} + Fl_Round_Button logoutRadioItemLogoutDialog { + label {&logout from the current session} + tooltip {Logout from the current session.} + xywh {80 67 225 20} type RADIO value 1 + } + Fl_Round_Button restartRadioItemLogoutDialog { + label {&restart the computer} + tooltip {Restart the computer. This action is only allowed to "root" user!} + xywh {80 88 225 20} type RADIO + } + Fl_Round_Button shutdownRadioItemLogoutDialog { + label {&shut down the computer} + tooltip {Shut down the computer. This action is only allowed to "root" user!} + xywh {80 110 225 20} type RADIO + } + Fl_Button {} { + label {&OK} + callback LogoutFunction + private xywh {85 157 80 25} + } + Fl_Button {} { + label {&Cancel} + callback {windowLogoutDialog->hide();} + private xywh {170 157 80 25} + } + Fl_Box {} { + label {Logout, restart or shut down the computer?} + private xywh {65 7 260 63} align 148 label_size 18 + } + Fl_Divider {} { + label label + xywh {60 130 210 20} + } + } + code {windowLogoutDialog->end(); +windowLogoutDialog->show();} {} +} diff --git a/eworkpanel/logoutdialog.h b/eworkpanel/logoutdialog.h new file mode 100644 index 0000000..7320e0d --- /dev/null +++ b/eworkpanel/logoutdialog.h @@ -0,0 +1,40 @@ +// generated by Fast Light User Interface Designer (fluid) version 2,0003 + +#ifndef logoutdialog_h +#define logoutdialog_h + + +/*#include +#include +#include +#include +#include +#include +#include +#include */ + +#include +#include "NLS.h" +#include +#include +#include +#include +#include +#include + +#include "icons/penguin.xpm" + + +// which of these can be safely removed? what should be extern and +// what shouldn't? + +extern fltk::Window* windowLogoutDialog; +extern fltk::Round_Button* logoutRadioItemLogoutDialog; +extern fltk::Round_Button* restartRadioItemLogoutDialog; +extern fltk::Round_Button* shutdownRadioItemLogoutDialog; +void LogoutFunction(fltk::Widget *, void *); +extern void LogoutFunction(fltk::Button*, void*); +void LogoutDialog(fltk::Widget*, void *); + + +#endif diff --git a/eworkpanel/mainmenu.cpp b/eworkpanel/mainmenu.cpp new file mode 100644 index 0000000..b581356 --- /dev/null +++ b/eworkpanel/mainmenu.cpp @@ -0,0 +1,481 @@ +#include "mainmenu.h" +#include "menu.h" + +#include +#include +#include +#include + +#include +#include +#include +#include + +fltk::Pixmap ede_pix((const char **)ede_small2_xpm); +fltk::Pixmap programs_pix((const char **)programs_xpm); +fltk::Pixmap find_pix((const char **)find_xpm); +fltk::Pixmap run_pix((const char **)run_xpm); + +// strdupcat() - it's cool to strcat with implied realloc +// -- NOTE: due to use of realloc *always* use strdupcat return value: +// dest = strdupcat(dest,src); +// and *never* use it like: +// strdupcat(dest,src); +char *strdupcat(char *dest, const char *src) +{ + if (!dest) { + dest=(char*)malloc(strlen(src)); + } else { + dest=(char*)realloc (dest, strlen(dest)+strlen(src)+1); + } + strcat(dest,src); + return dest; +} + + +/////////////////////////// +extern EDE_Config pGlobalConfig; + +MainMenu::MainMenu() + : fltk::Menu_Button(0,0,0,0, "Start") +{ + layout_align(fltk::ALIGN_LEFT); + + label_font(label_font()->bold()); + label_size(label_size()+2); + + m_modified = 0; + e_image = 0; + m_open = false; + + bool showusername; + pGlobalConfig.get("Panel", "ShowUsernameOnMenu", showusername, false); + struct passwd *PWD; + /* Search for an entry with a matching user ID. */ + PWD = getpwuid(getuid()); + if(showusername && PWD && PWD->pw_name && *PWD->pw_name) { + label(PWD->pw_name); + } else { + label("EDE"); + } + + tooltip(_("Welcome to the Equinox Desktop Environment.")); +} + +MainMenu::~MainMenu() +{ + if(e_image) + delete e_image; +} + +int MainMenu::calculate_height() const +{ + fltk::Style *s = fltk::Style::find("Menu"); + int menuheight = s->box->dh(); + for(int n=0; nvisible()) continue; + + fltk::font(i->label_font(), i->label_size()); + menuheight += i->height()+s->leading; + } + return menuheight; +} + +void MainMenu::draw() +{ + fltk::Boxtype box = this->box(); + fltk::Flags flags; + fltk::Color color = this->color(); + fltk::Color lcolor = label_color(); + if (!active_r()) + { + flags = fltk::INACTIVE; + } + else if (belowmouse()) { + flags = fltk::HIGHLIGHT; + color = fltk::lighter(color); + lcolor = fltk::lighter(label_color()); + if(!color) color = this->color(); + if(!lcolor) color = this->label_color(); + } + else if (m_open) { + flags = fltk::HIGHLIGHT|fltk::VALUE; + color = fltk::lighter(color); + lcolor = fltk::lighter(label_color()); + if(!color) color = this->color(); + if(!lcolor) color = this->label_color(); + } else { + flags = 0; + } + box->draw(0, 0, this->w(), this->h(), color, flags); + + int X=0, Y=0, W=w(), H=h(); + box->inset(X,Y,W,H); + + if(image()) { + int imY = (h()/2)-(image()->height()/2); + image()->draw(6, imY, image()->width(), image()->height(), flags); + X+=image()->width()+6; + } else { + X += 4; + W -= 4; + } + + fltk::font(label_font(), label_size()); + label_type()->draw(label(), X, Y, W-X, H, lcolor, flags|fltk::ALIGN_LEFT); +} + +void MainMenu::layout() +{ + fltk::font(label_font(), label_size()); + int W = int(fltk::width(label())) + 12; + int H = h(); + int im_size = H-6; + + if(!e_image || (e_image && e_image->height()!=im_size)) { + if(e_image) delete e_image; + if(ede_pix.height()==im_size) { + e_image=0; + image(ede_pix); + } + else { + e_image = ede_pix.scale(im_size, im_size); + image(e_image); + } + } + if(image()) W+=image()->width(); + + w(W); + fltk::Menu_Button::layout(); +} + +void MainMenu::clear_favourites() +{ + static char* favourites; + if(!favourites || strcmp(favourites,"")==0) { + favourites = strdupcat(favourites,fltk::homedir()); + favourites = strdupcat(favourites,"/.ede/favourites/"); + + if(!fltk::file_exists(favourites)) { + mkdir( favourites, 0777 ); + } + } + + dirent **files; + int pNumFiles = fltk::filename_list(favourites, &files); + + if (pNumFiles > 10) + { + for (int i=0; i<(pNumFiles-10); i++) { + if (strcmp(files[i]->d_name, ".") != 0 && strcmp(files[i]->d_name, "..") != 0 ) { + char* filename = strdup(favourites); + filename = strdupcat(filename,files[i]->d_name); + unlink(filename); + free(filename); + } + } + } + + for(int i = 0; i < pNumFiles; i++) + free(files[i]); + + if(pNumFiles && files) + free(files); +} + +/* + %f a single file name, even if multiple files are selected. + The system reading the Desktop Entry should recognize that + the program in question cannot handle multiple file arguments, + and it should should probably spawn and execute multiple copies + of a program for each selected file if the program is not + able to handle additional file arguments. If files are not on + the local file system (i.e. HTTP or FTP locations), the files will + be copied to the local file system and %f will be expanded to point + at the temporary file. Used for programs that do not understand URL syntax. + + %F a list of files. Use for apps that can open several local files at once. + %u a single URL. + %U a list of URLs. + %d the directory of the file to open. + %D a list of directories + %n a single filename (without path) + %N a list of filenames (without path) + %i the icon associated with the desktop entry + %m the mini-icon associated with the desktop entry + %c the comment associated with the desktop entry + %k the name of the desktop file + %v the name of the Device entry in the desktop file + */ + +// This function is now implemented in elauncher +void MainMenu::resolve_program(char* cmd) +{ + char pRun[FL_PATH_MAX]; + + snprintf(pRun, sizeof(pRun)-1, "elauncher \"%s\"", cmd); + fltk::start_child_process(pRun, false); +} + +fltk::Image *MainMenu::find_image(const char* icon) const +{ + char* iconpath = strdup(fltk::file_expand(icon)); + + fltk::Image *im=0; + + if(fltk::file_exists(iconpath)) + im = fltk::Image::read(iconpath); + + if(!im) { + free(iconpath); + iconpath = strdup(PREFIX"/share/ede/icons/16x16/"); + iconpath = strdupcat(icon); + im = fltk::Image::read(iconpath); + } + free(iconpath); + + if(im && (im->width()!=16 || im->height()!=16)) { + fltk::Image *scaled = im->scale(16, 16); + if(scaled) { + delete im; + im = scaled; + } + } + + return im; +} + +/* +g->dir(PREFIX"/share/ede/programs"); +i->exec("ehelpbook "PREFIX"/share/ede/doc/index.html"); +*/ +enum { + ITEM_NONE = 0, + ITEM_EXEC, + ITEM_APPDIR, + ITEM_SUBDIR, + ITEM_FILEBROWSER, + ITEM_DIVIDER +}; + +int str_to_type(char* str) +{ + if(strcmp(str,"Exec")==0) return ITEM_EXEC; + else if(strcmp(str,"AppDir")==0) return ITEM_APPDIR; + else if(strcmp(str,"SubDir")==0) return ITEM_SUBDIR; + else if(strcmp(str,"FileBrowser")==0) return ITEM_FILEBROWSER; + else if(strcmp(str,"Divider")==0) return ITEM_DIVIDER; + return ITEM_NONE; +} + +bool is_group_item(int t) { return (t==ITEM_APPDIR || t==ITEM_SUBDIR || t==ITEM_FILEBROWSER); } + +char* MainMenu::get_item_name(Fl_XmlNode *node) +{ + char* name = strdup(""); + for(int n=0; nchildren(); n++) { + fltk::XmlNode *np = node->child(n); + if(np->is_element() && np->name()=="Name") { + char* lang = strdup(np->get_attribute("Lang")); + if(strcmp(lang,"")==0 && (strlen(name)==0)) { + free(name); + name=strdup(""); + np->text(name); + } else if(strcmp(lang,locale())==0) { + free(name); + name=strdup(""); + np->text(name); + break; + } + } + } + return name; +} + +char* MainMenu::get_item_dir(Fl_XmlNode *node) +{ + char* dir = strdup(node->get_attribute("Dir")); + + if(strcmp(dir,"$DEFAULT_PROGRAMS_DIR")==0) { + free(dir); + dir = strdup(PREFIX"/share/ede/programs"); + } + + return fltk::file_expand(dir); +} + +// THIS MUST BE CHANGED ASAP! +#include "logoutdialog.h" +#include "aboutdialog.h" +void MainMenu::set_exec(EItem *i, const char* exec) +{ + if(strcmp(exec,"$LOGOUT")==0) + i->callback((fltk::Callback*)LogoutDialog); + else if(strcmp(exec,"$ABOUT")==0) + i->callback((fltk::Callback *)AboutDialog); + else + i->exec(exec); +} + +void MainMenu::build_menu_item(fltk::XmlNode *node) +{ + if(!node) return; + + int type = str_to_type(node->get_attribute("Type")); + if(type==ITEM_NONE) return; + + fltk::Widget *w=0; + EItemGroup *g=0; + EItem *i=0; + + switch(type) { + case ITEM_EXEC: + i = new EItem(this); + i->callback((fltk::Callback*)cb_exec_item); + set_exec(i, node->get_attribute("Exec")); + i->image(run_pix); + w = (fltk::Widget *)i; + break; + + case ITEM_APPDIR: + g = new EItemGroup(this, APP_GROUP); + g->image(programs_pix); + g->dir(get_item_dir(node)); + break; + + case ITEM_SUBDIR: + g = new EItemGroup(this, APP_GROUP); + g->image(programs_pix); + break; + + case ITEM_FILEBROWSER: + g = new EItemGroup(this, BROWSER_GROUP); + g->dir(get_item_dir(node)); + g->image(find_pix); + break; + + case ITEM_DIVIDER: + w = (fltk::Widget *)new fltk::Menu_Divider(); + break; + } + + if(g) { + g->begin(); + w = (fltk::Widget*)g; + } + + fltk::Image *im=0; + if(node->has_attribute("Icon")) { + im = find_image(node->get_attribute("Icon")); + } else { + char* im_path = strdup(node->get_attribute("Exec")); + im_path = strdupcat(im_path,".png"); + im = find_image(im_path); + } + if(im) w->image(im); + + char* label = strdup(get_item_name(node)); + w->label(label); + + for(int n=0; nchildren(); n++) { + fltk::XmlNode *np = node->child(n); + if((np->is_element() || np->is_leaf()) && np->name()=="Item") + build_menu_item(np); + } + + if(w->is_group()) + ((fltk::Group*)w)->end(); +} + +void MainMenu::init_entries() +{ + // Update locale + m_locale = setlocale(LC_ALL, NULL); + int pos = m_locale.rpos('_'); + if(pos>0) m_locale.sub_delete(pos, m_locale.length()-pos); + if(m_locale=="C" || m_locale=="POSIX") m_locale.clear(); + + const char *file = find_config_file("ede_mainmenu.xml", true); + + struct stat s; + if(lstat(file, &s) == 0) { + if(!m_modified) m_modified = s.st_mtime; + if(m_modified != s.st_mtime) { + //file has changed.. + m_modified = s.st_mtime; + clear(); + } + } + + if(children()>0) return; + + FILE *fp = fopen(file, "r"); + if(!fp) { + fltk::warning("Menu not found, creating default.."); + try { + fltk::Buffer buf; + buf.append(default_menu, strlen(default_menu)); + buf.save_file(file); + } catch(fltk::Exception &e) { + fltk::warning(e.text()); + } + fp = fopen(file, "r"); + if(!fp) fltk::fatal("Cannot write default menu."); + } + fltk::XmlLocator locator; + + fltk::XmlDoc *doc=0; + if(fp) { + try { + doc = fltk::XmlParser::create_dom(fp, &locator, false); + } catch(fltk::XmlException &exp) { + char* error = strdup(exp.text()); + error = strdupcat(error,"\n\n"); + error = strdupcat(error,fltk::XmlLocator::error_line(file, *exp.locator())); + error = strdupcat(error,"\n"); + fltk::warning(error); + } + } + + if(!doc) { + // One more try! + try { + fltk::Buffer buf; + buf.append(default_menu, strlen(default_menu)); + doc = fltk::XmlParser::create_dom(buf.data(), buf.bytes(), &locator, false); + } catch(fltk::Exception &e) { + fltk::fatal("Cannot open menu! [%s]", e.text().c_str()); + } + } + + if(doc) { + begin(); + + fltk::XmlNode *node = doc->root_node(); + if(node) { + for(int n=0; nchildren(); n++) { + fltk::XmlNode *np = node->child(n); + if((np->is_element() || np->is_leaf()) && np->name()=="Item") + build_menu_item(np); + } + } + + end(); + } +} + +int MainMenu::popup(int X, int Y, int W, int H) +{ + if(fltk::event_button()==1) { + m_open = true; + init_entries(); + int ret = fltk::Menu_::popup(X, Y-calculate_height()-h()-1, W, H); + clear(); + m_open = false; + return ret; + } + return 0; +} diff --git a/eworkpanel/mainmenu.h b/eworkpanel/mainmenu.h new file mode 100644 index 0000000..5bfef6d --- /dev/null +++ b/eworkpanel/mainmenu.h @@ -0,0 +1,73 @@ +#ifndef _MAINMENU_H_ +#define _MAINMENU_H_ + +/*#include + +#include +#include +#include +#include +#include +#include +#include +#include */ + +#include + +#include +#include "EDE_Config.h" +#include +#include +#include +#include +#include +#include + +#include + +#include "item.h" + +class MainMenu : public fltk::Menu_Button +{ +public: + MainMenu(); + ~MainMenu(); + + int popup(int X, int Y, int W, int H); + + void draw(); + void layout(); + + void init_entries(); + + char* get_item_dir(fltk::XmlNode *node); + char* get_item_name(fltk::XmlNode *node); + + void set_exec(EItem *i, const char* exec); + void build_menu_item(fltk::XmlNode *node); + + int calculate_height() const; + + fltk::Image *find_image(const char* icon) const; + + void scan_programitems(const char *path); + void scan_filebrowser(const char* path); + + const char* locale() const { return m_locale; } + + static void resolve_program(char* cmd); + static void clear_favourites(); + + bool is_open() { return m_open; } + +private: + static inline void cb_exec_item(EItem *i, void *d) { i->menu()->resolve_program(i->exec()); } + + fltk::Image *e_image; + + char* m_locale; + long m_modified; + bool m_open; +}; + +#endif diff --git a/eworkpanel/mainmenu_scan.cpp b/eworkpanel/mainmenu_scan.cpp new file mode 100644 index 0000000..bc7d93a --- /dev/null +++ b/eworkpanel/mainmenu_scan.cpp @@ -0,0 +1,227 @@ +#include "mainmenu.h" +#include "item.h" + +#include +fltk::Pixmap file_pix(file_xpm); + +extern fltk::Pixmap programs_pix; +extern fltk::Pixmap run_pix; + +static void cb_file_item(EItem *item, void *) +{ + char* pFavouriteFile = strdup(fltk::homedir()); + pFavouriteFile = strdupcat(pFavouriteFile"/.ede/favourites/"); + pFavouriteFile = strdupcat(pFavouriteFile,fltk::file_filename(item->filename())); + + EDE_Config pItemConfig(item->filename(), true, false); + char* cmd; + if(!pItemConfig.get("Desktop Entry", "Exec", cmd, "")) + { + MainMenu::clear_favourites(); + symlink(item->filename(), pFavouriteFile); + MainMenu::resolve_program(cmd); + } + free(pFavouriteFile); +} + +static void cb_open_dir(fltk::Widget *w, void *) +{ + EItemGroup *g = (EItemGroup *)w->parent(); + + EDE_Config conf(fltk::find_config_file("ede.conf", false)); + char* term; + conf.get("Terminal", "Terminal", term, 0); + if(term.empty()) + term = "xterm"; + + char* cmd = strdup("cd "); + cmd = strdupcat(cmd,g->dir()); + cmd = strdupcat("; "); + cmd = strdupcat(term); + + fltk::start_child_process(cmd, false); + free(term); + free(cmd); +} + +void MainMenu::scan_filebrowser(const char* path) +{ + EItem *i = new EItem(this, _("Open Directory..")); + i->callback(cb_open_dir); + i->image(run_pix); + + new fltk::Menu_Divider(); + + EItemGroup *mNewGroup=0; + struct dirent **files; + int count = fltk::filename_list(path, &files); + + int n; + for(n=0; nd_name, ".") || !strcmp(files[n]->d_name, "..") || !strcmp(files[n]->d_name, "CVS") ) + { + free((char*)files[n]); + files[n] = 0; + continue; + } + + char* filename = strdup(path); + filename = strdupcat(filename,"/"); + filename = strdupcat(filename,files[n]->d_name); + + if(fltk::is_dir(filename)) { + mNewGroup = new EItemGroup(this, BROWSER_GROUP); + mNewGroup->label(files[n]->d_name); + mNewGroup->image(programs_pix); + mNewGroup->dir(filename); + + mNewGroup->end(); + + if(access(filename, R_OK)) { + mNewGroup->label_color(fltk::inactive(FL_RED)); + mNewGroup->access(false); + } + free((char*)files[n]); + files[n] = 0; + } + free(filename); + } + + for(n=0; nd_name, ".") && strcmp(files[n]->d_name, "..")) + { + char* filename = strdup(path); + filename = strdupcat(filename, "/"); + filename = strdupcat(files[n]->d_name); + + EItem *mNewItem = new EItem(this); + mNewItem->type(EItem::FILE); + mNewItem->image(file_pix); + mNewItem->copy_label(files[n]->d_name); + + if(access(filename, R_OK)) { + mNewItem->label_color(fl_inactive(FL_RED)); + } + free(filename); + } + free((char*)files[n]); + } + + if(count>0 && files) free((char**)files); +} + +void MainMenu::scan_programitems(const char *path) +{ + EItemGroup *mNewGroup; + char* NameEntry; + bool added = false; + + char* localizedName; + if(strlen(locale())>0) + sprintf(localizedName,"Name[%s]", locale()); + else + localizedName = strdup("Name"); + + struct dirent **files; + int count = fltk::filename_list(path, &files); + + int n; + for(n=0; nd_name, ".") && strcmp(files[n]->d_name, "..") && strcmp(files[n]->d_name, "CVS") ) + { + char* filename = strdup(path); + filename = strdupcat(filename,"/"); + filename = strdupcat(filename,files[n]->d_name); + + if(fltk::is_dir(filename)) + { + added=true; + mNewGroup = new EItemGroup(this, APP_GROUP); + mNewGroup->image(programs_pix); + mNewGroup->dir(filename); + + char* locale_file = strdup(filename); + locale_file = strdupcat(locale_file,"/.directory"); + + EDE_Config pLocConfig(locale_file, true, false); + pLocConfig.set_section("Desktop Entry"); + + if(!pLocConfig.read(localizedName, NameEntry, "")) { + // Localized name + mNewGroup->label(NameEntry); + } else { + if(!pLocConfig.read("Name", NameEntry, "")) { + // Default name + mNewGroup->label(NameEntry); + } else { + // Fall back to directory name + mNewGroup->label(files[n]->d_name); + } + } + mNewGroup->end(); + + free(files[n]); + files[n] = 0; + free(locale_file); + } + free(filename); + } + } + + for(n=0; nd_name, ".") && strcmp(files[n]->d_name, "..") && strstr(files[n]->d_name, ".desktop")) + { + char* filename=strdup(path); + filename = strdupcat(filename,"/"); + filename = strdupcat(filename,files[n]->d_name); + + // we check first for localised names... + EDE_Config ItemConfig(filename, true, false); + ItemConfig.set_section("Desktop Entry"); + + bool noDisplay = false; + ItemConfig.read("NoDisplay", noDisplay); + if(noDisplay) continue; + + if(ItemConfig.read(localizedName, NameEntry, "")) { + ItemConfig.read("Name", NameEntry, ""); + } + + if(!ItemConfig.error() && !NameEntry.empty()) + { + added=true; + EItem *mNewItem = new EItem(this); + mNewItem->type(EItem::FILE); + mNewItem->label(NameEntry); + mNewItem->filename(filename); + mNewItem->callback((fltk::Callback *)cb_file_item, 0); + + if(!ItemConfig.read("Icon", NameEntry, "")) + mNewItem->image(find_image(NameEntry)); + + if(!mNewItem->image()) + mNewItem->image(file_pix); + + if(!ItemConfig.read("Exec", NameEntry, "")) + mNewItem->exec(NameEntry); + } + free(filename); + } + if(files[n]) free(files[n]); + } + + if(count>0 && files) free(files); + if(!added) + Fl_Divider *mDivider = new Fl_Divider(); + + free(localizedName); + free(NameEntry); +} diff --git a/eworkpanel/menu.h b/eworkpanel/menu.h new file mode 100644 index 0000000..afe0941 --- /dev/null +++ b/eworkpanel/menu.h @@ -0,0 +1,57 @@ +#include +static const char default_menu[] = +"\n\ +\n\ +\n\ + \n\ + Programs\n\ + \n\ + \n\ + User Programs\n\ + \n\ + \n\ + \n\ + Favourites\n\ + \n\ + \n\ + Find\n\ + \n\ + \n\ + Help\n\ + \n\ + \n\ + About\n\ + \n\ + \n\ + Run\n\ + \n\ + \n\ + \n\ + Quick Browser\n\ + \n\ + \n\ + Panel\n\ + \n\ + Control Panel\n\ + \n\ + \n\ + Menu Editor\n\ + \n\ + \n\ + Install New Software\n\ + \n\ + \n\ + \n\ + \n\ + Lock\n\ + \n\ + \n\ + Logout\n\ + \n\ +\n"; diff --git a/eworkpanel/panelbutton.cpp b/eworkpanel/panelbutton.cpp new file mode 100644 index 0000000..da9d5fb --- /dev/null +++ b/eworkpanel/panelbutton.cpp @@ -0,0 +1,166 @@ +// Copyright (c) 2000. - 2005. EDE Authors +// This program is licenced under terms of the +// GNU General Public Licence version 2 or newer. +// See COPYING for details. + +#include +/*#include +#include +#include +#include +#include */ + +#include +#include +#include +#include +#include + +#include "panelbutton.h" + +extern fltk::Widget* fl_did_clipping; + + +// class PanelMenu +// This is a standard eworkpanel applet class. It is a button that pops +// up menu when pressed. Typical use is workspace switcher. + +PanelMenu::PanelMenu(int x, int y, int w, int h, fltk::Boxtype up_c, fltk::Boxtype down_c, const char *label) + : fltk::Menu_Button(x, y, w, h, label) +{ + m_open = false; + Height = 0; + up = up_c; + down = down_c; + + anim_speed(2); + anim_flags(BOTTOM_TO_TOP); + accept_focus(false); +} + + +// This function is modified from Fl_Menu_Button + +void PanelMenu::draw() +{ + fltk::Boxtype box = up; + fltk::Flags flags; + fltk::Color color; + + if (!active_r()) { + // Button is disabled + flags = fltk::INACTIVE; + color = this->color(); + } else if (m_open) { + // Menu is open, make the button pushed and highlighted + flags = fltk::HIGHLIGHT; + color = highlight_color(); + if (!color) color = this->color(); + box = down; + } else if (belowmouse()) { + // Menu is not open, but button is below mouse - highlight + flags = fltk::HIGHLIGHT; + color = highlight_color(); + if (!color) color = this->color(); + } else { + // Plain + flags = 0; + color = this->color(); + } + + if(!box->fills_rectangle()) { + fltk::push_clip(0, 0, this->w(), this->h()); + parent()->draw_group_box(); + fltk::pop_clip(); + } + + box->draw(0, 0, this->w(), this->h(), color, flags); + + int x,y,w,h; + x = y = 0; + w = this->w(); h = this->h(); + box->inset(x,y,w,h); + draw_inside_label(x,y,w,h,flags); +} + + +// Used to properly redraw menu + +void PanelMenu::calculate_height() +{ + fltk::Style *s = fltk::Style::find("Menu"); + Height = s->box->dh(); + for(int n=0; nvisible()) continue; + fltk::font(i->label_font(), i->label_size()); + Height += i->height()+s->leading; + } +} + + +// Popup the menu. Global property m_open is useful to detect +// if the menu is visible, e.g. to disable autohiding panel. + +int PanelMenu::popup() +{ + m_open = true; + redraw(); // push down button + calculate_height(); + int retval = fltk::Menu_::popup(0, 0-Height);//, w(), h()); + m_open = false; + redraw(); + return retval; +} + + +// class PanelButton +// A simplified case of PanelMenu - by Vedran +// Used e.g. by show desktop button + +PanelButton::PanelButton(int x, int y, int w, int h, fltk::Boxtype up_c, fltk::Boxtype down_c, const char *label) + : fltk::Button(x, y, w, h, label) +{ +// Height = 0; + up = up_c; + down = down_c; + accept_focus(false); +} + + +void PanelButton::draw() +{ + fltk::Boxtype box = up; + fltk::Flags flags; + fltk::Color color; + + if (belowmouse()) + { + // Highlight button when below mouse + flags = fltk::HIGHLIGHT; + color = highlight_color(); + if (!color) color = this->color(); +// box = down; + } else { + flags = 0; + color = this->color(); + } + + if (value()) box=down; // Push down button when pressed + + if(!box->fills_rectangle()) { + fltk::push_clip(0, 0, this->w(), this->h()); + parent()->draw_group_box(); + fltk::pop_clip(); + } + + box->draw(0, 0, this->w(), this->h(), color, flags); + + int x,y,w,h; + x = y = 0; + w = this->w(); h = this->h(); + box->inset(x,y,w,h); + draw_inside_label(x,y,w,h,flags); +} diff --git a/eworkpanel/panelbutton.h b/eworkpanel/panelbutton.h new file mode 100644 index 0000000..6155e44 --- /dev/null +++ b/eworkpanel/panelbutton.h @@ -0,0 +1,58 @@ +// Copyright (c) 2000. - 2005. EDE Authors +// This program is licenced under terms of the +// GNU General Public Licence version 2 or newer. +// See COPYING for details. + +#ifndef panelbutton_h +#define panelbutton_h + +/*#include +#include +#include +#include +#include +#include +#include */ + +#include +#include +#include +#include +#include +#include +#include + +class PanelMenu : public fltk::Menu_Button +{ +public: + PanelMenu(int, int, int, int, fltk::Boxtype, fltk::Boxtype, const char *l=0); + void calculate_height(); + + virtual void draw(); + virtual int popup(); + + virtual void preferred_size(int &w, int &h) const { w=this->w(); } + + bool is_open() { return m_open; } + +private: + int Height; + fltk::Boxtype up, down; + bool m_open; +}; + +class PanelButton : public fltk::Button +{ +public: + PanelButton(int, int, int, int, fltk::Boxtype, fltk::Boxtype, const char *l=0); + + virtual void draw(); + + virtual void preferred_size(int &w, int &h) const { w=this->w(); } + +private: + int Height; + fltk::Boxtype up, down; +}; + +#endif diff --git a/eworkpanel/taskbutton.cpp b/eworkpanel/taskbutton.cpp new file mode 100644 index 0000000..fa9818f --- /dev/null +++ b/eworkpanel/taskbutton.cpp @@ -0,0 +1,463 @@ +#include "taskbutton.h" + +#include +#include + +/*#include +#include +#include +#include +#include +#include +#include */ +#include +#include +#include +#include "EDE_Config.h" +#include +#include +#include + +#include "../edewm/Windowmanager.h" + +fltk::Menu_ *TaskButton::menu = 0; +TaskButton *TaskButton::pushed = 0; + +int calculate_height(fltk::Menu_ *m) +{ + fltk::Style *s = fltk::Style::find("Menu"); + int Height = s->box->dh(); + for(int n=0; nchildren(); n++) + { + fltk::Widget *i = m->child(n); + if(!i) break; + if(!i->visible()) continue; + fltk::font(i->label_font(), i->label_size()); + Height += i->height()+s->leading; + } + return Height; +} + +void task_button_cb(TaskButton *b, Window w) +{ + if(fltk::event_button()==fltk::RIGHT_MOUSE) { + TaskButton::pushed = b; + + TaskButton::menu->color(b->color()); + TaskButton::menu->popup(fltk::event_x(), fltk::event_y()-calculate_height(TaskButton::menu)); + + } else { + if(TaskBar::active==w) { + XIconifyWindow(fltk::display, w, fltk::screen); + XSync(fltk::display, True); + TaskBar::active = 0; + } else { + Fl_WM::set_active_window(w); + } + } +} + +#define CLOSE 1 +#define KILL 2 +#define MIN 3 +//#define MAX 4 +#define SET_SIZE 5 +#define RESTORE 6 + +void menu_cb(fltk::Menu_ *menu, void *) +{ + // try to read information how much window can be maximized + EDE_Config wm_config(find_config_file("wmanager.conf", true)); + +//pGlobalConfig.get("Panel", "RunHistory", historyString,""); + Window win = TaskButton::pushed->argument(); + int ID = menu->item()->argument(); + int x, y, width, height, title_height; + + wm_config.get("TitleBar", "Height",title_height); + + switch(ID) { + + case CLOSE: + if(Fl_WM::close_window(win)) + break; + // Fallback to kill.. + + case KILL: + XKillClient(fl_display, win); + break; + + case MIN: + XIconifyWindow(fltk::display, win, fltk::screen); + XSync(fltk::display, True); + TaskBar::active = 0; + break; + + /*case MAX: + // This will come in next version + Fl_WM::get_workarea(x, y, width, height); + + // y koord. poveca za title_height + y = y + title_height; + + XMoveResizeWindow(fl_display, win, x, y, width, height); + XSync(fl_display, True); + break;*/ +/* + case SET_SIZE: + { + Fl_Window *win = new Fl_Window(300, 110, _("Set Size")); + win->begin(); + + Fl_Box *b = new Fl_Box(_("Set size to window:"), 20); + b->label_font(b->label_font()->bold()); + //b = new Fl_Box(menu_frame->label(), 20); //here goes title of window + + Fl_Group *g = new Fl_Group("", 23); + + Fl_Value_Input *w_width = new Fl_Value_Input(_("Width:"), 70, FL_ALIGN_LEFT, 60); + w_width->step(1); + Fl_Value_Input *w_height = new Fl_Value_Input(_("Height:"), 70, FL_ALIGN_LEFT, 60); + w_height->step(1); + + g->end(); + + Fl_Divider *div = new Fl_Divider(10, 15); + div->layout_align(FL_ALIGN_TOP); + + g = new Fl_Group("", 50, FL_ALIGN_CLIENT); + + //Fl_Button *but = ok_button = new Fl_Button(40,0,100,20, _("&OK")); + //but->callback(real_set_size_cb); + + but = new Fl_Button(155,0,100,20, _("&Cancel")); + //but->callback(close_set_size_cb); + + g->end(); + + win->end(); + + //w_width->value(menu_frame->w()); + //w_height->value(menu_frame->h()); + //ok_button->user_data(menu_frame); + + //win->callback(close_set_size_cb); + win->show(); + + } + break;*/ + + + case RESTORE: + Fl_WM::set_active_window(win); + break; + } + + fltk::redraw(); +} + +TaskButton::TaskButton(Window win) : fltk::Button(0,0,0,0) +{ + layout_align(fltk::ALIGN_LEFT); + callback((fltk::Callback1*)task_button_cb, win); + + if(!menu) { + fltk::Group *saved = fltk::Group::current(); + fltk::Group::current(0); + + menu = new fltk::Menu_(); + menu->callback((fltk::Callback*)menu_cb); + + //Fl_Widget* add(const char*, int shortcut, Fl_Callback*, void* = 0, int = 0); + + menu->add(_(" Close "), 0, 0, (void*)CLOSE, fltk::MENU_DIVIDER); + new fltk::Divider(10, 15); + menu->add(_(" Kill"), 0, 0, (void*)KILL, fltk::MENU_DIVIDER); + new fltk::Divider(10, 15); + + //Comes in next version + //menu->add(" Maximize", 0, 0, (void*)MAX); + menu->add(_(" Minimize"), 0, 0, (void*)MIN); + menu->add(_(" Restore"), 0, 0, (void*)RESTORE); + //menu->add(" Set size", 0, 0, (void*)SET_SIZE, FL_MENU_DIVIDER); + //----- + + fltk::Group::current(saved); + } +} + +///////////////////////// +// Task bar ///////////// +///////////////////////// + +#include "icons/tux.xpm" +static fltk::Image default_icon(tux_xpm); + +// Forward declaration +static int GetState(Window w); + +Window TaskBar::active = 0; +bool TaskBar::variable_width = true; + +TaskBar::TaskBar() +: fltk::Group(0,0,0,0) +{ + m_max_taskwidth = 150; + + layout_align(fltk::ALIGN_CLIENT); + layout_spacing(2); + + EDE_Config pConfig(find_config_file("ede.conf", true)); + pConfig.get("Panel", "VariableWidthTaskbar",variable_width,true); + + update(); + end(); +} + +void TaskBar::layout() +{ + if(!children()) return; + + int maxW = w()-layout_spacing()*2; + int avgW = maxW / children(); + int n; + + int buttonsW = layout_spacing()*2; + for(n=0; nwidth(), tmph; + + if(TaskBar::variable_width) { + child(n)->preferred_size(W, tmph); + W += 10; + } else + W = avgW; + + if(W > m_max_taskwidth) W = m_max_taskwidth; + + child(n)->w(W); + buttonsW += W+layout_spacing(); + } + + float scale = 0.0f; + if(buttonsW > maxW) + scale = (float)maxW / (float)buttonsW; + + int X=layout_spacing(); + for(n=0; nw(); + if(scale>0.0f) + W = (int)((float)W * scale); + + widget->resize(X, 0, W, h()); + X += widget->w()+layout_spacing(); + } + + fltk::Widget::layout(); +} + +void TaskBar::update() +{ + Fl_WM::clear_handled(); + + int n; + + // Delete all icons: + for(n=0; nimage(); + if(i!=&default_icon) + delete i; + } + clear(); + + Window *wins=0; + int num_windows = Fl_WM::get_windows_mapping(wins); + + if(num_windows<=0) + return; + + fltk::Int_List winlist; + int current_workspace = Fl_WM::get_current_workspace(); + for(n=0; n0) + winlist.append(wins[n]); + } + + if(winlist.size()>0) { + for(n=0; n<(int)winlist.size(); n++) { + add_new_task(winlist[n]); + } + } + delete []wins; + + relayout(); + redraw(); + parent()->redraw(); +} + +void TaskBar::update_active(Window active) +{ + for(int n=0; nargument(); + + if(GetState(win) == IconicState) + w->label_color(fltk::inactive(fltk::BLACK)); + else + w->label_color(fltk::Button::default_style->label_color); + + if(active==win) { + TaskBar::active = win; + w->set_value(); + w->color(fltk::lighter(fltk::Button::default_style->color)); + w->highlight_color(fltk::lighter(fltk::Button::default_style->color)); + } else { + w->clear_value(); + w->color(fltk::Button::default_style->color); + w->highlight_color(fltk::Button::default_style->highlight_color); + } + } + redraw(); +} + +void TaskBar::update_name(Window win) +{ + for(int n=0; nargument(); + + if(window==win) { + char *name = 0; + bool ret = Fl_WM::get_window_icontitle(win, name); + if(!ret || !name) ret = Fl_WM::get_window_title(win, name); + + if(ret && name) { + w->label(name); + w->tooltip(name); + free(name); + } else { + w->label("..."); + w->tooltip("..."); + } + + // Update icon also.. + fltk::Image *icon = w->image(); + if(icon!=&default_icon) delete icon; + + if(Fl_WM::get_window_icon(win, icon, 16, 16)) + w->image(icon); + else + w->image(default_icon); + + w->redraw(); + break; + } + } + redraw(); +} + +void TaskBar::minimize_all() +{ + Window *wins=0; + int num_windows = Fl_WM::get_windows_mapping(wins); + + int current_workspace = Fl_WM::get_current_workspace(); + for(int n=0; n0) + XIconifyWindow(fltk::display, wins[n], fltk::screen); + } + XSync(fl_display, True); + active = 0; +} + +void TaskBar::add_new_task(Window w) +{ + // Add to Fl_WM module handled windows. + Fl_WM::handle_window(w); + + TaskButton *b; + char *name = 0; + fltk::Image *icon = 0; + + if (!w) return; + + begin(); + + b = new TaskButton(w); + + bool ret = Fl_WM::get_window_icontitle(w, name); + if(!ret || !name) ret = Fl_WM::get_window_title(w, name); + + if(ret && name) { + b->label(name); + b->tooltip(name); + free(name); + } else { + b->label("..."); + b->tooltip("..."); + } + + if(Fl_WM::get_window_icon(w, icon, 16, 16)) { + b->image(icon); + } else { + b->image(default_icon); + } + + b->accept_focus(false); + b->align(fltk::ALIGN_LEFT | fltk::ALIGN_INSIDE | fltk::ALIGN_CLIP); + + if(Fl_WM::get_active_window()==w) { + b->value(1); + active = w; + } + + if(GetState(w) == IconicState) + b->label_color(fltk::inactive(fltk::BLACK)); + + end(); +} + +////////////////////////// + +static void* getProperty(Window w, Atom a, Atom type, unsigned long *np, int *ret) +{ + Atom realType; + int format; + unsigned long n, extra; + int status; + uchar *prop=0; + status = XGetWindowProperty(fltk::display, w, a, 0L, 0x7fffffff, + False, type, &realType, + &format, &n, &extra, (uchar**)&prop); + if(ret) *ret = status; + if (status != Success) return 0; + if (!prop) { return 0; } + if (!n) { XFree(prop); return 0; } + if (np) *np = n; + return prop; +} + +static int getIntProperty(Window w, Atom a, Atom type, int deflt, int *ret) +{ + void* prop = getProperty(w, a, type, 0, ret); + if(!prop) return deflt; + int r = int(*(long*)prop); + XFree(prop); + return r; +} + +// 0 ERROR +// Otherwise state +static int GetState(Window w) +{ + static Atom _XA_WM_STATE = 0; + if(!_XA_WM_STATE) _XA_WM_STATE = XInternAtom(fltk::display, "WM_STATE", False); + + int ret=0; + int state = getIntProperty(w, _XA_WM_STATE, _XA_WM_STATE, 0, &ret); + if(ret!=Success) return 0; + return state; +} diff --git a/eworkpanel/taskbutton.h b/eworkpanel/taskbutton.h new file mode 100644 index 0000000..dd81077 --- /dev/null +++ b/eworkpanel/taskbutton.h @@ -0,0 +1,55 @@ +#ifndef _TASKBUTTON_H_ +#define _TASKBUTTON_H_ + +/*#include +#include +#include */ + +#include +#include +#include + +class TaskBar; + +// One task in taskabr +class TaskButton : public fltk::Button +{ +public: + // TashBar is needed for this pointer, so we can call update() + TaskButton(Window w); + + // Menu stuff + static fltk::Menu_ *menu; + static TaskButton *pushed; +}; + +///////////////////////////////////// + +class TaskBar : public fltk::Group +{ +public: + TaskBar(); + + // Active window ID + static Window active; + + //Are buttons variable width + static bool variable_width; + + void layout(); + + void update(); + void update_name(Window win); + void update_active(Window active); + + int max_taskwidth() const { return m_max_taskwidth; } + + void minimize_all(); + +private: + void add_new_task(Window w); + + int m_max_taskwidth; +}; + +#endif diff --git a/eworkpanel/workpanel.cpp b/eworkpanel/workpanel.cpp new file mode 100644 index 0000000..661f9f9 --- /dev/null +++ b/eworkpanel/workpanel.cpp @@ -0,0 +1,664 @@ +// Copyright (c) 2000. - 2005. EDE Authors +// This program is licenced under terms of the +// GNU General Public Licence version 2 or newer. +// See COPYING for details. + +#include "workpanel.h" +#include "aboutdialog.h" + +#include "panelbutton.h" +#include "taskbutton.h" +#include "cpumonitor.h" +#include "dock.h" +#include "mainmenu.h" +#include "keyboardchooser.h" + +/*#include +#include +#include +#include +#include */ + +#include +#include +#include +#include +#include + +#include "item.h" +#include + +static fltk::Image desktop_pix((const char **)desktop_xpm); +static fltk::Image sound_pix((const char **)sound_xpm); +static fltk::Image run_pix((const char **)run_xpm); +static fltk::Image showdesktop_pix((const char **)showdesktop_xpm); + +class Fl_Update_Window : public fltk::Window +{ +public: + Fl_Update_Window(int, int, int, int, char*); + void setAutoHide(int a) { autoHide = a; } + + int handle(int event); + + int autoHide; + int initX, initY, initW, initH; +}; + +Fl_Update_Window *mPanelWindow; + +fltk::Button *mClockBox; +fltk::Group *mModemLeds; +fltk::Box *mLedIn, *mLedOut; + +fltk::Input_Browser *runBrowser; + +PanelMenu *mProgramsMenu; +PanelMenu *mWorkspace; +MainMenu *mSystemMenu; +KeyboardChooser *mKbdSelect; + +Dock *dock; +TaskBar *tasks; + +EDE_Config pGlobalConfig(find_config_file("ede.conf", true)); + +void updateStats(void *); + + +///////////////////////////////////////////////////////////////////////////// + + +Fl_Update_Window::Fl_Update_Window(int X, int Y, int W, int H, char *label=0) + : fltk::Window(X, Y, W, H, label) +{ + autoHide = 0; + initX = X; + initY = Y; + initW = W; + initH = H; +} + +int Fl_Update_Window::handle(int event) +{ + switch (event) { + case fltk::SHOW: { + int ret = fltk::Window::handle(FL_SHOW); + int is_shown = shown(); + + if(is_shown && !autoHide) + Fl_WM::set_window_strut(fltk::xid(mPanelWindow), 0, 0, 0, h()); + + if(is_shown && autoHide) + position(initX, initY); + + return ret; + } + + case fltk::ENTER: + if(!autoHide) { + position(initX, initY); + if(shown()) Fl_WM::set_window_strut(fltk::xid(mPanelWindow), 0, 0, 0, h()); + } + else + position(initX, initY); + + take_focus(); + return 1; + + case FL_LEAVE: + if(autoHide && fltk::event() == fltk::LEAVE) { + position(initX, initY+h()-2); + if(shown()) Fl_WM::set_window_strut(fltk::xid(mPanelWindow), 0, 0, 0, 2); + } + throw_focus(); + return 1; + } + return fltk::Window::handle(event); +} + +void setWorkspace(fltk::Button *, void *w) +{ + Fl_WM::set_current_workspace((int) w); +} + +void restoreRunBrowser() { + // Read the history of commands in runBrowser on start + runBrowser->clear(); + char* historyString; + pGlobalConfig.get("Panel", "RunHistory", historyString,""); + char* token = strtok(historyString,"|"); + do { + runBrowser->add(token); + } while (token = strtok(NULL, "|")); +} + + +bool showseconds = true; + +void clockRefresh(void *) +{ + mClockBox->label(fltk::Date_Time::Now().time_string().sub_str(0, 5)); + + strncpy(fltk::Date_Time::datePartsOrder, _("MDY"), 3); + char* pClockTooltip = strdup(Fl_Date_Time::Now().day_name()); + pClockToolTip = strdupcat(pClockToolTip, ", "); + pClockTooltip = strdupcat(pClockToolTip, Fl_Date_Time::Now().date_string()); + pClockToolTip = strdupcat(pClockToolTip, ", "); + pClockToolTip = strdupcat(Fl_Date_Time::Now().time_string()); + mClockBox->tooltip(pClockTooltip); + + mClockBox->redraw(); + fltk::add_timeout(1.0, clockRefresh); + free(pClockToolTip); +} + +void runUtility(fltk::Widget *, char *pCommand) +{ + char cmd[256]; + snprintf (cmd, sizeof(cmd)-1, "elauncher %s", pCommand); + fltk::start_child_process(cmd, false); +} + +void updateSetup() +{ + //printf("updateSetup()\n"); + struct stat s; + + // Check if configuration needs to be updated + if(!stat(pGlobalConfig.filename(), &s)) { + static long last_modified = 0; + long now = s.st_mtime; + + if(last_modified>0 && last_modified==now) { + // Return if not modified + return; + } + // Store last modified time + last_modified = s.st_mtime; + } + + pGlobalConfig.read_file(false); + if(pGlobalConfig.error()) { + fprintf(stderr, "[EWorkPanel Error]: %s\n", pGlobalConfig.strerror()); + return; + } + + bool auto_hide = false; + static bool hiden = false; + static bool last_state = false; + static bool on_start = true; + bool runbrowser; + + pGlobalConfig.get("Panel", "AutoHide", auto_hide, false); + if (on_start) { + last_state = auto_hide; + pGlobalConfig.get("Panel", "RunBrowser", runbrowser, true); + if (runbrowser) { restoreRunBrowser() ; } + } + + bool old_hiden = hiden; + if (auto_hide) { + mPanelWindow->setAutoHide(1); + hiden = true; + } else { + mPanelWindow->setAutoHide(0); + hiden = false; + } + + if(old_hiden!=hiden || on_start) { + if(!hiden) { + mPanelWindow->position(mPanelWindow->initX, mPanelWindow->initY); + if(mPanelWindow->shown()) Fl_WM::set_window_strut(fltk::xid(mPanelWindow), 0, 0, 0, mPanelWindow->h()); + } else { + mPanelWindow->position(mPanelWindow->initX, mPanelWindow->initY+mPanelWindow->h()-4); + if(mPanelWindow->shown()) Fl_WM::set_window_strut(fltk::xid(mPanelWindow), 0, 0, 0, 4); + } + } + + on_start = false; +} + +void updateStats(void *) +{ + char pLogBuffer[1024]; + static int log_len; + static struct timeval last_time; + static long last_rx=0; static long last_tx=0; static long connect_time=0; + char *ptr; int fd; char buf[1024]; + long rx = -1; long tx = -1; + float spi = 0.0; float spo = 0.0; + static bool modleds = false; + int len = -1; + + fd = open("/proc/net/dev", O_RDONLY); + if(fd > 0) { + + len = read(fd, buf, 1023); + close(fd); + + if(len>0) { + buf[len] = '\0'; + ptr = strstr( buf, "ppp0" ); + } + } + + if(fd==-1 || len < 0 || ptr == NULL) + { + if (modleds) { + dock->remove_from_tray(mModemLeds); + modleds = false; + } + last_rx=0; last_tx=0; connect_time=0; + + } + else + { + long dt; int ct; struct timeval tv; + + gettimeofday(&tv, NULL); + dt = (tv.tv_sec - last_time.tv_sec) * 1000; + dt += (tv.tv_usec - last_time.tv_usec) / 1000; + + if (dt > 0) { + sscanf(ptr, "%*[^:]:%ld %*d %*d %*d %*d %*d %*d %*d %ld", &rx, &tx); + spi = (rx - last_rx) / dt; + spi = spi / 1024.0 * 1000.0; + spo = (tx - last_tx) / dt; + spo = spo / 1024.0 * 1000.0; + + + if ( connect_time == 0 ) + connect_time = tv.tv_sec; + ct = (int)(tv.tv_sec - connect_time); + + snprintf(pLogBuffer, 1024, + _("Received: %ld kB (%.1f kB/s)\n" + "Sent: %ld kB (%.1f kB/s)\n" + "Duration: %d min %d sec"), + rx / 1024, spi, tx / 1024, spo, ct / 60, ct % 60 ); + last_rx = rx; + last_tx = tx; + last_time.tv_sec = tv.tv_sec; + last_time.tv_usec = tv.tv_usec; + + log_len = 0; + + if ((int)(spi) > 0) + { + mLedIn->color( (Fl_Color)2 ); + mLedIn->redraw(); + } + else + { + mLedIn->color( (Fl_Color)968701184 ); + mLedIn->redraw(); + } + + if ( (int)(spo) > 0 ) { + mLedOut->color( (Fl_Color)2 ); + mLedOut->redraw(); + } else { + mLedOut->color( (Fl_Color)968701184 ); + mLedOut->redraw(); + } + mModemLeds->tooltip(pLogBuffer); + } + if (!modleds) + { + dock->add_to_tray(mModemLeds); + modleds = true; + } + } + + updateSetup(); + fltk::repeat_timeout(1.0f, updateStats); +} + + +// Start utility, like "time/date" or "volume" +void startUtility(fltk::Button *, void *pName) +{ + char* value; + pGlobalConfig.get("Panel", pName, value, ""); + + if(!pGlobalConfig.error() && strlen(value)>0) { + char* value2 = strdup("elauncher \""); + value2 = strdupcat(value2,value); + value2 = strdupcat(value2,"\""); + fltk::start_child_process(value2, false); + free(value2); + } + free(value); +} + +void updateWorkspaces(fltk::Widget*,void*) +{ + bool showapplet; + pGlobalConfig.get("Panel", "Workspaces", showapplet, true); + if (!showapplet) { return; } + mWorkspace->clear(); + mWorkspace->begin(); + + char **names=0; + int count = Fl_WM::get_workspace_count(); + int names_count = Fl_WM::get_workspace_names(names); + int current = Fl_WM::get_current_workspace(); + + for(int n=0; ncallback( (fltk::Callback *) setWorkspace, (void*)n); + i->type(fltk::Item::RADIO); + if(nlabel(names[n]); + delete []names[n]; + } else { + char* tmp; + sprintf(tmp,"%s %d", _("Workspace") ,n+1); + i->label(tmp); + free(tmp); + } + if(current==n) i->set_value(); + } + if(names) delete []names; + + mWorkspace->end(); +} + +void FL_WM_handler(fltk::Widget *w, void *d) +{ + if(fltk::WM::action()==fltk::WM::WINDOW_NAME || fltk::WM::action()==fltk::WM::WINDOW_ICONNAME) { + tasks->update_name(fltk::WM::window()); + } + if(fltk::WM::action()==fltk::WM::WINDOW_ACTIVE) { + tasks->update_active(fltk::WM::get_active_window()); + } + else if(fltk::WM::action() >= fltk::WM::WINDOW_LIST && fltk::WM::action() <= fltk::WM::WINDOW_DESKTOP) { + tasks->update(); + } + else if(fltk::WM::action()>0 && fltk::WM::action()update(); + } +} + +#define DEBUG +void terminationHandler(int signum) +{ +#ifndef DEBUG + // to crash the whole X session can make people worried so try it + // to save anymore... + execlp("eworkpanel", "eworkpanel", 0); +#else + fprintf(stderr, "\n\nEWorkPanel has just crashed! Please report bug to efltk-bugs@fltk.net\n\n"); + abort(); +#endif +} + +void cb_run_app(Fl_Input *i, void*) +{ + char* exec = strdup(i->value()); + if (strcmp(exec,"")==0 || strcmp(exec," ")==0) + return; + char* exec2 = strdup("elauncher \""); + exec2 = strdupcat(exec2,exec); + exec2 = strdupcat(exec2,"\""); + fltk::start_child_process(exec, false); + + fltk::Input_Browser *ib = (fltk::Input_Browser *)i->parent(); + if (!ib->find(i->value())) { + ib->add(i->value()); + int c = 0; + if (ib->children() > 15) c = ib->children() - 15; + char* history; + for (; c < ib->children()-1; c++) { + history = strdupcat(ib->child(c)->label()); + history = strdupcat("|"); + } + history = strdupcat(ib->child(ib->children()-1)->label()); + pGlobalConfig.set("Panel", "RunHistory", history); + pGlobalConfig.flush(); + } + + i->value(""); +} +void cb_run_app2(fltk::Input_Browser *i, void*) { cb_run_app(i->input(), 0); } + +void cb_showdesktop(fltk::Button *) { +// spagetti code - workpanel.cpp needs to be cleaned up of extraneous code + tasks->minimize_all(); +} + +int main(int argc, char **argv) +{ + signal(SIGCHLD, SIG_IGN); + signal(SIGSEGV, terminationHandler); +// fl_init_locale_support("eworkpanel", PREFIX"/share/locale"); + fltk::init_images_lib(); + + int X=0,Y=0,W=Fl::w(),H=Fl::h(); + int substract; + + // Get current workarea + Fl_WM::get_workarea(X,Y,W,H); + + //printf("Free area: %d %d %d %d\n", X,Y,W,H); + + // We expect that other docks are moving away from panel :) + mPanelWindow = new Fl_Update_Window(X, Y+H-30, W, 30, "Workpanel"); + mPanelWindow->layout_spacing(0); + // Panel is type DOCK + mPanelWindow->window_type(Fl_WM::DOCK); + mPanelWindow->setAutoHide(0); + + // Read config + bool doShowDesktop; + pGlobalConfig.get("Panel", "ShowDesktop", doShowDesktop, false); + bool doWorkspaces; + pGlobalConfig.get("Panel", "Workspaces", doWorkspaces, true); + bool doRunBrowser; + pGlobalConfig.get("Panel", "RunBrowser", doRunBrowser, true); + bool doSoundMixer; + pGlobalConfig.get("Panel", "SoundMixer", doSoundMixer, true); + bool doCpuMonitor; + pGlobalConfig.get("Panel", "CPUMonitor", doCpuMonitor, true); + + // Group that holds everything.. + fltk::Group *g = new fltk::Group(0,0,0,0); + g->box(fltk::DIV_UP_BOX); + g->layout_spacing(2); + g->layout_align(fltk::ALIGN_CLIENT); + g->begin(); + + mSystemMenu = new MainMenu(); + + fltk::VertDivider *v = new fltk::VertDivider(0, 0, 5, 18, ""); + v->layout_align(fltk::ALIGN_LEFT); + substract = 5; + + if ((doShowDesktop) || (doWorkspaces)) { + //this is ugly: + int size; + if ((doShowDesktop) && (doWorkspaces)) { size=48; } else { size=24; } + fltk::Group *g2 = new fltk::Group(0,0,size,22); + g2->box(fltk::FLAT_BOX); + g2->layout_spacing(0); + g2->layout_align(fltk::ALIGN_LEFT); + + // Show desktop button + if (doShowDesktop) { + PanelButton *mShowDesktop; + mShowDesktop = new PanelButton(0, 0, 24, 22, fltk::NO_BOX, fltk::DOWN_BOX, "ShowDesktop"); + mShowDesktop->layout_align(fltk::ALIGN_LEFT); + mShowDesktop->label_type(fltk::NO_LABEL); + mShowDesktop->align(fltk::ALIGN_INSIDE|fltk::ALIGN_CENTER); + mShowDesktop->image(showdesktop_pix); + mShowDesktop->tooltip(_("Show desktop")); + mShowDesktop->callback( (fltk::Callback*)cb_showdesktop); + mShowDesktop->show(); + + substract += 26; + } + + // Workspaces panel + if (doWorkspaces) { + mWorkspace = new PanelMenu(0, 0, 24, 22, fltk::NO_BOX, fltk::DOWN_BOX, "WSMenu"); + mWorkspace->layout_align(fltk::ALIGN_LEFT); + mWorkspace->label_type(fltk::NO_LABEL); + mWorkspace->align(fltk::ALIGN_INSIDE|fltk::ALIGN_CENTER); + mWorkspace->image(desktop_pix); + mWorkspace->tooltip(_("Workspaces")); + mWorkspace->end(); + + substract += 26; + } + + g2->end(); + g2->show(); + g2->resizable(); + + v = new fltk::VertDivider(0, 0, 5, 18, ""); + v->layout_align(fltk::ALIGN_LEFT); + substract += 5; + } + + // Run browser + if (doRunBrowser) { + runBrowser = new fltk::Input_Browser("",100,fltk::ALIGN_LEFT,30); + //runBrowser->image(run_pix); + //runBrowser->box(FL_THIN_DOWN_BOX); + + // Added _ALWAYS so callback is in case: + // 1) select old command from input browser + // 2) press enter to execute. (this won't work w/o _ALWAYS) +// runBrowser->input()->when(FL_WHEN_ENTER_KEY_ALWAYS | FL_WHEN_RELEASE_ALWAYS); + // Vedran: HOWEVER, with _ALWAYS cb_run_app will be called way + // too many times, causing fork-attack + runBrowser->input()->when(fltk::WHEN_ENTER_KEY); + runBrowser->input()->callback((fltk::Callback*)cb_run_app); + runBrowser->callback((fltk::Callback*)cb_run_app2); + + v = new fltk::VertDivider(0, 0, 5, 18, ""); + v->layout_align(fltk::ALIGN_LEFT); + substract += 105; + } + + + // Popup menu for the whole taskbar + fltk::Menu_Button *mPopupPanelProp = new fltk::Menu_Button( 0, 0, W, 28 ); + mPopupPanelProp->type( fltk::Menu_Button::POPUP3 ); + mPopupPanelProp->anim_flags(fltk::Menu_::LEFT_TO_RIGHT); + mPopupPanelProp->anim_speed(0.8); + mPopupPanelProp->begin(); + + fltk::Item *mPanelSettings = new fltk::Item(_("Settings")); + mPanelSettings->x_offset(12); + mPanelSettings->callback( (fltk::Callback*)runUtility, (void*)"epanelconf" ); + new fltk::Divider(10, 5); + + fltk::Item *mAboutItem = new fltk::Item(_("About EDE...")); + mAboutItem->x_offset(12); + mAboutItem->callback( (fltk::Callback *)AboutDialog ); + + mPopupPanelProp->end(); + + // Subgroup to properly align everything +/* Fl_Group *subgroup; + { + subgroup = new Fl_Group(0, 0, W-substract, 18); + subgroup->box(FL_FLAT_BOX); + subgroup->layout_align(FL_ALIGN_RIGHT); + subgroup->show(); + subgroup->begin(); */ + + // Taskbar... + tasks = new TaskBar(); + dock = new Dock(); + + v = new fltk::VertDivider(0, 0, 5, 18, ""); + v->layout_align(fltk::ALIGN_RIGHT); + +/* subgroup->end(); + }*/ + + { + // MODEM + mModemLeds = new fltk::Group(0, 0, 25, 18); + mModemLeds->box(fltk::FLAT_BOX); + mModemLeds->hide(); + mLedIn = new fltk::Box(2, 5, 10, 10); + mLedIn->box( fltk::OVAL_BOX ); + mLedIn->color( (fltk::Color)968701184); + mLedOut = new fltk::Box(12, 5, 10, 10); + mLedOut->box( fltk::OVAL_BOX); + mLedOut->color( (fltk::Color)968701184); + mModemLeds->end(); + } + + { + // KEYBOARD SELECT + mKbdSelect = new KeyboardChooser(0, 0, 20, 18, fltk::NO_BOX, fltk::DOWN_BOX, "us"); + mKbdSelect->hide(); + mKbdSelect->anim_speed(4); + mKbdSelect->label_font(mKbdSelect->label_font()->bold()); + mKbdSelect->highlight_color(mKbdSelect->selection_color()); + mKbdSelect->highlight_label_color( mKbdSelect->selection_text_color()); + } + + { + // CLOCK + mClockBox = new fltk::Button(0, 0, 50, 20); + mClockBox->align(fltk::ALIGN_INSIDE|fltk::ALIGN_LEFT); + mClockBox->hide(); + mClockBox->box(fltk::FLAT_BOX); + mClockBox->callback( (Fl_Callback*)startUtility, (void*)"Time and date"); + } + + dock->add_to_tray(mClockBox); + dock->add_to_tray(mKbdSelect); + + // SOUND applet + if (doSoundMixer) { + fltk::Button *mSoundMixer; + mSoundMixer = new fltk::Button(0, 0, 20, 18); + mSoundMixer->hide(); + mSoundMixer->box(fltk::NO_BOX); + mSoundMixer->focus_box(fltk::NO_BOX); + mSoundMixer->image(sound_pix); + mSoundMixer->tooltip(_("Volume control")); + mSoundMixer->align(fltk::ALIGN_INSIDE); + mSoundMixer->callback( (fltk::Callback*)startUtility, (void*)"Volume Control" ); + dock->add_to_tray(mSoundMixer); + } + + // CPU monitor + if (doCpuMonitor) { + CPUMonitor *cpumon; + cpumon = new CPUMonitor(); + cpumon->hide(); + dock->add_to_tray(cpumon); + } + + + fltk::focus(mSystemMenu); + + mPanelWindow->end(); + mPanelWindow->show(argc, argv); + + Fl_WM::callback(FL_WM_handler, 0, Fl_WM::DESKTOP_COUNT | + Fl_WM::DESKTOP_NAMES | + Fl_WM::DESKTOP_CHANGED| + Fl_WM::WINDOW_LIST| + Fl_WM::WINDOW_DESKTOP| + Fl_WM::WINDOW_ACTIVE| + Fl_WM::WINDOW_NAME| + Fl_WM::WINDOW_ICONNAME); + + updateWorkspaces(0,0); + + fltk::add_timeout(0, clockRefresh); + fltk::add_timeout(0, updateStats); + + while(mPanelWindow->shown()) + fltk::wait(); +} diff --git a/eworkpanel/workpanel.h b/eworkpanel/workpanel.h new file mode 100644 index 0000000..905b939 --- /dev/null +++ b/eworkpanel/workpanel.h @@ -0,0 +1,114 @@ +// Equinox Desktop Environment - main panel +// Copyright (C) 2000-2002 Martin Pekar +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// This program 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 General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +#ifndef workpanel_h +#define workpanel_h + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/*#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "EDE_Config.h" +#include +#include +#include +#include "NLS.h" + +#include "icons/sound.xpm" +#include "icons/desktop.xpm" +#include "icons/run.xpm" +#include "icons/showdesktop.xpm" + +#endif diff --git a/exset/exset.h b/exset/exset.h new file mode 100644 index 0000000..4c5bbe9 --- /dev/null +++ b/exset/exset.h @@ -0,0 +1,74 @@ +#ifndef exset_h +#define exset_h + +#include +#include + +#include +#include + +#include +#include + +class Exset { + +public: + Exset(void) {} + ~Exset() {} + + char str[80]; + + void set_pattern(int delay, int pattern = -1){ + if( pattern != -1 ){ + sprintf(str,"xset s %d %d",delay*60,pattern*60); + fl_start_child_process(str); + }else{ + sprintf(str,"xset s %d",delay*60); + fl_start_child_process(str); + } + } + void set_check_blank(int blank){ + sprintf(str,"xset s %s",blank ? "on" : "off"); + fl_start_child_process(str); + } + void set_blank(int blank){ + sprintf(str,"xset s %s",blank ? "blank" : "noblank"); + fl_start_child_process(str); + } + + void test_blank() { fl_start_child_process("xset s activate"); } + void test_bell() { fl_start_child_process("xkbbell"); } + + void set_mouse(int accel, int thresh){ + XChangePointerControl(fl_display, true, true, accel, + 1, thresh); + } + + + void set_bell(int volume, int pitch, int duration, int sound = 0){ + XKeyboardControl _ctrl; + unsigned long mask = KBBellPercent | KBBellPitch | KBBellDuration; + + _ctrl.bell_percent = volume; + _ctrl.bell_pitch = pitch; + _ctrl.bell_duration = duration; + + set_xset(&_ctrl,mask); + } + + void set_keybd( int repeat, int clicks) { + XKeyboardControl _ctrl; + unsigned long mask = KBKeyClickPercent | KBAutoRepeatMode; + + _ctrl.key_click_percent = clicks; + _ctrl.auto_repeat_mode = (repeat ? AutoRepeatModeOn : AutoRepeatModeOff); + + set_xset(&_ctrl,mask); + } + + void set_xset(XKeyboardControl * ctrl, unsigned long mask){ + XChangeKeyboardControl(fl_display, mask, ctrl); + } +}; +#endif + diff --git a/install-sh b/install-sh new file mode 100755 index 0000000..e843669 --- /dev/null +++ b/install-sh @@ -0,0 +1,250 @@ +#!/bin/sh +# +# install - install a program, script, or datafile +# This comes from X11R5 (mit/util/scripts/install.sh). +# +# Copyright 1991 by the Massachusetts Institute of Technology +# +# Permission to use, copy, modify, distribute, and sell this software and its +# documentation for any purpose is hereby granted without fee, provided that +# the above copyright notice appear in all copies and that both that +# copyright notice and this permission notice appear in supporting +# documentation, and that the name of M.I.T. not be used in advertising or +# publicity pertaining to distribution of the software without specific, +# written prior permission. M.I.T. makes no representations about the +# suitability of this software for any purpose. It is provided "as is" +# without express or implied warranty. +# +# Calling this script install-sh is preferred over install.sh, to prevent +# `make' implicit rules from creating a file called install from it +# when there is no Makefile. +# +# This script is compatible with the BSD install script, but was written +# from scratch. It can only install one file at a time, a restriction +# shared with many OS's install programs. + + +# set DOITPROG to echo to test this script + +# Don't use :- since 4.3BSD and earlier shells don't like it. +doit="${DOITPROG-}" + + +# put in absolute paths if you don't have them in your path; or use env. vars. + +mvprog="${MVPROG-mv}" +cpprog="${CPPROG-cp}" +chmodprog="${CHMODPROG-chmod}" +chownprog="${CHOWNPROG-chown}" +chgrpprog="${CHGRPPROG-chgrp}" +stripprog="${STRIPPROG-strip}" +rmprog="${RMPROG-rm}" +mkdirprog="${MKDIRPROG-mkdir}" + +transformbasename="" +transform_arg="" +instcmd="$mvprog" +chmodcmd="$chmodprog 0755" +chowncmd="" +chgrpcmd="" +stripcmd="" +rmcmd="$rmprog -f" +mvcmd="$mvprog" +src="" +dst="" +dir_arg="" + +while [ x"$1" != x ]; do + case $1 in + -c) instcmd="$cpprog" + shift + continue;; + + -d) dir_arg=true + shift + continue;; + + -m) chmodcmd="$chmodprog $2" + shift + shift + continue;; + + -o) chowncmd="$chownprog $2" + shift + shift + continue;; + + -g) chgrpcmd="$chgrpprog $2" + shift + shift + continue;; + + -s) stripcmd="$stripprog" + shift + continue;; + + -t=*) transformarg=`echo $1 | sed 's/-t=//'` + shift + continue;; + + -b=*) transformbasename=`echo $1 | sed 's/-b=//'` + shift + continue;; + + *) if [ x"$src" = x ] + then + src=$1 + else + # this colon is to work around a 386BSD /bin/sh bug + : + dst=$1 + fi + shift + continue;; + esac +done + +if [ x"$src" = x ] +then + echo "install: no input file specified" + exit 1 +else + true +fi + +if [ x"$dir_arg" != x ]; then + dst=$src + src="" + + if [ -d $dst ]; then + instcmd=: + else + instcmd=mkdir + fi +else + +# Waiting for this to be detected by the "$instcmd $src $dsttmp" command +# might cause directories to be created, which would be especially bad +# if $src (and thus $dsttmp) contains '*'. + + if [ -f $src -o -d $src ] + then + true + else + echo "install: $src does not exist" + exit 1 + fi + + if [ x"$dst" = x ] + then + echo "install: no destination specified" + exit 1 + else + true + fi + +# If destination is a directory, append the input filename; if your system +# does not like double slashes in filenames, you may need to add some logic + + if [ -d $dst ] + then + dst="$dst"/`basename $src` + else + true + fi +fi + +## this sed command emulates the dirname command +dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` + +# Make sure that the destination directory exists. +# this part is taken from Noah Friedman's mkinstalldirs script + +# Skip lots of stat calls in the usual case. +if [ ! -d "$dstdir" ]; then +defaultIFS=' +' +IFS="${IFS-${defaultIFS}}" + +oIFS="${IFS}" +# Some sh's can't handle IFS=/ for some reason. +IFS='%' +set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'` +IFS="${oIFS}" + +pathcomp='' + +while [ $# -ne 0 ] ; do + pathcomp="${pathcomp}${1}" + shift + + if [ ! -d "${pathcomp}" ] ; + then + $mkdirprog "${pathcomp}" + else + true + fi + + pathcomp="${pathcomp}/" +done +fi + +if [ x"$dir_arg" != x ] +then + $doit $instcmd $dst && + + if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi && + if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi && + if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi && + if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi +else + +# If we're going to rename the final executable, determine the name now. + + if [ x"$transformarg" = x ] + then + dstfile=`basename $dst` + else + dstfile=`basename $dst $transformbasename | + sed $transformarg`$transformbasename + fi + +# don't allow the sed command to completely eliminate the filename + + if [ x"$dstfile" = x ] + then + dstfile=`basename $dst` + else + true + fi + +# Make a temp file name in the proper directory. + + dsttmp=$dstdir/#inst.$$# + +# Move or copy the file name to the temp name + + $doit $instcmd $src $dsttmp && + + trap "rm -f ${dsttmp}" 0 && + +# and set any options; do chmod last to preserve setuid bits + +# If any of these fail, we abort the whole thing. If we want to +# ignore errors from any of these, just make sure not to ignore +# errors from the above "$doit $instcmd $src $dsttmp" command. + + if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi && + if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi && + if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi && + if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi && + +# Now rename the file to the real destination. + + $doit $rmcmd -f $dstdir/$dstfile && + $doit $mvcmd $dsttmp $dstdir/$dstfile + +fi && + + +exit 0 diff --git a/m4/fltk.m4 b/m4/fltk.m4 new file mode 100644 index 0000000..0c30dcf --- /dev/null +++ b/m4/fltk.m4 @@ -0,0 +1,44 @@ +dnl +dnl $Id$ +dnl +dnl Part of Equinox Desktop Environment (EDE). +dnl Copyright (c) 2000-2007 EDE Authors. +dnl +dnl This program is licenced under terms of the +dnl GNU General Public Licence version 2 or newer. +dnl See COPYING for details. + +AC_DEFUN([EDE_CHECK_FLTK], [ + dnl AC_MSG_NOTICE(whether is fltk 2.0 present) + AC_PATH_PROG(FLTK2_CONFIG, fltk2-config) + if test -n "$FLTK2_CONFIG"; then + FLTKFLAGS=`fltk2-config --cxxflags` + + dnl remove -lsupc++ so we can chose what to use + FLTKLIBS=`fltk2-config --use-images --ldflags | sed -e 's/-lsupc++//g'` + else + AC_MSG_ERROR([You don't have fltk2 installed. To compile EDE, you will need it.]) + fi +]) + + +AC_DEFUN([EDE_CHECK_EFLTK], [ + dnl AC_MSG_NOTICE(whether is efltk present) + AC_PATH_PROG(EFLTK_CONFIG, efltk-config) + if test -n "$EFLTK_CONFIG"; then + EFLTKFLAGS=`efltk-config --cxxflags` + EFLTKLIBS=`efltk-config --use-images --ldflags` + else + AC_MSG_ERROR([You don't have efltk installed. To compile EDE, you will need it.]) + fi + + AC_MSG_CHECKING(efltk version >= 2.0.4) + EFLTK_VERSION="`efltk-config --version`" + case "$EFLTK_VERSION" in ["2.0."[56789]]) + dnl Display 'yes' for efltk version check + AC_MSG_RESULT(yes) + ;; + *) + AC_MSG_ERROR([It seems that you have older efltk version. Required is >= 2.0.4]) + esac +]) diff --git a/m4/initjamfile.m4 b/m4/initjamfile.m4 new file mode 100644 index 0000000..cb4c11b --- /dev/null +++ b/m4/initjamfile.m4 @@ -0,0 +1,99 @@ +dnl +dnl $Id$ +dnl +dnl Part of Equinox Desktop Environment (EDE). +dnl Based on code from Autojam (c) Matze Braun + +#---------------------------------------------------------------------------- +# EDE_INIT_JAM +# This rule fixes several issues related to autoconf being make centric +#---------------------------------------------------------------------------- +AC_DEFUN([EDE_INIT_JAM], + [ + AC_OUTPUT_INSTALLDIRS + AC_FIX_INSTALL]) + +#----------------------------------------------------------------------------- +# AC_OUTPUT_INSTALLDIRS +# Transforms the installation dirs which are gathered by autoconf and sets +# properties in the Jamconfig file for them. We deal with stuff like +# variable references inside the paths (often the paths contain ${prefix}) +# and with correct quoting here. +# The script will set the INSTALLDIR.PREFIX, INSTALLDIR.EXEC_PREFIX, +# INSTALLDIR.APPLICATION, INSTALLDIR.SBIN, INSTALLDIR.LIBEXEC, +# INSTALLDIR.DATA, INSTALLDIR.MAP, INSTALLDIR.CONFIG, INSTALLDIR.SHAREDSTATE +# INSTALLDIR.LOCALSTATE, INSTALLDIR.PLUGIN, INSTALLDIR.DOC +# INSTALLDIR.LIBRARY, INSTALLDIR.INCLUDE, INSTALLDIR.OLDINCLUDE, +# INSTALLDIR.INFO, INSTALLDIR.MAN +#----------------------------------------------------------------------------- +AC_DEFUN([AC_OUTPUT_INSTALLDIRS],[ +# Handle the case when no prefix is given. And the special case when a path +# contains more than 2 slashes, these paths seem to be correct but jam fails +# on them. +AS_IF([test $prefix = NONE], [prefix="$ac_default_prefix"], + [prefix=`echo "$prefix" | sed -e 's:///*:/:g'`]) +AS_IF([test $exec_prefix = NONE], + [exec_prefix="AS_ESCAPE([$(prefix)])"], + [exec_prefix=`echo "$exec_prefix" | sed -e 's:///*:/:g'`]) + +prefix=AC_FIX_VARIABLEREF([$prefix]) +exec_prefix=AC_FIX_VARIABLEREF([$exec_prefix]) +bindir=AC_FIX_VARIABLEREF([$bindir]) +sbindir=AC_FIX_VARIABLEREF([$sbindir]) +libexecdir=AC_FIX_VARIABLEREF([$libexecdir]) +datadir=AC_FIX_VARIABLEREF([$datadir]) +sysconfdir=AC_FIX_VARIABLEREF([$sysconfdir]) +sharedstatedir=AC_FIX_VARIABLEREF([$sharedstatedir]) +localstatedir=AC_FIX_VARIABLEREF([$localstatedir]) +libdir=AC_FIX_VARIABLEREF([$libdir]) +includedir=AC_FIX_VARIABLEREF([$includedir]) +oldincludedir=AC_FIX_VARIABLEREF([$oldincludedir]) +infodir=AC_FIX_VARIABLEREF([$infodir]) +mandir=AC_FIX_VARIABLEREF([$mandir]) + +#hack to get the order right :-/ (autoconf --trace reports wrong order...) +AC_SUBST(prefix) +AC_SUBST(exec_prefix) +AC_SUBST(bindir) +AC_SUBST(sbindir) +AC_SUBST(libexecdir) +AC_SUBST(datadir) +AC_SUBST(sysconfdir) +AC_SUBST(sharedstatedir) +AC_SUBST(localstatedir) +AC_SUBST(libdir) +AC_SUBST(includedir) +AC_SUBST(oldincludedir) +AC_SUBST(infodir) +AC_SUBST(mandir) +]) + +#----------------------------------------------------------------------------- +# AC_FIX_INSTALL +# Fixes the output from AC_PROG_INSTALL +#----------------------------------------------------------------------------- +AC_DEFUN([AC_FIX_INSTALL], [ +AC_REQUIRE([AC_PROG_INSTALL]) +INSTALL=AC_FIX_VARIABLEREF([$INSTALL]) +INSTALL_PROGRAM=AC_FIX_VARIABLEREF([$INSTALL_PROGRAM]) +INSTALL_SCRIPT=AC_FIX_VARIABLEREF([$INSTALL_SCRIPT]) +INSTALL_DATA=AC_FIX_VARIABLEREF([$INSTALL_DATA]) + +# fix for order... +AC_SUBST([INSTALL]) +AC_SUBST([INSTALL_PROGRAM]) +AC_SUBST([INSTALL_SCRIPT]) +AC_SUBST([INSTALL_DATA]) +]) + +#----------------------------------------------------------------------------- +# AC_PREPARE_INSTALLPATH +# Transform variables of the form ${bla} to $(bla) inside the string and +# correctly quotes backslashes. +# This is needed if you want to output some of the paths that autoconf +# creates to the Jamconfig file. +#----------------------------------------------------------------------------- +AC_DEFUN([AC_FIX_VARIABLEREF], +dnl We need all the strange \\\\ quoting here, because the command will be +dnl inserted into a "" block and sed needs quoting as well +[`echo "$1" | sed -e 's/\${\([[a-zA-Z_][a-zA-Z_]]*\)}/$(\1)/g' -e 's/\\\\/\\\\\\\\/g'`]) diff --git a/m4/jam.m4 b/m4/jam.m4 new file mode 100644 index 0000000..ad917f4 --- /dev/null +++ b/m4/jam.m4 @@ -0,0 +1,33 @@ +dnl +dnl $Id$ +dnl +dnl Part of Equinox Desktop Environment (EDE). +dnl Copyright (c) 2000-2007 EDE Authors. +dnl +dnl This program is licenced under terms of the +dnl GNU General Public Licence version 2 or newer. +dnl See COPYING for details. + +dnl Check do we have jam installed and try to determine version +dnl where is minimal supported 2.3 +AC_DEFUN([EDE_PROG_JAM], [ + AC_PATH_PROG(JAM, jam) + + if test -n "$JAM"; then + AC_MSG_CHECKING([for jam version]) + + echo "Echo \$(JAMVERSION) ;" > conftest.jam + jam_version_orig=`$JAM -f conftest.jam | head -1` + jam_version=`echo $jam_version_orig | sed -e 's/\.//g'` + rm -f conftest.jam + if test "$jam_version" -ge 23; then + msg="$jam_version_orig (ok)" + AC_MSG_RESULT($msg) + else + msg="jam version $jam_version_orig is too old. Download a newer version from our repository" + AC_MSG_ERROR($msg) + fi + else + AC_MSG_ERROR(Jam is missing! You can download it from our repository) + fi +]) diff --git a/m4/libmagic.m4 b/m4/libmagic.m4 new file mode 100644 index 0000000..68a4593 --- /dev/null +++ b/m4/libmagic.m4 @@ -0,0 +1,18 @@ +dnl +dnl $Id$ +dnl +dnl Part of Equinox Desktop Environment (EDE). +dnl Copyright (c) 2000-2007 EDE Authors. +dnl +dnl This program is licenced under terms of the +dnl GNU General Public Licence version 2 or newer. +dnl See COPYING for details. + +dnl Check for presence of libmagic, since is used for mime types +dnl Note that libmagic requires libz to be linked against in this test +AC_DEFUN([EDE_CHECK_LIBMAGIC], [ + AC_CHECK_HEADER(magic.h, [ + AC_CHECK_LIB(magic, magic_open, AC_DEFINE(HAVE_LIBMAGIC, 1, [Define to 1 if you have libmagic library]),, + -lz) + ]) +]) diff --git a/m4/sound.m4 b/m4/sound.m4 new file mode 100644 index 0000000..08e39ab --- /dev/null +++ b/m4/sound.m4 @@ -0,0 +1,59 @@ +dnl +dnl $Id$ +dnl +dnl Part of Equinox Desktop Environment (EDE). +dnl Copyright (c) 2000-2007 EDE Authors. +dnl +dnl This program is licenced under terms of the +dnl GNU General Public Licence version 2 or newer. +dnl See COPYING for details. + +dnl Enable sound param and check for facility +dnl For now only .ogg via libao +AC_DEFUN([EDE_SOUND], [ + + AC_ARG_ENABLE(sounds, [ --enable-sounds enable sounds (default=yes)],, enable_sounds=yes) + + if eval "test $enable_sounds = yes"; then + AC_CHECK_HEADER(ao/ao.h, [have_ao_h=yes], [have_ao_h=no]) + AC_CHECK_LIB(ao, ao_is_big_endian, [have_ao_lib=yes], [have_ao_lib=no]) + + AC_CHECK_HEADER(vorbis/codec.h, [have_codec_h=yes], [have_codec_h=no]) + AC_CHECK_LIB(vorbis, vorbis_info_init, [have_vorbis_lib=yes], [have_vorbis_lib=no]) + + AC_CHECK_HEADER(vorbis/vorbisfile.h, [have_vorbisfile_h=yes], [have_vorbisfile_h=no]) + AC_CHECK_LIB(vorbisfile, ov_clear, [have_vorbisfile_lib=yes], [have_vorbisfile_lib=no]) + + AC_MSG_CHECKING(sound support) + if eval "test $have_ao_h = yes" && \ + eval "test $have_codec_h = yes" && \ + eval "test $have_vorbisfile_h = yes"; then + AC_MSG_RESULT(ok) + SOUNDFLAGS="-DSOUND" + SOUNDLIBS="-lao -lvorbis -lvorbisfile" + else + AC_MSG_RESULT(disabled) + fi + fi +]) + +dnl Check if we have alsa installed since evolume rely on it +dnl Here are two parameters that are set: +dnl - HAVE_ALSA used in edeconf.h +dnl - MAKE_EVOLUME used by jam +AC_DEFUN([EDE_CHECK_ALSA], [ + AC_CHECK_HEADER(linux/soundcard.h, AC_DEFINE(HAVE_ALSA, 1, [Define to 1 if you have alsa libraries])) + + if eval "test $ac_cv_header_linux_soundcard_h = yes"; then + MAKE_EVOLUME="1" + else + echo + echo "***************************************" + echo "* ALSA WAS NOT FOUND *" + echo "* *" + echo "* Sadly, evolume is ALSA-only at this *" + echo "* moment. It will be disabled. *" + echo "***************************************" + MAKE_EVOLUME="0" + fi +]) diff --git a/m4/time.m4 b/m4/time.m4 new file mode 100644 index 0000000..abd706b --- /dev/null +++ b/m4/time.m4 @@ -0,0 +1,24 @@ +dnl +dnl $Id$ +dnl +dnl Part of Equinox Desktop Environment (EDE). +dnl Copyright (c) 2000-2007 EDE Authors. +dnl +dnl This program is licenced under terms of the +dnl GNU General Public Licence version 2 or newer. +dnl See COPYING for details. + +dnl Check for time functions since they are +dnl different between systems +AC_DEFUN([EDE_CHECK_TIME_FUNCS], [ + dnl glibc extension, not present on BSD's + AC_CHECK_HEADER(time.h, [ + AC_CHECK_FUNCS(stime, AC_DEFINE(HAVE_STIME, 1, [Define to 1 if you have stime() in time.h])) + ]) + + dnl rest should have this + AC_CHECK_HEADER(sys/time.h, [ + AC_CHECK_FUNCS(gettimeofday, AC_DEFINE(HAVE_GETTIMEOFDAY, 1, [Define to 1 if you have gettimeofday() in sys/time.h])) + AC_CHECK_FUNCS(settimeofday, AC_DEFINE(HAVE_SETTIMEOFDAY, 1, [Define to 1 if you have settimeofday() in sys/time.h])) + ]) +]) diff --git a/m4/various.m4 b/m4/various.m4 new file mode 100644 index 0000000..9e92d70 --- /dev/null +++ b/m4/various.m4 @@ -0,0 +1,52 @@ +dnl +dnl $Id$ +dnl +dnl Part of Equinox Desktop Environment (EDE). +dnl Copyright (c) 2000-2007 EDE Authors. +dnl +dnl This program is licenced under terms of the +dnl GNU General Public Licence version 2 or newer. +dnl See COPYING for details. + +dnl --enable-debug and --enable-profile options +AC_DEFUN([EDE_DEVELOPMENT], [ + dnl clear all optimization flags + OPTIMFLAGS="" + + AC_ARG_ENABLE(debug, [ --enable-debug enable debug (default=no)],,enable_debug=no) + if eval "test $enable_debug = yes"; then + DEBUGFLAGS="$DEBUGFLAGS -g3" + fi + + AC_ARG_ENABLE(profile, [ --enable-profile enable profile (default=no)],,enable_profile=no) + if eval "test $enable_profile = yes"; then + DEBUGFLAGS="$DEBUGFLAGS -pg" + fi + + AC_ARG_ENABLE(pedantic, [ --enable-pedantic enable pedantic (default=no)],,enable_pedantic=no) + if eval "test $enable_pedantic = yes"; then + DEBUGFLAGS="$DEBUGFLAGS -pedantic" + fi +]) + +dnl Some distributions split packages between STL runtime +dnl and development versions; this will ensure we have development packages +dnl Code is based on AC_CXX_HAVE_STL from Todd Veldhuizen and Luc Maisonobe +AC_DEFUN([EDE_CHECK_STL], [ + AC_MSG_CHECKING(for reasonable STL support) + AC_LANG_CPLUSPLUS + AC_TRY_COMPILE([ + #include + #include + using namespace std; + ],[ + list x; x.push_back(5); + list::iterator iter = x.begin(); if (iter != x.end()) ++iter; return 0; + ], ac_cv_cxx_have_stl=yes, ac_cv_cxx_have_stl=no) + + if eval "test $ac_cv_cxx_have_stl = no"; then + AC_MSG_ERROR(You don't have STL (C++ standard library) packages installed, or your version of compiler is too old. Please fix this first) + else + AC_MSG_RESULT(yes) + fi +]) diff --git a/m4/xlib.m4 b/m4/xlib.m4 new file mode 100644 index 0000000..0b7dbab --- /dev/null +++ b/m4/xlib.m4 @@ -0,0 +1,30 @@ +dnl +dnl $Id$ +dnl +dnl Part of Equinox Desktop Environment (EDE). +dnl Copyright (c) 2000-2007 EDE Authors. +dnl +dnl This program is licenced under terms of the +dnl GNU General Public Licence version 2 or newer. +dnl See COPYING for details. + +AC_DEFUN([EDE_CHECK_X11], [ + dnl generic X11 checkers + AC_PATH_X + AC_PATH_XTRA + if eval "test $ac_x_libraries = no" || eval "test $ac_x_includes = no"; then + AC_MSG_ERROR([X11 libraries are not found! Please install them first]) + fi +]) + +AC_DEFUN([EDE_X11_SHAPE], [ + AC_ARG_ENABLE(shape, [ --enable-shape enable XShape extension (default=yes)],,enable_shape=yes) + + dnl $X_LIBS contains path to X11 libs, since are not in path by default + if eval "test $enable_shape = yes"; then + AC_CHECK_HEADER(X11/extensions/shape.h, [ + AC_CHECK_LIB(Xext, XShapeInputSelected, + AC_DEFINE(HAVE_SHAPE, 1, [Define to 1 if you have XShape extension]),,$X_LIBS) + ]) + fi +]) diff --git a/makeinclude.in b/makeinclude.in new file mode 100644 index 0000000..f206bb1 --- /dev/null +++ b/makeinclude.in @@ -0,0 +1,84 @@ +# +# $Id$ +# +# Part of Equinox Desktop Environment (EDE). +# Copyright (c) 2000-2006 EDE Authors. +# +# This program is licenced under terms of the +# GNU General Public Licence version 2 or newer. +# See COPYING for details. + +# Overwrite if you want that be overwriten + +# directories +prefix = @prefix@ +exec_prefix = @exec_prefix@ +bindir = @bindir@ +datadir = @datadir@ +includedir = @includedir@ +libdir = @libdir@ +mandir = @mandir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +VPATH = @srcdir@ +EVOLUME = @EVOLUME@ + +#locale directory +LOCALEDIR = @prefix@/share/locale + +# programs +CXX = @CXX@ +MSGFMT = @MSGFMT@ +MAKEDEPEND = @MAKEDEPEND@ +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +RM = @RM@ -f +MKINSTALLDIRS = @HOME_DIR@/mkinstalldirs + +# NOTE: this is a function +# it is called like '$(INSTALL_LOCALE)' + +INSTALL_LOCALE=\ + for f in $(MOFILES); do\ + $(MKINSTALLDIRS) $(LOCALEDIR)/`basename $$f .mo`/LC_MESSAGES;\ + $(INSTALL_DATA) $$f $(LOCALEDIR)/`basename $$f .mo`/LC_MESSAGES/$(TARGET).mo;\ + done + +# compiler flags +CXXFLAGS = -DSHAPE @CXXFLAGS@ + +# libraries +LIBS = @LIBS@ + + + +@SILENT@ + +.SUFFIXES: .o .cxx .cpp .c .po .mo + +OBJECTS:= $(CPPFILES:.cpp=.o) $(CFILES:.c=.o) $(CXXFILES:.cxx=.o) +MOFILES:= $(POFILES:.po=.mo) + +all: $(TARGET) $(MOFILES) + +$(TARGET): $(OBJECTS) + echo Linking $@ + $(CXX) $^ -o $@ $(LIBS) + +%.o: %.cpp + echo Compiling $<... + $(CXX) $(CXXFLAGS) -c $< + +%.o: %.cxx + echo Compiling $<... + $(CXX) $(CXXFLAGS) -c $< + +%.o: %.c + echo Compiling $<... + $(CXX) $(CXXFLAGS)-c $< + +%.mo: %.po + echo Translation $<... + $(MSGFMT) $< -o $@ diff --git a/mkinstalldirs b/mkinstalldirs new file mode 100755 index 0000000..f22b579 --- /dev/null +++ b/mkinstalldirs @@ -0,0 +1,40 @@ +#! /bin/sh +# mkinstalldirs --- make directory hierarchy +# Author: Noah Friedman +# Created: 1993-05-16 +# Public domain + +# $Id: mkinstalldirs,v 1.1.1.1 2005/03/04 15:44:35 karijes Exp $ + +errstatus=0 + +for file +do + set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` + shift + + pathcomp= + for d + do + pathcomp="$pathcomp$d" + case "$pathcomp" in + -* ) pathcomp=./$pathcomp ;; + esac + + if test ! -d "$pathcomp"; then + echo "mkdir $pathcomp" 1>&2 + + mkdir "$pathcomp" || lasterr=$? + + if test ! -d "$pathcomp"; then + errstatus=$lasterr + fi + fi + + pathcomp="$pathcomp/" + done +done + +exit $errstatus + +# mkinstalldirs ends here diff --git a/prepare b/prepare new file mode 100755 index 0000000..57a4638 --- /dev/null +++ b/prepare @@ -0,0 +1,31 @@ +#!/bin/sh + +if aclocal -I m4 && autoheader && autoconf; then + conffile="Jamconfig.in" + + echo "#" > $conffile + echo "# Do not edit this file. Edit configure.in and *.m4 files" >> $conffile + echo "# and run './prepare'" >> $conffile + echo "#" >> $conffile + echo "" >> $conffile + + # a cool trict from autojam + autoconf --trace=AC_SUBST \ + | sed -e 's/configure.in:[0-9]*:AC_SUBST:\([^:]*\).*/\1 ?= "@\1@" ;/g' \ + | sed -e '/ac_*/d' -e '/ECHO_*/d' \ + | sort -u \ + >> $conffile + + echo 'INSTALL_DIR ?= "@INSTALL_DIR@" ;' >> $conffile + + # a junk from autoheader + rm -f "edeconf.h.in~" + + echo "" + echo "Now run ./configure [OPTIONS]" + echo "or './configure --help' to see them" +else + echo "" + echo "We failed :(. There should be some output, right ?" + exit 1 +fi diff --git a/tools/ede.spec.in b/tools/ede.spec.in new file mode 100644 index 0000000..1abc64f --- /dev/null +++ b/tools/ede.spec.in @@ -0,0 +1,76 @@ +# +# $Id$ +# +# Part of Equinox Desktop Environment (EDE). +# Copyright (c) 2000-2006 EDE Authors. +# +# This program is licenced under terms of the +# GNU General Public Licence version 2 or newer. +# See COPYING for details. + + +# Note that this is NOT a relocatable package +# rpm -bb ede.spec ; /usr/src/RPM/SPECS + +%define name ede +%define ver @EDE_VERSION@ +%define rel 1 +%define localstatedir /var/lib +%define pakdir %{name}-%{ver} + +Summary: The core programs for the Equinox Desktop Environment. +Name: %{name} +Version: %ver +Release: %rel +Copyright: GPL +Group: X11/EDE/Base +Source: %{name}-%{ver}.tar.gz +BuildRoot: /var/tmp/%{name}-%{version}-root +URL: http://sourceforge.net/projects/ede +Prereq: /sbin/install-info +Requires: efltk-devel >= 2.0.4 + +%description +Equinox Desktop Environment (EDE) is desktop environment - the piece of +software that enables you to launch applications in a convenient way, +show what windows you have opened, manages icons and background of your +desktop, etc. This core package provides panel with tasklist, clock, +load status; icon manager that take care of your icons on background, +control panel for easy access to your settings, helpbook for reading +documentation, color configuration, panel configuration, display configuration +utility, menu editor, icons configuration, tips, time/date and timezone +configuration, fast file search tool and of course window manager that manages +your windows with config utility. + +%prep +%setup -q -n %{pakdir} + +%build + +./build.gcc --prefix=%{_prefix} + +%install +[ -n "$RPM_BUILD_ROOT" -a "$RPM_BUILD_ROOT" != / ] && rm -rf $RPM_BUILD_ROOT + +make prefix=$RPM_BUILD_ROOT%{_prefix} install + +%clean +[ -n "$RPM_BUILD_ROOT" -a "$RPM_BUILD_ROOT" != / ] && rm -rf $RPM_BUILD_ROOT + +%post +#/sbin/ldconfig + +%postun +#/sbin/ldconfig + +%files +%doc AUTHORS COPYING ChangeLog NEWS README +%defattr (-, root, root) +%{_bindir}/* +#%{_sysconfdir}/ +%{_datadir}/locale/*/*/* +%{_datadir}/ede/* +%{_datadir}/ede/.ede/* + +%changelog + diff --git a/tools/l10n-prepare.pl b/tools/l10n-prepare.pl new file mode 100644 index 0000000..076a0e2 --- /dev/null +++ b/tools/l10n-prepare.pl @@ -0,0 +1,53 @@ +#!/usr/bin/perl + +# This Perl script prepares files for translations. +# Extracts strings from code, copies into l10n/ directory and +# creates convinient .tar.gz packages for languages. +# Copyright (c) Vedran Ljubovic 2005. +# This program is licensed under terms of GNU General Public +# License v2 or greater. + + +@directories = ("common", "ecolorconf", "econtrol", "edewm", +"edisplayconf", "efinder","eiconman", "eiconsconf", "einstaller", +"ekeyconf", "elauncher", "emenueditor", "epanelconf", "esvrconf", +"etimedate", "etip", "evolume", "ewmconf", "eworkpanel"); + + +foreach $dir (@directories) { + print "Extracting $dir...\n"; + + # Extract new strings from code + $command = "xgettext -o $dir/locale/messages.pot --keyword=\_ $dir/*.cpp $dir/*.h"; + `$command`; +} + + +print "Copying files...\n"; +while ($nextname = <*/locale/*.po>) { + if ($nextname =~ /(.*?)\/locale\/(.*?)\.po/) { + $dest = "l10n/$2/$1".".po"; + `mkdir l10n/$2 &>/dev/null`; + `cp -f $nextname $dest`; + } else { + print "Error: $nextname\n"; + } +} + +`mkdir l10n/nontranslated &>/dev/null`; +while ($nextname = <*/locale/messages.pot>) { + if ($nextname =~ /(.*?)\/locale\/messages.pot/) { + $dest = "l10n/nontranslated/$1".".pot"; + `cp -f $nextname $dest`; + } else { + print "Error: $nextname\n"; + } +} + +while ($nextname = ) { + if ((-d $nextname) && ($nextname =~ /l10n\/(.*?)$/)) { + print "Creating package for $1...\n"; + `tar czvf l10n/$1.tar.gz l10n/$1`; + } +} + diff --git a/vedran.plan b/vedran.plan new file mode 100644 index 0000000..783ae14 --- /dev/null +++ b/vedran.plan @@ -0,0 +1,77 @@ +Here is my personal plan for things to do in EDE2, starting 30.08.2006. I can't guarantee about the +order but roughly it will be as in this file. + +* fltk2 + [ ] report all found bugs to fltk2.org + [ ] prepare repositories, scipts etc. for fltk-copy +* efiler + [ ] d&d support in FileBrowser + [ ] popup (right-click) menu + [ ] add .desktop file handling + [ ] move icon view into class IconBrowser with similar API to FileBrowser + [ ] add file properties dialog + [ ] add preferences dialog for efiler, save preferences into conf file + [ ] create edelib2 class for parsing command line + [ ] lots of testing + [ ] move FileBrowser and DirTree to edelib2 + [ ] replace econtrol with efiler window (with possibly own conf) +* elauncher + [ ] port to use our new MimeType system +* edelib2/about_dialog + [ ] redesign (similar to about dialog in eworkpanel) + [ ] make into a class that inherits fltk::Window +* efinder + [ ] port to new FileBrowser class +* edelib2/theme + [ ] theme handler (for now, compatible with old efltk.conf file) +* eiconman + [ ] rewrite using efiler/IconBrowser as template + [ ] add freedesktop.org compliant handler for removable devices (using HAL) +* edelib2 + [ ] make a class for setting window manager icons for windows + [ ] create icons for all EDE programs +=== release EDE2 alpha (unless Sanel objects ;) ) === +* edelib2 + [ ] new ask.h class with planned improvements + [ ] new filechooser and dirchooser using our new classes from efiler +* edialog + [ ] port to new classes (above) and complete missing features +* edelib2/Sound class + [ ] from Sanels edewm branch +* edelib2/Icon + [ ] add icon resizing from smaller/larger sizes + [ ] add support for non-themed icons (e.g. X-Chat icon) + [ ] create a generic wrapper around icon themes + [ ] create "The EDE Icon Theme" (using old icons) and use it as default + [ ] further test with Gnome icon themes + [ ] make Tango-project icons work with EDE :) +* edelib2/IconGroup etc. + [ ] create PackedGroup (auto-resizing-wordwrapping) and use it for IconBrowser + [ ] create IconBrowser and use it in eiconman +* evolume + [ ] port to libao (since we will depend on it anyway) +* edewm + - give Sanel time to do whatever he wants +* eworkpanel + [ ] move applets into separate compilable subdirs and port core to fltk + [ ] fix taskbar once and for all + [ ] make a real desktop browser (like Gnome) + [ ] create something like taskbar but shows miniature pictures of windows + [ ] make panel resizable, movable + [ ] add support for XDG menus +* epanelconf + [ ] rewrite, make more interactive +* edelib2/Config + [ ] probably a complete rewrite (not sure right now) + [ ] create new directory structure + [ ] write a small utility for migrating old config to new +* etheme & ebehavior - two new apps to replace e*conf +* enotepad - use fltk2/test/editor and add selected features +* ehardcenter - for now just system info +* edelib2/MimeTypes and the rest + [ ] separate programs from mimetypes + [ ] create eprograms - tool to choose favourite apps + [ ] add proper "Open with..." dialog to efiler and elauncher +=== release EDE2 beta1 === +=== poll users for new features and apps === +