commit 14286a0eb6ec163c90e3d13c27fea147dbb82481 Author: Slávek Banko Date: Fri Jul 5 19:06:59 2013 +0200 Initial import diff --git a/AUTHORS b/AUTHORS new file mode 100644 index 0000000..7fc6cff --- /dev/null +++ b/AUTHORS @@ -0,0 +1,2 @@ +Girish Ramakrishnan (ramakrishnan.girish@gmail.com) + diff --git a/BUGS b/BUGS new file mode 100644 index 0000000..98f495d --- /dev/null +++ b/BUGS @@ -0,0 +1,29 @@ +Known issues +------------ +1. Error messages are not transmitted from the previous instance of KDocker to +the latest instance. So, if you already have KDocker running and you start +another instance of KDocker saying "kdocker blah", you wont receive any error +message. + +2. Problem with relative paths if new instance of KDocker and old instance of +KDocker are started from different directories (the current directory +information is not transmitted across instances) + +Reporting Bugs +-------------- +Bugs and wishes to gramakri at uiuc dot edu. Follow the guidelines below , if +possible and send it to me at gramakri at uiuc dot edu. + +* Add the following line in kdocker.pro (in fact just uncomment it) + DEFINES += ENABLE_TRACING +* Now do a "make clean" and "then make". +* Launch KDocker. Recreate the problem. +- Right Click on the tray icon. +- Choose "About KDocker" +- You should see a button called "Show Trace". Please note that this button + will appear only when compiled with tracing +- If you send SIGUSR1 to the KDocker process, it will dump all the trace to + ~/kdocker.trace. Send that file to me. + +May the force be with you. + diff --git a/COPYING b/COPYING new file mode 100644 index 0000000..d60c31a --- /dev/null +++ b/COPYING @@ -0,0 +1,340 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 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 + + 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) + + 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 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) year 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/CREDITS b/CREDITS new file mode 100644 index 0000000..cb65a35 --- /dev/null +++ b/CREDITS @@ -0,0 +1,27 @@ +KDocker code by Girish Ramakrishnan (gramakri at uiuc dot edu) + +The wonderful KDocker Icon is artwork of Marcel Dierkes (marcel dot dierkes at gmx dot de) + +Translations +------------ +Spanish translations by Edulix (edulix at tumundoweb dot com) +French translations by Al (altrash at altern &dot& org) +Czech translations by Jiri Hofman (jiri dot hofman # a.t # tut*fi) +Russian translations by Aleksey Kirpichnikov (coder *at* paco dot net) +Brazilian Portugese by Paulo Ruthes (paulo.ruthes $at$ $uol$ com dot br) +German translations by Thomas Runge (thomas dot r3 at gmx dot de) +Polish translation by KonMan (dedalus !at o2 dot pl) +Indonesian translation by Eko Prasetiyo (e hiphen prast at spymac dot com) +Italian translations by Alessio Cassibba (swapon at gmail dot com) +Bulgarian translations by Petar Toushkov (peter dot toushkov at mail dot. bg) +Japanese translations by Masaaki Kanno (hanoura at gmail dot com) +Dutch translations by Jay Kamminga (jay hyphen kamminga at home dot nl) +Hungarian translation by Nyitrai Sianis Istvan (siani at gmail dot com) +Swedish translation by Daniel Nylander (po at danielnylander dot se) + +Packages (visit website for links) +---------------------------------- +Suse 9.1, 9.2, 9.3, 10.0 - By Toni (oc2pus att arcor dott de) +Slackware - By Mr Souissi (zhss att online dott fr) +Debian - By Mr Souissi + diff --git a/ChangeLog b/ChangeLog new file mode 100644 index 0000000..22c925f --- /dev/null +++ b/ChangeLog @@ -0,0 +1,93 @@ +for version 1.4 + - Bulgarian translations from Petar Toushkov + - Japanese translations from Kanno Masaaki + - Hungarian translations from Nyitrai \"Sianis\" István + - Dutch translations from Jay Kamminga + - Dock when focus lost + +for version 1.3 + - Fix bug when reading back balloon timeout on session restoration + - AutoLaunch enhancement (Request user to provide program name when + autodetection failed) + - Indonesian translations from Eko Prasetiyo + - Italian translations from Alessio Cassibba + - Updated Brazilian Portuguese and polish translations + +for version 1.2 + - Polish translations from KonMan + - Check WM_NAME to support programs like LimeWire (for lavacube) + - Store entire application path as part of session + - Move around command line handling code + - Configure balloon timeout using "-p" (for roopesh) + +for version 1.1 + - German translations from Thomas Runge + - Dialog detection bug. I replaced all LOG with TRACE (Thanks to Novoselic + who raised a question which helped me notice it) + - -v Displays the version + - -b Suppress the warning when docking non-normal dialogs + (For John Pettigrew) + - Fix issue when passing large command line to previous instance + (Reported by Arseniy Akopyan) + +for version 1.0 CR1 + - Russian translations by Aleksey Kirpichnikov + - Brazilian Portugese translations by Paulo Ruthes + +for version 1.0 + - Spanish translations are back in (Thanks Edulix) + - Yet another fix for xmms + +for version 1.0 rc2 + - "make install" support (with QMake) + - Multiple desktop awareness (for Sharon) + - Icons from Marcel Dierkes + - Use XDND type mechanism to pass arguments to previous instance + - Spanish translations are out. + - Czech translations by Jiri Hofman + - Drag and drop support for Antonio C. Censi + - Xmms+PlayList fix (for KDE) + +for version 1.0 rc1 + - Session Management support (XSMP) for KDE and GNOME + - AutoLaunch application support that do not support Session Management + - Wait until system tray comes up on session restoration (Requested by + Normen) + - Fix GNOME docked icon resize issue + - Track tray label appearance and disappearance handling + - Major code refactoring. QTrayLabel is now a very reusable class + +for version 0.9 + - Support to dock the active window (useful with keyboard shortcuts) -f + Was requested by Daniel + - Small security fix + - ToolTip positioning issue (reported by Alex) + - CLI Support to disabling ballooning of title changes. -q (requested by + Marcel Dierkes) + - French Translations (Thanks to Al) + +for version 0.8 + - Custom Icons. Accessible through menu or CLI + - Fixes for KDE (ObscureEvent, BringToFront, SkippingTaskbar) + - Code refactoring + - Changes to have only a single instance of KDocker running all the time! + +for version 0.7 + - Use WM_COMMAND to identify windows + - Warn when attemping to dock non-normal windows + - Issue with tool tips fixed + +for version 0.6 + - Start up applications + - CLI support + - Spanish Translation and i18n support + +for version 0.5 + - Support to remember the position + - Support to close application + - Support to remove application from the task bar + +for version 0.4 + - Add dock on obscure + - Add dock on minimise + diff --git a/HACKING b/HACKING new file mode 100644 index 0000000..4bcc452 --- /dev/null +++ b/HACKING @@ -0,0 +1,63 @@ +Words of wisdom + +1. Make sure all changed work on both KDE and Gnome + +2. The System tray protocol specification can be found at + http://freedesktop.org/Standards/systemtray-spec/systemtray-spec-0.1.html + +3. The KDE System tray Docking Protocol can be found at + http://developer.kde.org/documentation/library/kdeqt/kde3arch/protocols-docking.html + +4. The site i use for Xlib reference + http://tronche.com/gui/x/xlib/function-index.html + +5. Qt Documentation at http://doc.trolltech.com + +6. There's do or no do. There's no try. + +KDocker Window Docking Strategy and a little bit of history +----------------------------------------------------------- +Couple of things that will help you if you are looking through the code. +I wanted a single instance of KDocker to be running all the time. So, +whenever a new instance of KDocker was created it would ask the previous +instance take over. + +Two things to know about +1. Mapping from the PID (process id) to WID (window id) +2. How to let the previous instance know about app_to_launch + +Lets deal with them one by one. +1. PID to WID mapping is easy if people followed rules. Just read _NET_WM_PID +for a window. If it matches the one app's PID we just created, that window is +the one we want to dock. Its not as simple as that. Programs have "splash" +screens. A nice thing is that these "splash" screen have the _WM_TRANSIENT_FOR +property set. So, we can skip those windows. There are these bunch of programs +(like gaim, xmms) that create windows and dont put this property on them. Arrgh. +What we do to counter these applications is to look for interesting windows +possibly created by the process until the process dies. Have a look at the code +for a better understanding. + +2. Sending ClientMessages to previous instances with the program name and +arguments is painful and makes the code more complex. Before 1.0, I used to dump +all the program arguments in ~/kdocker. and send the pid in a +ClientMessage. The file is then deleted after processing. As of 1.0, I set a +property _KDOCKER_ on the KDocker initial instance's window which holds +the program arguments. (The correct way to transfer information is using +XSelections) + +TRACING +------- +Add the following line in kdocker.pro (in fact just uncomment it) +DEFINES += ENABLE_TRACING + +Now do a "make clean" and "then make". + +Launch KDocker. Try recreating the problem. +- Right Click on the tray icon. +- Choose "About KDocker" +- You should see a button called "Show Trace". Please note that this button + will appear only when compiled with tracing +- Try debugging yourself or send it to me +- If you send SIGUSR1 to the KDocker process, it will dump all the trace to + ~/kdocker.trace + diff --git a/INSTALL b/INSTALL new file mode 100644 index 0000000..5fccefc --- /dev/null +++ b/INSTALL @@ -0,0 +1,19 @@ +Prerequisites +1. Make sure you have Qt installed and working. If you dont know what Qt is, +you must be out from a cave just now. You will need qmake to compile. + +Building +1. edit kdocker.pro as necessary. you should be ready to go with no change. +2. qmake +3. make +4. run "make install" (optional) +5. if you did not do a "make install" make sure kdocker is in your $PATH. This + is required for session management to work. +6. While making shortcuts, use the icons in /usr/local/share/kdocker/icons or + the ones in /icons in the tar ball. + +Please see README for tips and general information + +IMPORTANT: Kill all previous instances of KDocker that are running before trying +out this version + diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..56b9d46 --- /dev/null +++ b/Makefile @@ -0,0 +1,289 @@ +############################################################################# +# Makefile for building: kdocker +# Generated by qmake (1.07a) (Qt 3.3.3) on: Fri Jun 17 19:36:22 2005 +# Project: kdocker.pro +# Template: app +# Command: $(QMAKE) -o Makefile kdocker.pro +############################################################################# + +####### Compiler, tools and options + +CC = gcc +CXX = g++ +LEX = flex +YACC = yacc +CFLAGS = -pipe -Wall -W -O2 -g -pipe -m32 -march=i386 -mtune=pentium4 -DTRANSLATIONS_PATH='"/usr/local/share/kdocker/i18n"' -DICONS_PATH='"/usr/local/share/kdocker/icons"' -DQT_NO_DEBUG -DQT_SHARED -DQT_THREAD_SUPPORT +CXXFLAGS = -pipe -Wall -W -O2 -g -pipe -m32 -march=i386 -mtune=pentium4 -DTRANSLATIONS_PATH='"/usr/local/share/kdocker/i18n"' -DICONS_PATH='"/usr/local/share/kdocker/icons"' -DQT_NO_DEBUG -DQT_SHARED -DQT_THREAD_SUPPORT +LEXFLAGS = +YACCFLAGS= -d +INCPATH = -I/usr/lib/qt-3.3/mkspecs/default -I. -I. -Isrc -I/usr/X11R6/include/X11 -I/usr/include/X11R6 -I$(QTDIR)/include -Itmp/ +LINK = g++ +LFLAGS = +LIBS = $(SUBLIBS) -L/usr/X11/lib -L/usr/X11R6/lib -L$(QTDIR)/lib -L/usr/X11R6/lib -lXpm -lXmu -lqt-mt -lXext -lX11 -lm +AR = ar cqs +RANLIB = +MOC = $(QTDIR)/bin/moc +UIC = $(QTDIR)/bin/uic +QMAKE = qmake +TAR = tar -cf +GZIP = gzip -9f +COPY = cp -f +COPY_FILE= $(COPY) +COPY_DIR = $(COPY) -r +INSTALL_FILE= $(COPY_FILE) +INSTALL_DIR = $(COPY_DIR) +DEL_FILE = rm -f +SYMLINK = ln -sf +DEL_DIR = rmdir +MOVE = mv -f +CHK_DIR_EXISTS= test -d +MKDIR = mkdir -p + +####### Output directory + +OBJECTS_DIR = tmp/ + +####### Files + +HEADERS = src/customtraylabel.h \ + src/kdocker.h \ + src/qtraylabel.h \ + src/trace.h \ + src/traylabelmgr.h \ + src/util.h +SOURCES = src/customtraylabel.cpp \ + src/kdocker.cpp \ + src/main.cpp \ + src/qtraylabel.cpp \ + src/trace.cpp \ + src/traylabelmgr.cpp \ + src/util.cpp +OBJECTS = tmp/customtraylabel.o \ + tmp/kdocker.o \ + tmp/main.o \ + tmp/qtraylabel.o \ + tmp/trace.o \ + tmp/traylabelmgr.o \ + tmp/util.o +FORMS = +UICDECLS = +UICIMPLS = +SRCMOC = tmp/moc_customtraylabel.cpp \ + tmp/moc_kdocker.cpp \ + tmp/moc_qtraylabel.cpp \ + tmp/moc_traylabelmgr.cpp +OBJMOC = tmp/moc_customtraylabel.o \ + tmp/moc_kdocker.o \ + tmp/moc_qtraylabel.o \ + tmp/moc_traylabelmgr.o +DIST = kdocker.pro +QMAKE_TARGET = kdocker +DESTDIR = +TARGET = kdocker + +first: all +####### Implicit rules + +.SUFFIXES: .c .o .cpp .cc .cxx .C + +.cpp.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.cc.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.cxx.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.C.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.c.o: + $(CC) -c $(CFLAGS) $(INCPATH) -o $@ $< + +####### Build rules + +all: Makefile $(TARGET) + +$(TARGET): $(UICDECLS) $(OBJECTS) $(OBJMOC) + $(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJMOC) $(OBJCOMP) $(LIBS) + +mocables: $(SRCMOC) +uicables: $(UICDECLS) $(UICIMPLS) + +$(MOC): + ( cd $(QTDIR)/src/moc && $(MAKE) ) + +Makefile: kdocker.pro /usr/lib/qt-3.3/mkspecs/default/qmake.conf /usr/lib/qt-3.3/lib/libqt-mt.prl + $(QMAKE) -o Makefile kdocker.pro +qmake: + @$(QMAKE) -o Makefile kdocker.pro + +dist: + @mkdir -p tmp/kdocker && $(COPY_FILE) --parents $(SOURCES) $(HEADERS) $(FORMS) $(DIST) tmp/kdocker/ && $(COPY_FILE) --parents i18n/kdocker_en.ts i18n/kdocker_es.ts i18n/kdocker_fr.ts i18n/kdocker_cs.ts i18n/kdocker_ru.ts i18n/kdocker_pt_BR.ts i18n/kdocker_de.ts i18n/kdocker_pl.ts i18n/kdocker_id.ts i18n/kdocker_it.ts i18n/kdocker_bg.ts tmp/kdocker/ && ( cd `dirname tmp/kdocker` && $(TAR) kdocker.tar kdocker && $(GZIP) kdocker.tar ) && $(MOVE) `dirname tmp/kdocker`/kdocker.tar.gz . && $(DEL_FILE) -r tmp/kdocker + +mocclean: + -$(DEL_FILE) $(OBJMOC) + -$(DEL_FILE) $(SRCMOC) + +uiclean: + +yaccclean: +lexclean: +clean: mocclean + -$(DEL_FILE) $(OBJECTS) + -$(DEL_FILE) *~ core *.core + + +####### Sub-libraries + +distclean: clean + -$(DEL_FILE) $(TARGET) $(TARGET) + + +FORCE: + +####### Compile + +tmp/customtraylabel.o: src/customtraylabel.cpp src/trace.h \ + src/customtraylabel.h \ + src/traylabelmgr.h \ + src/kdocker.h \ + src/qtraylabel.h + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o tmp/customtraylabel.o src/customtraylabel.cpp + +tmp/kdocker.o: src/kdocker.cpp src/trace.h \ + src/traylabelmgr.h \ + src/kdocker.h \ + src/customtraylabel.h \ + src/qtraylabel.h + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o tmp/kdocker.o src/kdocker.cpp + +tmp/main.o: src/main.cpp src/kdocker.h \ + src/traylabelmgr.h \ + src/trace.h \ + src/customtraylabel.h \ + src/qtraylabel.h + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o tmp/main.o src/main.cpp + +tmp/qtraylabel.o: src/qtraylabel.cpp src/trace.h \ + src/qtraylabel.h \ + src/util.h + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o tmp/qtraylabel.o src/qtraylabel.cpp + +tmp/trace.o: src/trace.cpp + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o tmp/trace.o src/trace.cpp + +tmp/traylabelmgr.o: src/traylabelmgr.cpp src/trace.h \ + src/traylabelmgr.h \ + src/util.h \ + src/customtraylabel.h \ + src/qtraylabel.h + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o tmp/traylabelmgr.o src/traylabelmgr.cpp + +tmp/util.o: src/util.cpp src/trace.h \ + src/util.h + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o tmp/util.o src/util.cpp + +tmp/moc_customtraylabel.o: tmp/moc_customtraylabel.cpp src/customtraylabel.h src/qtraylabel.h + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o tmp/moc_customtraylabel.o tmp/moc_customtraylabel.cpp + +tmp/moc_kdocker.o: tmp/moc_kdocker.cpp src/kdocker.h + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o tmp/moc_kdocker.o tmp/moc_kdocker.cpp + +tmp/moc_qtraylabel.o: tmp/moc_qtraylabel.cpp src/qtraylabel.h + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o tmp/moc_qtraylabel.o tmp/moc_qtraylabel.cpp + +tmp/moc_traylabelmgr.o: tmp/moc_traylabelmgr.cpp src/traylabelmgr.h src/customtraylabel.h \ + src/qtraylabel.h + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o tmp/moc_traylabelmgr.o tmp/moc_traylabelmgr.cpp + +tmp/moc_customtraylabel.cpp: $(MOC) src/customtraylabel.h + $(MOC) src/customtraylabel.h -o tmp/moc_customtraylabel.cpp + +tmp/moc_kdocker.cpp: $(MOC) src/kdocker.h + $(MOC) src/kdocker.h -o tmp/moc_kdocker.cpp + +tmp/moc_qtraylabel.cpp: $(MOC) src/qtraylabel.h + $(MOC) src/qtraylabel.h -o tmp/moc_qtraylabel.cpp + +tmp/moc_traylabelmgr.cpp: $(MOC) src/traylabelmgr.h + $(MOC) src/traylabelmgr.h -o tmp/moc_traylabelmgr.cpp + +####### Install + +install_target: all + @$(CHK_DIR_EXISTS) "$(INSTALL_ROOT)/usr/local/bin/" || $(MKDIR) "$(INSTALL_ROOT)/usr/local/bin/" + -$(INSTALL_FILE) "$(QMAKE_TARGET)" "$(INSTALL_ROOT)/usr/local/bin/$(QMAKE_TARGET)" + +uninstall_target: + -$(DEL_FILE) "$(INSTALL_ROOT)/usr/local/bin/$(QMAKE_TARGET)" + -$(DEL_DIR) "$(INSTALL_ROOT)/usr/local/bin/" + + +install_icons: all + @$(CHK_DIR_EXISTS) "$(INSTALL_ROOT)/usr/local/share/kdocker/icons/" || $(MKDIR) "$(INSTALL_ROOT)/usr/local/share/kdocker/icons/" + -$(INSTALL_FILE) "icons/kdocker.png" "$(INSTALL_ROOT)/usr/local/share/kdocker/icons/" + -$(INSTALL_FILE) "icons/question.png" "$(INSTALL_ROOT)/usr/local/share/kdocker/icons/" + + +uninstall_icons: + -$(DEL_FILE) -r "$(INSTALL_ROOT)/usr/local/share/kdocker/icons/kdocker.png" + -$(DEL_FILE) -r "$(INSTALL_ROOT)/usr/local/share/kdocker/icons/question.png" + -$(DEL_DIR) "$(INSTALL_ROOT)/usr/local/share/kdocker/icons/" + + +install_docs: all + @$(CHK_DIR_EXISTS) "$(INSTALL_ROOT)/usr/local/share/kdocker/docs/" || $(MKDIR) "$(INSTALL_ROOT)/usr/local/share/kdocker/docs/" + -$(INSTALL_FILE) "README" "$(INSTALL_ROOT)/usr/local/share/kdocker/docs/" + + +uninstall_docs: + -$(DEL_FILE) -r "$(INSTALL_ROOT)/usr/local/share/kdocker/docs/README" + -$(DEL_DIR) "$(INSTALL_ROOT)/usr/local/share/kdocker/docs/" + + +install_translations: all + @$(CHK_DIR_EXISTS) "$(INSTALL_ROOT)/usr/local/share/kdocker/i18n/" || $(MKDIR) "$(INSTALL_ROOT)/usr/local/share/kdocker/i18n/" + -$(INSTALL_FILE) "i18n/kdocker_bg.qm" "$(INSTALL_ROOT)/usr/local/share/kdocker/i18n/" + -$(INSTALL_FILE) "i18n/kdocker_cs.qm" "$(INSTALL_ROOT)/usr/local/share/kdocker/i18n/" + -$(INSTALL_FILE) "i18n/kdocker_de.qm" "$(INSTALL_ROOT)/usr/local/share/kdocker/i18n/" + -$(INSTALL_FILE) "i18n/kdocker_en.qm" "$(INSTALL_ROOT)/usr/local/share/kdocker/i18n/" + -$(INSTALL_FILE) "i18n/kdocker_es.qm" "$(INSTALL_ROOT)/usr/local/share/kdocker/i18n/" + -$(INSTALL_FILE) "i18n/kdocker_fr.qm" "$(INSTALL_ROOT)/usr/local/share/kdocker/i18n/" + -$(INSTALL_FILE) "i18n/kdocker_id.qm" "$(INSTALL_ROOT)/usr/local/share/kdocker/i18n/" + -$(INSTALL_FILE) "i18n/kdocker_it.qm" "$(INSTALL_ROOT)/usr/local/share/kdocker/i18n/" + -$(INSTALL_FILE) "i18n/kdocker_pl.qm" "$(INSTALL_ROOT)/usr/local/share/kdocker/i18n/" + -$(INSTALL_FILE) "i18n/kdocker_pt_BR.qm" "$(INSTALL_ROOT)/usr/local/share/kdocker/i18n/" + -$(INSTALL_FILE) "i18n/kdocker_ru.qm" "$(INSTALL_ROOT)/usr/local/share/kdocker/i18n/" + + +uninstall_translations: + -$(DEL_FILE) -r "$(INSTALL_ROOT)/usr/local/share/kdocker/i18n/kdocker_bg.qm" + -$(DEL_FILE) -r "$(INSTALL_ROOT)/usr/local/share/kdocker/i18n/kdocker_cs.qm" + -$(DEL_FILE) -r "$(INSTALL_ROOT)/usr/local/share/kdocker/i18n/kdocker_de.qm" + -$(DEL_FILE) -r "$(INSTALL_ROOT)/usr/local/share/kdocker/i18n/kdocker_en.qm" + -$(DEL_FILE) -r "$(INSTALL_ROOT)/usr/local/share/kdocker/i18n/kdocker_es.qm" + -$(DEL_FILE) -r "$(INSTALL_ROOT)/usr/local/share/kdocker/i18n/kdocker_fr.qm" + -$(DEL_FILE) -r "$(INSTALL_ROOT)/usr/local/share/kdocker/i18n/kdocker_id.qm" + -$(DEL_FILE) -r "$(INSTALL_ROOT)/usr/local/share/kdocker/i18n/kdocker_it.qm" + -$(DEL_FILE) -r "$(INSTALL_ROOT)/usr/local/share/kdocker/i18n/kdocker_pl.qm" + -$(DEL_FILE) -r "$(INSTALL_ROOT)/usr/local/share/kdocker/i18n/kdocker_pt_BR.qm" + -$(DEL_FILE) -r "$(INSTALL_ROOT)/usr/local/share/kdocker/i18n/kdocker_ru.qm" + -$(DEL_DIR) "$(INSTALL_ROOT)/usr/local/share/kdocker/i18n/" + + +install_desktop: all + @$(CHK_DIR_EXISTS) "$(INSTALL_ROOT)/usr/share/applications/" || $(MKDIR) "$(INSTALL_ROOT)/usr/share/applications/" + -$(INSTALL_FILE) "kdocker.desktop" "$(INSTALL_ROOT)/usr/share/applications/" + + +uninstall_desktop: + -$(DEL_FILE) -r "$(INSTALL_ROOT)/usr/share/applications/kdocker.desktop" + -$(DEL_DIR) "$(INSTALL_ROOT)/usr/share/applications/" + + +install: install_target install_icons install_docs install_translations install_desktop + +uninstall: uninstall_target uninstall_icons uninstall_docs uninstall_translations uninstall_desktop + diff --git a/README b/README new file mode 100644 index 0000000..cd93d69 --- /dev/null +++ b/README @@ -0,0 +1,120 @@ +KDocker +------- +KDocker will help you dock any application in the system tray. This means you +can dock openoffice, xmms, firefox, thunderbolt, eclipse, anything! Just point +and click. Works for both KDE and GNOME (In fact it should work for most modern +window managers that support NET WM Specification. I believe it works for XFCE, +for instance) + +All you need to do is start KDocker and select an application using the mouse +and lo! the application gets docked into the system tray. The application can +also be made to dissappear from the task bar. + +System Tray Support +------------------- +KDocker supports the KDE System Tray Protocol and the System Tray Protocol from +freedesktop.org + +Tips to use KDocker +------------------- +1. On KDE, right click on K menu and use the menu editor to create a link of +KDocker and create a shortcut (Windows key + Z). You could use the kdocker.xpm +in the src folder as the icon (its an anchor). +Rationale: ^Z on the shell puts processes in the background. On the same lines, +Windows+Z will help you put windows app to the background ;) (thanks to Thomas +McGuire for this suggestion) +2. With KDocker 0.9, there is an option to dock the current active window (-f). +As soon as you press WinKey+Z, the window which has the focus will be +automatically docked. Thanks to Daniel for this neat feature request. + +Session Management +------------------ +IMPORTANT: Make sure KDocker is in your $PATH for Session Management to work. I +created a link in /usr/bin to point to kdocker. KDocker will automatically dock +all the programs that you had docked in your previous session when you log on +the next time (provided they were all docked when you logged out). + +When using KDocker in startup scripts, be sure to supply the "-d" switch. +This will disable session management for that kdocker instance. This will +prevent kdocker from docking that application twice (during startup and session +restoration). For the same reason, make sure you use the "-d" switch, when you +undock an application that is in a startup script and then dock it again. + +Few programs do not support session management. For example, thunderbird may not +launch itself automatically after you logout and logon. For such applications +use the "-l" switch (also accessible through the menu as "Launch on startup"). +KDocker will launch thunderbird on session restoration. + +Note that, if you have 4 applications docked using KDocker and you use +Ctrl+Alt+Backspace to logout, nothing will be restored when log back in. (The +shortcut kills the X server and the session is not saved). Hence, it is a good +idea to put the applications that you intend to dock in your starup folder and +use the "-d" switch. + +Its a bit confusing, but I cannot find any easy way to satisfy all +combinations. They say you design for the common case, but for KDocker I do not +know (yet) which will be the common case. I fancy launching stuff from console +but I am not so sure about the rest. + +QTrayLabel +---------- +QTrayLabel is meant to be a reusable class which will help you dock any window. +Have a look. + +i18n/Translations +----------------- +If you see the following, +"Sorry, your locale is not supported. If you are interested in providing +translations for your locale, contact gramakri@uiuc.edu" +it means either +a) KDocker could not find the translation files +b) Translation files for your locale dont exist + +For a), KDocker looks for the translation files in the following paths, +- install.path/i18n +- app.path/i18n +- curdir/i18n + +For b), use linguist to create the translations and provide them to me. Its +really easy. Follow following steps, +1. edit kdocker.pro. Look for TRANSLATIONS. Add your locale in the end. Say, + i18n/kdocker_zz.ts +2. from the kdocker source base, execute "lupdate kdocker.pro" +3. "cd i18n". you should see kdocker_zz.ts. +4. provide the translations - "linguist kdocker_zz.ts" +5. from the kdocker source base, execute "lrelease kdocker.pro" +6. thats it! Now test it. Make sure $LANG=zz (or appropriate). Run kdocker and + make sure all your translations are out there. +7. Ship the .ts file to gramakri@uiuc.edu. (I can generate the .qm file from + the .ts file) + +Reporting Bugs +-------------- +Bugs and wishes to gramakri at uiuc dot edu. Follow the guidelines below , if +possible and send it to me at gramakri at uiuc dot edu. + +* Add the following line in kdocker.pro (in fact just uncomment it) + DEFINES += ENABLE_TRACING +* Now do a "make clean" and "then make". +* Launch KDocker. Recreate the problem. +- Right Click on the tray icon. +- Choose "About KDocker" +- You should see a button called "Show Trace". Please note that this button + will appear only when compiled with tracing +- Try debugging yourself or send it to me +- If you send SIGUSR1 to the KDocker process, it will dump all the trace to + ~/kdocker.trace + +Send me a postcard! +------------------- +If you love KDocker and would like to thank me, send me a postcard or some +stamps to + +Girish Ramakrishnan +G7, Block No.12, R.K.Apartments, +Hoysala Nagar, +Bangalore, +Karnataka, India + +http:://kdocker.sourceforge.net for updates + diff --git a/TODO b/TODO new file mode 100644 index 0000000..3a1ec4f --- /dev/null +++ b/TODO @@ -0,0 +1,9 @@ +Bugs and wishes to gramakri at uiuc dot edu + +1. Dock on close (Reparent window/QXEmbed) + Status: Doesnt work well with decoration-less windows. Even if I hide the + decoration, the user can click "x" on child and exit (Think of xmms). + +2. Tamil translation + Status: Still searching for a transliterated tamil input + diff --git a/VERSION b/VERSION new file mode 100644 index 0000000..c068b24 --- /dev/null +++ b/VERSION @@ -0,0 +1 @@ +1.4 diff --git a/i18n/kdocker_bg.qm b/i18n/kdocker_bg.qm new file mode 100644 index 0000000..7b5f46e Binary files /dev/null and b/i18n/kdocker_bg.qm differ diff --git a/i18n/kdocker_bg.ts b/i18n/kdocker_bg.ts new file mode 100644 index 0000000..bd2b621 --- /dev/null +++ b/i18n/kdocker_bg.ts @@ -0,0 +1,272 @@ + + + CustomTrayLabel + + Dock when session restored + Възстановяване при нова сесия + + + Launch on startup + Зареждане със стартирането на системата + + + Set Icon + Задаване икона + + + Set balloon timeout + Колко дълго се задържа подсказката + + + Dock when obscured + Прибиране при пълно закриване + + + Dock when minimized + Прибиране при минимизиране + + + Skip taskbar + Прескачане на лентата със задачите + + + About KDocker + За KDocker + + + Options + Настройки + + + Dock Another + Прибиране на друг прозорец + + + Undock All + Извеждане от системния трей (всички) + + + Undock + Извеждане от системния трей + + + Close + Изход + + + KDocker + KDocker + + + %1 is not a valid icon + %1 не е валидна икона + + + Enter balloon timeout (secs). 0 to disable ballooning + Въвеждане продължителност на подсказката (секунди). 0 за изключване + + + "%1" is not a valid executable or was not found in your $PATH + "%1" не е валиден изпълнителен файл или не е намерен в $PATH + + + Select program + Избиране програма + + + Cancel + Отказ + + + Show %1 + Показване на %1 + + + Hide %1 + Скриване на %1 + + + You cannot drop an item into the tray icon. Drop it on the window +that is brought in front when you hover the item over the tray icon + Не можете да пускате обекти направо върху иконата, но можете да +го направите в прозореца, който се появява след като задържите +обекта върху иконата в системния трей + + + Dock when focus lost + + + + + KDocker + + kdocker: invalid option -- %1 + kdocker: невалидна опция -- %1 + + + Usage: KDocker [options] command + + Употреба: KDocker [опции] команда + + + + Docks any application into the system tray + + Прибира всяко дадено приложение в системния трей + + + + command Command to execute + + командаКоманда, който искате да изпълните + + + + Options + Опции + + + -a Show author information + -a Показване на информация за автора + + + -b Dont warn about non-normal windows (blind mode) + -b Без предупреждение за абнормални прозорци (сляп режим) + + + -d Disable session management + -d Изключване управление на сесиите + + + -e Enable session management + -e Включване управление на сесиите + + + -f Dock window that has the focus(active window) + -f Прибиране на текущия (активен) прозорец + + + -h Display this help + -h Покажи помощен екран + + + -i iconCustom dock Icon + -i iconИзбиране на друга икона + + + -l Launch on startup + -l Зареждане със стартирането на системата + + + -m Keep application window mapped (dont hide on dock) + -m Оставяне приложението в лентата със задачите (не се скрива при прибиране) + + + -o Dock when obscured + -o Прибиране при пълно закриване + + + -p secsSet ballooning timeout (popup time) + -p secsУказване времето за изчезване на подсказката + + + -q Disable ballooning title changes (quiet) + -q Изключване на известяването с подсказки (тих режим) + + + -t Remove this application from the task bar + -t Премахване на даденото приложение от лентата със задачите + + + -v Display version + -v Показване на версията + + + -w wid Window id of the application to dock + + -w wid id на прозореца, който прибирате в системния трей + + + NOTE: Use -d for all startup scripts. + + БЕЛЕЖКА: Използвайте -d за всички стартови скриптове. + + + Bugs and wishes to gramakri@uiuc.edu + За бъгове и желания - gramakri@uiuc.edu + + + Project information at http://kdocker.sourceforge.net + Информация за проекта на http://kdocker.sourceforge.net + + + Caught signal %1. Cleaning up. + Засечен е сигнал %1. Почистване. + + + + TrayLabelMgr + + About KDocker + За KDocker + + + Bugs/wishes to Girish Ramakrishnan (gramakri@uiuc.edu) +English translation by Girish (gramakri@uiuc.edu) + +http://kdocker.sourceforge.net for updates + Бъгове/Желания - Girish Ramakrishnan (gramakri@uiuc.edu) +Български превод - Петър Тушков (peter.toushkov@mail.bg) + +За обновления - http://kdocker.sourceforge.net + + + KDocker + KDocker + + + Girish Ramakrishnan (gramakri@uiuc.edu) + Girish Ramakrishnan (gramakri@uiuc.edu) + + + Select the application/window to dock with button1. + Използвайте button1, за да приберете желаното приложение/прозорец. + + + Click any other button to abort + + Всеки друг бутон отменя + + + + The window you are attempting to dock does not seem to be a normal window. + Прозорецът, който се опитвате на приберете, не е нормален. + + + This window is already docked. +Click on system tray icon to toggle docking. + Този прпозорец вече е прибран. Можете +да го управлявате от системния трей. + + + Failed to exec [%1]: %2 + Невъзможност да се изпълни [%1]: %2 + + + Failed to fork: %1 + Failed to fork: %1 + + + The System tray was hidden or removed + Системният трей е скрит или премахнат + + + Undock All + Извеждане от системния трей на всички + + + Ignore + Игнориране + + + diff --git a/i18n/kdocker_cs.qm b/i18n/kdocker_cs.qm new file mode 100644 index 0000000..d208901 Binary files /dev/null and b/i18n/kdocker_cs.qm differ diff --git a/i18n/kdocker_cs.ts b/i18n/kdocker_cs.ts new file mode 100644 index 0000000..c68d773 --- /dev/null +++ b/i18n/kdocker_cs.ts @@ -0,0 +1,276 @@ + + + CustomTrayLabel + + Launch on startup + Spustit při startu + + + Balloon title changes + Balónek při změně názvu + + + Dock when obscured + Dokovat při překrytí + + + Dock when minimized + Dokovat při minimalizaci + + + Skip taskbar + Nepoužívat panel aplikací + + + About KDocker + O aplikaci KDocker + + + Options + Volby + + + + Dock Another + Dokovat jiné okno + + + Undock All + Propustit všechna okna + + + Undock + Propustit + + + Close + Zavřít + + + KDocker + KDocker + + + %1 is not a valid icon + %1 není platné okno + + + Set Icon + Nastavit ikonu + + + Dock when session restored + Dokovat při obnovení sezení + + + Show %1 + Ukázat %1 + + + Hide %1 + Skrýt %1 + + + You cannot drop an item into the tray icon. Drop it on the window +that is brought in front when you hover the item over the tray icon + + + + Set balloon timeout + + + + Enter balloon timeout (secs). 0 to disable ballooning + + + + "%1" is not a valid executable or was not found in your $PATH + + + + Select program + + + + Cancel + + + + Dock when focus lost + + + + + KDocker + + Usage: KDocker [options] command + + Použití: KDocker [volby] příkaz + + + + Docks any application into the system tray + + Dokuje jakoukoli aplikaci do systémové části panelu + + + + command Command to execute + + příkaz Příkaz ke spuštění + + + + Options + Volby + + + -a Show author information + -a Ukáže informace o autorovi + + + -f Dock window that has the focus(active window) + -f Dokuje okno, které je právě aktivní + + + -h Display this help + -h Zobrazí tuto nápovědu + + + -i iconCustom dock Icon + -i ikona Vlastní ikona doku + + + -l Launch on startup + -l Spustit při startu + + + -o Dock when obscured + -o Dokovat při překrytí + + + -q Disable ballooning title changes (quiet) + -q Vypne balónek při změně názvu + + + -t Remove this application from the task bar + -t Odstraní tuto aplikaci z panelu aplikací + + + -w wid Window id of the application to dock + + -w wid ID okna aplikace k dokování + + + + Bugs and wishes to gramakri@uiuc.edu + Chyby a přání posílejte na gramakri@uiuc.edu + + + Project information at http://kdocker.sourceforge.net + Informace o projektu na http://kdocker.sourceforge.net + + + Caught signal %1. Cleaning up. + Zachycen signál %1. Čištění. + + + -d Disable session management + -d Vypne správu sezení + + + -m Keep application window mapped (dont hide on dock) + -m Neskrývat aplikaci při dokování + + + -e Enable session management + -e Zapne správce sezení + + + NOTE: Use -d for all startup scripts. + + Poznámka: Používejte -d pro všechny startovací skripty. + + + + -b Dont warn about non-normal windows (blind mode) + + + + -v Display version + + + + kdocker: invalid option -- %1 + + + + -p secsSet ballooning timeout (popup time) + + + + + TrayLabelMgr + + About KDocker + O aplikaci KDocker + + + KDocker + KDocker + + + Girish Ramakrishnan (gramakri@uiuc.edu) + Girish Ramakrishnan (gramakri@uiuc.edu) + + + This window is already docked. +Click on system tray icon to toggle docking. + Toto ono je už v doku. +Klikněte na ikonu v systémové části panelu k zadokování. + + + Failed to fork: %1 + Nepovedlo se forkovat: %1 + + + The System tray was hidden or removed + Systémová část panelu je skrytá nebo odstraněná + + + Undock All + Propustit všechna okna + + + Ignore + Ignorovat + + + Select the application/window to dock with button1. + Tlačítkem 1 vyberte aplikaci / okno k zadokování. + + + Click any other button to abort + + Zrušte výběr kliknutím na jakékoli jiné tlačítko + + + Failed to exec [%1]: %2 + Nepovedlo se spustit [%1]: %2 + + + Bugs/wishes to Girish Ramakrishnan (gramakri@uiuc.edu) +English translation by Girish (gramakri@uiuc.edu) + +http://kdocker.sourceforge.net for updates + Chyby a přání posílejte Girishovi Ramakrishnanovi (gramakri@uiuc.edu) +Český překlad Jiří Hofman (jiri.hofman#a.t#tut.fi) + +Nové verze na http://kdocker.sourceforge.net + + + The window you are attempting to dock does not seem to be a normal window. + Okno, které se snažíte dokovat, se nezdá býti normálním oknem. + + + diff --git a/i18n/kdocker_de.qm b/i18n/kdocker_de.qm new file mode 100644 index 0000000..db115e5 Binary files /dev/null and b/i18n/kdocker_de.qm differ diff --git a/i18n/kdocker_de.ts b/i18n/kdocker_de.ts new file mode 100644 index 0000000..5b19f93 --- /dev/null +++ b/i18n/kdocker_de.ts @@ -0,0 +1,278 @@ + + + CustomTrayLabel + + Dock when session restored + Andocken, wenn Sitzung wiederhergestellt wird + + + Launch on startup + Autostart + + + Set Icon + Symbol festlegen + + + Balloon title changes + Zeige Titelveränderungen + + + Dock when obscured + Andocken wenn verdeckt + + + Dock when minimized + Andocken wenn minimiert + + + Skip taskbar + Nicht in Fensterleiste anzeigen + + + About KDocker + Über KDocker + + + Options + Einstellungen + + + Dock Another + Docke Weiteres + + + Undock All + Alle Abkoppeln + + + Undock + Abkoppeln + + + Close + Beenden + + + KDocker + KDocker + + + %1 is not a valid icon + %1 ist kein gültiges Symbol + + + Show %1 + Zeige %1 + + + Hide %1 + Verstecke %1 + + + You cannot drop an item into the tray icon. Drop it on the window +that is brought in front when you hover the item over the tray icon + Man kann kein Objekt auf einem Systemleisten-Symbol fallen lassen. +Lassen Sie es in dem Fenster fallen, welches erscheint, wenn Sie +das Objekt über dem Systemleisten-Symbol halten + + + Set balloon timeout + + + + Enter balloon timeout (secs). 0 to disable ballooning + + + + "%1" is not a valid executable or was not found in your $PATH + + + + Select program + + + + Cancel + + + + Dock when focus lost + + + + + KDocker + + Usage: KDocker [options] command + + Verwendung: KDocker [Einstellungen] Befehl + + + + Docks any application into the system tray + + Dockt ein beliebiges Programm in der Systemleiste an + + + + command Command to execute + + Befehl Auszuführender Befehl + + + + Options + Einstellungen + + + -a Show author information + -a Zeigt Autor-Informationen + + + -d Disable session management + -d Deaktiviert Sitzungsverwaltung + + + -e Enable session management + -e Aktiviert Sitzungsverwaltung + + + -f Dock window that has the focus(active window) + -f Dockt das aktive Fenster + + + -h Display this help + -h Zeigt diese Hilfe + + + -i iconCustom dock Icon + -i iconEigenes Dock-Symbol + + + -l Launch on startup + -l Autostart + + + -m Keep application window mapped (dont hide on dock) + -m Zeigt das Programmfenster (nicht durch Docken verstecken) + + + -o Dock when obscured + -o Andocken wenn verdeckt + + + -q Disable ballooning title changes (quiet) + -q Deaktiviert das Anzeigen von Titelveränderungen + + + -t Remove this application from the task bar + -t Entfernt Programm aus der Fensterleiste + + + -w wid Window id of the application to dock + + -w wid Fenster ID des anzudockenden Programmes + + + + NOTE: Use -d for all startup scripts. + + Anmerkung: Benutzen Sie -d für alle Startskripte. + + + + Bugs and wishes to gramakri@uiuc.edu + Fehler und Wünsche an gramakri@uiuc.edu + + + Project information at http://kdocker.sourceforge.net + Projektinformationen auf http://kdocker.sourceforge.net + + + Caught signal %1. Cleaning up. + Empfing Signal %1. Säubern. + + + -b Dont warn about non-normal windows (blind mode) + + + + -v Display version + + + + kdocker: invalid option -- %1 + + + + -p secsSet ballooning timeout (popup time) + + + + + TrayLabelMgr + + About KDocker + Über KDocker + + + Bugs/wishes to Girish Ramakrishnan (gramakri@uiuc.edu) +English translation by Girish (gramakri@uiuc.edu) + +http://kdocker.sourceforge.net for updates + Fehler/Wünsche an Girish Ramakrishnan (gramakri@uiuc.edu) +Deutsche Übersetzungen von Thomas Runge (try87@gmx.de) + +http://kdocker.sourceforge.net für Aktualisierungen + + + KDocker + KDocker + + + Girish Ramakrishnan (gramakri@uiuc.edu) + Girish Ramakrishnan (gramakri@uiuc.edu) + + + Select the application/window to dock with button1. + Wählen Sie das Programm/Fenster, das angedockt werden soll, mit Knopf1. + + + Click any other button to abort + + Klicken Sie einen anderen Knopf zum Abbrechen + + + + The window you are attempting to dock does not seem to be a normal window. + Das Fenster, welches Sie versuchen zu docken, scheint kein normales zu sein. + + + This window is already docked. +Click on system tray icon to toggle docking. + Dieses Fenster ist schon angedockt. +Klicken Sie auf das Systemleisten-Symbol, um den Dockzustand zu verändern. + + + Failed to exec [%1]: %2 + Fehler beim Ausführen von [%1]: %2 + + + Failed to fork: %1 + Fehler beim Abspalten: %1 + + + The System tray was hidden or removed + Die Systemleiste wurde ausgeblendet oder entfernt + + + Undock All + Entkopple Alle + + + Ignore + Ignoriere + + + diff --git a/i18n/kdocker_en.qm b/i18n/kdocker_en.qm new file mode 100644 index 0000000..6bd22c4 Binary files /dev/null and b/i18n/kdocker_en.qm differ diff --git a/i18n/kdocker_en.ts b/i18n/kdocker_en.ts new file mode 100644 index 0000000..9036a16 --- /dev/null +++ b/i18n/kdocker_en.ts @@ -0,0 +1,262 @@ + + + CustomTrayLabel + + Launch on startup + + + + Dock when obscured + + + + Dock when minimized + + + + Skip taskbar + + + + About KDocker + + + + Options + + + + Dock Another + + + + Undock All + + + + Undock + + + + Close + + + + KDocker + + + + %1 is not a valid icon + + + + Set Icon + + + + Dock when session restored + + + + Show %1 + + + + Hide %1 + + + + You cannot drop an item into the tray icon. Drop it on the window +that is brought in front when you hover the item over the tray icon + + + + Set balloon timeout + + + + Enter balloon timeout (secs). 0 to disable ballooning + + + + "%1" is not a valid executable or was not found in your $PATH + + + + Select program + + + + Cancel + + + + Dock when focus lost + + + + + KDocker + + Usage: KDocker [options] command + + + + + Docks any application into the system tray + + + + + command Command to execute + + + + + Options + + + + -a Show author information + + + + -f Dock window that has the focus(active window) + + + + -h Display this help + + + + -i iconCustom dock Icon + + + + -l Launch on startup + + + + -o Dock when obscured + + + + -q Disable ballooning title changes (quiet) + + + + -t Remove this application from the task bar + + + + -w wid Window id of the application to dock + + + + + Bugs and wishes to gramakri@uiuc.edu + + + + Project information at http://kdocker.sourceforge.net + + + + Caught signal %1. Cleaning up. + + + + -d Disable session management + + + + -m Keep application window mapped (dont hide on dock) + + + + -e Enable session management + + + + NOTE: Use -d for all startup scripts. + + + + + -b Dont warn about non-normal windows (blind mode) + + + + -v Display version + + + + kdocker: invalid option -- %1 + + + + -p secsSet ballooning timeout (popup time) + + + + + TrayLabelMgr + + About KDocker + + + + KDocker + + + + Girish Ramakrishnan (gramakri@uiuc.edu) + + + + This window is already docked. +Click on system tray icon to toggle docking. + + + + Failed to fork: %1 + + + + The System tray was hidden or removed + + + + Undock All + + + + Ignore + + + + Select the application/window to dock with button1. + + + + Click any other button to abort + + + + + Failed to exec [%1]: %2 + + + + Bugs/wishes to Girish Ramakrishnan (gramakri@uiuc.edu) +English translation by Girish (gramakri@uiuc.edu) + +http://kdocker.sourceforge.net for updates + + + + The window you are attempting to dock does not seem to be a normal window. + + + + diff --git a/i18n/kdocker_es.qm b/i18n/kdocker_es.qm new file mode 100644 index 0000000..fdf7c72 Binary files /dev/null and b/i18n/kdocker_es.qm differ diff --git a/i18n/kdocker_es.ts b/i18n/kdocker_es.ts new file mode 100644 index 0000000..733528c --- /dev/null +++ b/i18n/kdocker_es.ts @@ -0,0 +1,270 @@ + + + CustomTrayLabel + + Launch on startup + Lanzar al arranque + + + Balloon title changes + Notificar cambios de título + + + Dock when obscured + Iconificar al ocultar + + + Dock when minimized + Iconificar al minimizar + + + Skip taskbar + No mostrar en la barra de tareas + + + About KDocker + Acerca de KDocker + + + Options + Preferencias + + + Dock Another + Iconificar otra ventana + + + Undock All + Liberar todo + + + Undock + Liberar + + + Close + Cerar + + + KDocker + KDocker + + + %1 is not a valid icon + %1 no es un icono válido + + + Set Icon + Cambiar Icono + + + Dock when session restored + Iconificar al restablecer sesión + + + Show %1 + Mostrar %1 + + + Hide %1 + Ocultar %1 + + + You cannot drop an item into the tray icon. Drop it on the window +that is brought in front when you hover the item over the tray icon + No puede soltar un elemento en el icono de la bandeja. Suéltelo sobre la ventana que aparece cuando pasa con el ratón sobre el icono de la bandeja. + + + Set balloon timeout + + + + Enter balloon timeout (secs). 0 to disable ballooning + + + + "%1" is not a valid executable or was not found in your $PATH + + + + Select program + + + + Cancel + + + + Dock when focus lost + + + + + KDocker + + Usage: KDocker [options] command + + Uso: KDocker [opciones] comando + + + Docks any application into the system tray + + Iconifica cualquier aplicación en la bandeja del sistema + + + Options + Preferencias + + + Bugs and wishes to gramakri@uiuc.edu + Enviar reportes de errores y suggerencias/deseos a gramakri@uiuc.edu + + + Project information at http://kdocker.sourceforge.net + Información del proyecto en http://kdocker.sourceforge.net + + + Caught signal %1. Cleaning up. + Se recibió la señal %1. Saliendo. + + + NOTE: Use -d for all startup scripts. + + NOTA: Use -d para todos los scripts de inicio + + + command Command to execute + + comando Comando a ejecutar + + + -a Show author information + -a Muestra información del autor + + + -d Disable session management + -d Deshabilitar el manejo de sesiones + + + -e Enable session management + -e Activar el manejo de sesiones + + + -f Dock window that has the focus(active window) + -f Iconifica la ventana que tenga el foco (ventana activa) + + + -h Display this help + -h Muestra ésta ayuda + + + -i iconCustom dock Icon + -i icon Personaliza el icono a usar + + + -l Launch on startup + -l Lanzar al inicio + + + -m Keep application window mapped (dont hide on dock) + -m No ocultar la ventana de la aplicación al iconificarla + + + -o Dock when obscured + -o Iconificar al ocultar + + + -q Disable ballooning title changes (quiet) + -q Desactivar el informar de cambios de título (silencioso) + + + -t Remove this application from the task bar + -t Eliminar esta aplicación de la barra de tareas + + + -w wid Window id of the application to dock + + -w wid Id de la ventana de la aplicación a iconificar + + + -b Dont warn about non-normal windows (blind mode) + + + + -v Display version + + + + kdocker: invalid option -- %1 + + + + -p secsSet ballooning timeout (popup time) + + + + + TrayLabelMgr + + About KDocker + Acerca de KDocker + + + KDocker + KDocker + + + Girish Ramakrishnan (gramakri@uiuc.edu) + Girish Ramakrishnan (gramakri@uiuc.edu) + + + This window is already docked. +Click on system tray icon to toggle docking. + Ésta ventana ya está iconificada. +Pulse el icono de la la bandeja del sistema para iconificar/mostrar. + + + Failed to fork: %1 + Fallo al intentar el fork: %1 + + + The System tray was hidden or removed + La Bandeja del sistema fue ocultada o eliminada + + + Undock All + Liberar todos + + + Ignore + Ignorar + + + Select the application/window to dock with button1. + Seleccione la aplicación/ventana a iconificar con el botón 1. + + + Click any other button to abort + + Pulse cualquier otro botón para abortar + + + Failed to exec [%1]: %2 + Fallo al ejecutar [%1]: %2 + + + Bugs/wishes to Girish Ramakrishnan (gramakri@uiuc.edu) +English translation by Girish (gramakri@uiuc.edu) + +http://kdocker.sourceforge.net for updates + Enviar reportes de errores y suggerencias/deseos a gramakri@uiuc.edu +Tradución al Español por Eduardo Robles Elvira (edulix@iespana.es) + +http://kdocker.sourceforge.net para actualizaciones + + + The window you are attempting to dock does not seem to be a normal window. + La ventana que intenta iconificar no parece ser una ventana ordinaria. + + + diff --git a/i18n/kdocker_fr.qm b/i18n/kdocker_fr.qm new file mode 100644 index 0000000..3595c2a Binary files /dev/null and b/i18n/kdocker_fr.qm differ diff --git a/i18n/kdocker_fr.ts b/i18n/kdocker_fr.ts new file mode 100644 index 0000000..bf833e3 --- /dev/null +++ b/i18n/kdocker_fr.ts @@ -0,0 +1,281 @@ + + + CustomTrayLabel + + Launch on startup + Lancer au démarrage + + + Set Icon + Choisir une icône + + + Balloon title changes + Actualisation des Info-bulles + + + Dock when obscured + Icônifier si masquée + + + Dock when minimized + Icônifier si réduite + + + Skip taskbar + Invisible dans la barre des tâches + + + About KDocker + A propos de KDocker + + + Options + Options + + + Dock Another + Icônifier une autre fenêtre + + + Undock All + Libérer tout + + + Undock + Libérer + + + Close + Fermer + + + KDocker + KDocker + + + %1 is not a valid icon + %1 n'est pas une icône valide + + + Dock when session restored + Icônifier au lancement de la session + + + + Show %1 + Affiche %1 + + + Hide %1 + Cacher %1 + + + You cannot drop an item into the tray icon. Drop it on the window +that is brought in front when you hover the item over the tray icon + Il est impossible de déposer un élément directement sur l'îcone de la miniature, +déposez le dans la fenêtre une fois celle-ci maximisée. + + + Set balloon timeout + Modifier le délai des Info-bulles + + + Enter balloon timeout (secs) + Délai de masquage des Info-bulles (secs) + + + Enter balloon timeout (secs). 0 to disable ballooning + + + + "%1" is not a valid executable or was not found in your $PATH + + + + Select program + + + + Cancel + + + + Dock when focus lost + + + + + KDocker + + Usage: KDocker [options] command + + Usage: KDocker [options] commande + + + + Docks any application into the system tray + + Permet à n'importe quelle application d'être placée dans la boîte à miniatures + + + + command Command to execute + + commande commande à executer + + + Options + Options + + + -a Show author information + -a Affiche les informations sur l'auteur + + + -f Dock window that has the focus(active window) + -f Icônifie la fenêtre active + + + -h Display this help + -h Affiche cette aide + + + -i iconCustom dock Icon + -i iconIcône spécifique pour la miniature + + + -l Launch on startup + -l Lancer au démarrage + + + -o Dock when obscured + -o Icônifier si cachée + + + -q Disable ballooning title changes (quiet) + -q Désactiver l'actualisation des Infos-bulles (silencieux) + + + -t Remove this application from the task bar + -t Retirer de la barre des tâches + + + -w wid Window id of the application to dock + + -w wid Identifiant de la fenêtre à icônifier + + + + Bugs and wishes to gramakri@uiuc.edu + Pour tout bogue ou suggestion contacter gramakri@uiuc.edu + + + Project information at http://kdocker.sourceforge.net + Plus d'informations sur http://kdocker.sourceforge.net + + + Caught signal %1. Cleaning up. + Signal %1 intercepté. Nettoyage en cours. + + + -d Disable session management + -d Désactiver le gestionnaire de session + + + -m Keep application window mapped (dont hide on dock) + -m Garder l'application visible lors de l'icônification + + + -e Enable session management + -e Activer le gestionnaire de session + + + NOTE: Use -d for all startup scripts. + + NOTE: Utiliser -d pour tous les scripts de démarrage. + + + + -b Dont warn about non-normal windows (blind mode) + -b Pas d'avertissement pour les fenêtres non conformes (mode aveugle) + + + -v Display version + -v Affiche le numéro de version + + + kdocker: invalid option -- %1 + kdocker: option non valide -- %1 + + + -p secsSet ballooning timeout (popup time) + -p secsFixe le délai des Info-bulles + + + + TrayLabelMgr + + About KDocker + A propos de KDocker + + + KDocker + KDocker + + + Girish Ramakrishnan (gramakri@uiuc.edu) + Girish Ramakrishnan (gramakri@uiuc.edu) + + + This window is already docked. +Click on system tray icon to toggle docking. + Cette fenêtre est déjà icônifiée. +Cliquez sur son icône pour la faire apparaître. + + + Failed to fork: %1 + Le fork a échoué: %1 + + + The System tray was hidden or removed + La boite à miniatures est cachée ou a été enlevé + + + Undock All + Libérer tout + + + Ignore + Ignorer + + + Select the application/window to dock with button1. + Sélectionnez l'application/fenêtre à icônifier avec le bouton1 de la souris. + + + Click any other button to abort + + Cliquer sur n'importe quel autre bouton pour annuler + + + + Failed to exec [%1]: %2 + L'exécution de [%1] a échoué: %2 + + + Bugs/wishes to Girish Ramakrishnan (gramakri@uiuc.edu) +English translation by Girish (gramakri@uiuc.edu) + +http://kdocker.sourceforge.net for updates + Bogues/suggestions Girish Ramakrishnan (gramakri@uiuc.edu) +Traduction française par Al (altrash@altern.org) + +http://kdocker.sourceforge.net pour les mis-à-jour + + + The window you are attempting to dock does not seem to be a normal window. + La fenêtre que vous tentez d'icônifier ne semble pas être une fenêtre classique. + + + diff --git a/i18n/kdocker_hu.qm b/i18n/kdocker_hu.qm new file mode 100644 index 0000000..9d55984 Binary files /dev/null and b/i18n/kdocker_hu.qm differ diff --git a/i18n/kdocker_hu.ts b/i18n/kdocker_hu.ts new file mode 100644 index 0000000..ad769a4 --- /dev/null +++ b/i18n/kdocker_hu.ts @@ -0,0 +1,265 @@ + + + CustomTrayLabel + + Launch on startup + Indításkor futtatás + + + Dock when obscured + Dokk mikor jelentéktelen + + + Dock when minimized + Dokk mikor minimalizált + + + Skip taskbar + Tálca átugrása + + + About KDocker + A KDockerről + + + Options + Beállítások + + + Dock Another + Másik dokkolása + + + Undock All + Mind kidokkolása + + + Undock + Kidokkolás + + + Close + Bezár + + + KDocker + + + + %1 is not a valid icon + %1 nem érvényes ikon + + + Set Icon + Ikon beállítása + + + Dock when session restored + Dokk mikor munkamenet visszaáll + + + Show %1 + Mutat %1 + + + Hide %1 + Rejt %1 + + + You cannot drop an item into the tray icon. Drop it on the window +that is brought in front when you hover the item over the tray icon + Nem lehet egy elemet a tálcaikonra dobni. Dobja arra az ablakra, amely előtérbe jön, amikor az elemmel a tálcaikon felett áll. + + + Set balloon timeout + Lufi idő + + + Enter balloon timeout (secs). 0 to disable ballooning + Írja be a lufi időt(mp). 0-val letilthatja. + + + "%1" is not a valid executable or was not found in your $PATH + "%1" nem futtatható vagy nem található meg itt: $PATH + + + Select program + Program választás + + + Cancel + Mégse + + + Dock when focus lost + + + + + KDocker + + Usage: KDocker [options] command + + Használat: KDocker [opció] parancs + + + Docks any application into the system tray + + Dokkol bármilyen alkalmazást a rendszer tálcára + + + command Command to execute + + parancs Futtatandó parancs + + + Options + Beállítások + + + -a Show author information + -a Szerzö információi + + + -f Dock window that has the focus(active window) + -f Dokkolja a fókuszban lévö ablakot(aktív ablak) + + + -h Display this help + -h Ezen segítség kiírása + + + -i iconCustom dock Icon + -i ikonEgyedi dokk ikon + + + -l Launch on startup + -l Indításkor futtatás + + + -o Dock when obscured + -o Dokk mikor jelentéktelen + + + -q Disable ballooning title changes (quiet) + -q Lufi változás letiltása (csendes) + + + -t Remove this application from the task bar + -t Ezen alkalmazás eltávolítása a tálcáról + + + -w wid Window id of the application to dock + + -w wid Dokkolnadó alkalmazás ablakának id-e + + + Bugs and wishes to gramakri@uiuc.edu + Hiba és észrevétel: ramakri@uiuc.edu. + + + Project information at http://kdocker.sourceforge.net + Projekt információ: http://kdocker.sourceforge.net + + + Caught signal %1. Cleaning up. + Szignál elkapása %1. Kitisztítás. + + + -d Disable session management + -d Munkamenet kezelö letiltása + + + -m Keep application window mapped (dont hide on dock) + -m Alkalmazás ablak megtartása (nincs rejtés a dokkon) + + + -e Enable session management + -e Munkamenet kezelö engedélyezése + + + NOTE: Use -d for all startup scripts. + + Megjegyzés: Használjon -d minden induló scripthez. + + + -b Dont warn about non-normal windows (blind mode) + -b Nincs riasztás nem normál ablakoknál(vak mód) + + + -v Display version + -v Verzió kiírása + + + kdocker: invalid option -- %1 + kdocker: nem valós opció -- %1 + + + -p secsSet ballooning timeout (popup time) + -p mpLufi idö beállítása (felbukkanási idö) + + + + TrayLabelMgr + + About KDocker + A KDockerről + + + KDocker + + + + Girish Ramakrishnan (gramakri@uiuc.edu) + + + + This window is already docked. +Click on system tray icon to toggle docking. + Ez az ablak jelenleg dokkolt. Kattintson a rendszer tálca ikonra, a kidokkoláshoz. + + + Failed to fork: %1 + Hiba létrehozáskor: %1 + + + The System tray was hidden or removed + A Rendszer tálca rejtett vagy eltávolított + + + Undock All + Mind kidokkolása + + + Ignore + Letiltás + + + Select the application/window to dock with button1. + Válassza ki az alkalmazást/ablakot, hogy dokkolja a bal egérgombbal. + + + Click any other button to abort + + Kattintson bármelyik más gombbal a megszakításhoz + + + Failed to exec [%1]: %2 + Hiba a futtatásban [%1]: %2 + + + Bugs/wishes to Girish Ramakrishnan (gramakri@uiuc.edu) +English translation by Girish (gramakri@uiuc.edu) + +http://kdocker.sourceforge.net for updates + Hibák/Észrevételek: Girish Ramakrishnan (gramakri@uiuc.edu) +Magyar fordítás: Nyitrai István (sianis@gmail.com) +Frissítések: http://kdocker.sourceforge.net + + + The window you are attempting to dock does not seem to be a normal window. + Az ablak amelyet dokkolni akar, úgy néz ki, hogy nem normális ablak. + + + + diff --git a/i18n/kdocker_id.qm b/i18n/kdocker_id.qm new file mode 100644 index 0000000..a93680b Binary files /dev/null and b/i18n/kdocker_id.qm differ diff --git a/i18n/kdocker_id.ts b/i18n/kdocker_id.ts new file mode 100644 index 0000000..030f7e6 --- /dev/null +++ b/i18n/kdocker_id.ts @@ -0,0 +1,275 @@ + + + CustomTrayLabel + + Dock when session restored + Lakukan docking saat sesi dipulihkan + + + Launch on startup + Jalankan saat memulai + + + Set Icon + Pilih icon + + + Set balloon timeout + Tentukan waktu tampil petunjuk + + + Dock when obscured + + + + Dock when minimized + Dock saat jendela dikecilkan + + + Skip taskbar + Jangan tampilkan di taskbar + + + About KDocker + Tentang KDocker + + + Options + Pilihan + + + Dock Another + Dock jendela yang lain + + + Undock All + Undock semua jendela + + + Undock + Undock + + + Close + Tutup aplikasi + + + KDocker + KDocker + + + %1 is not a valid icon + %1 bukan icon yang benar + + + Enter balloon timeout (secs) + Masukkan waktu tampil petunjuk (detik) + + + Show %1 + Tampilkan %1 + + + Hide %1 + Sembunyikan %1 + + + You cannot drop an item into the tray icon. Drop it on the window +that is brought in front when you hover the item over the tray icon + Anda tidak dapat meletakkan sebuah item ke tray icon. Letakkan item tersebut ke jendela +yang ada di hadapan anda saat anda mengarahkan item tersebut ke tray icon + + + Enter balloon timeout (secs). 0 to disable ballooning + + + + "%1" is not a valid executable or was not found in your $PATH + + + + Select program + + + + Cancel + + + + Dock when focus lost + + + + + KDocker + + kdocker: invalid option -- %1 + kdocker: kesalahan pilihan --%1 + + + Usage: KDocker [options] command + + Pemakaian: KDocker [pilihan] perintah + + + + Docks any application into the system tray + + Dock aplikasi apa saja ke system tray + + + + command Command to execute + + perintah Perintah yang ingin dieksekusi + + + Options + Pilihan + + + -a Show author information + -a Tampilkan informasi pembuat + + + -b Dont warn about non-normal windows (blind mode) + -b Jangan peringatkan tentang jendela yang tidak normal (blind mode) + + + -d Disable session management + -d Non aktifkan manajemen sesi + + + -e Enable session management + -e Aktifkan manajemen sesi + + + -f Dock window that has the focus(active window) + -f Dock jendela yang mendapatkan fokus ( jendela aktif ) + + + -h Display this help + -h Tampilkan bantuan + + + -i iconCustom dock Icon + -i icon Pilih icon sendiri + + + -l Launch on startup + -l Jalankan saat memulai + + + -m Keep application window mapped (dont hide on dock) + -m Tetap memetakan jendela aplikasi ( jangan sembunyikan saat docking) + + + -o Dock when obscured + + + + -p secsSet ballooning timeout (popup time) + -p detik Tentukan waktu petunjuk (waktu tampil) + + + -q Disable ballooning title changes (quiet) + -q Menonaktifkan petunjuk perubahan titlebar (quiet) + + + -t Remove this application from the task bar + -t Hilangkan aplikasi ini dari taskbar + + + -v Display version + -v Tampilkan versi program + + + -w wid Window id of the application to dock + + -w wid id jendela aplikasi yang di dock + + + NOTE: Use -d for all startup scripts. + + CATATAN: Gunakan -d untuk semua startup script. + + + + Bugs and wishes to gramakri@uiuc.edu + Bug dan masukan ke gramakri@uiuc.edu + + + Project information at http://kdocker.sourceforge.net + Informasi tentang proyek KDocker di http://kdocker.sourceforge.net + + + Caught signal %1. Cleaning up. + Mendapat sinyal %1. Membereskan semua. + + + + TrayLabelMgr + + About KDocker + Tentang KDocker + + + Bugs/wishes to Girish Ramakrishnan (gramakri@uiuc.edu) +English translation by Girish (gramakri@uiuc.edu) + +http://kdocker.sourceforge.net for updates + Bug dan masukan ke Girish Ramakrishnan (gramakri@uiuc.edu) +Terjemahan Bahasa Inggris oleh Girish (gramakri@uiuc.edu) +Terjemahan Bahasa Indonesia oleh Eko Prasetiyo (ekoprasetiyo@gmail.com) + +http://kdocker.sourceforge.net untuk mendapatkan update + + + KDocker + KDocker + + + Girish Ramakrishnan (gramakri@uiuc.edu) + Girish Ramakrishnan (gramakri@uiuc.edu) + + + Select the application/window to dock with button1. + Pilih aplikasi/jendela yang ingin di dock dengan tombol 1. + + + Click any other button to abort + + Klik tombol mana saja untuk membatalkan + + + The window you are attempting to dock does not seem to be a normal window. + Jendela yang ingin Anda dock sepertinya bukan jendela yang normal. + + + This window is already docked. +Click on system tray icon to toggle docking. + Jendela sepertinya sudah di dock +Klik icon di system tray untuk toggle docking. + + + Failed to exec [%1]: %2 + Gagal mengeksekusi [%1]: %2 + + + Failed to fork: %1 + Gagal melakukan fork: %1 + + + The System tray was hidden or removed + System tray telah disembunyikan atau dihilangkan + + + Undock All + Undock semua jendela + + + Ignore + Abaikan + + + diff --git a/i18n/kdocker_it.qm b/i18n/kdocker_it.qm new file mode 100644 index 0000000..7c76cee Binary files /dev/null and b/i18n/kdocker_it.qm differ diff --git a/i18n/kdocker_it.ts b/i18n/kdocker_it.ts new file mode 100644 index 0000000..8e60041 --- /dev/null +++ b/i18n/kdocker_it.ts @@ -0,0 +1,278 @@ + + + CustomTrayLabel + + Dock when session restored + Includi nel Pannello quando la sessione è ripristinata + + + Launch on startup + Lancia all'avvio + + + Set Icon + Imposta Icona + + + Set balloon timeout + Imposta timeout suggerimenti + + + Dock when obscured + Includi nel pannello quando oscurato + + + Dock when minimized + Includi nel pannello quando minimizzato + + + Skip taskbar + Non mostrare nella barra delle applicazioni + + + About KDocker + Informazioni su KDocker + + + Options + Opzioni + + + Dock Another + Includi nel pannello un'altra applicazione + + + Undock All + Escludi dal pannello tutto + + + Undock + Escludi dal pannello + + + Close + Chiudi + + + KDocker + KDocker + + + %1 is not a valid icon + %1 non è un'icona valida + + + Enter balloon timeout (secs) + Inserisci timeout (in secondi) per i suggeirmenti + + + Show %1 + Mostra %1 + + + Hide %1 + Nascondi %1 + + + You cannot drop an item into the tray icon. Drop it on the window +that is brought in front when you hover the item over the tray icon + Non puoi trascinare un elemento nell'icona del vassoio di sistema. +Trascinalo nella finestra che appare passando sopra l'icona di un elemento nel vassoio di sistema + + + Enter balloon timeout (secs). 0 to disable ballooning + + + + "%1" is not a valid executable or was not found in your $PATH + + + + Select program + + + + Cancel + + + + Dock when focus lost + + + + + KDocker + + kdocker: invalid option -- %1 + kdocker: opzione invalida -- %1 + + + Usage: KDocker [options] command + + Uso: KDocker [opzioni] commando + + + + Docks any application into the system tray + + Includi ogni applicazione nel vassoio di sistema + + + + command Command to execute + + comandoComando da eseguire + + + + Options + Opzioni + + + -a Show author information + -a Mostra le informazioni sull'autore + + + -b Dont warn about non-normal windows (blind mode) + -b Non avvisare in caso di finestre anomale (modalità cieca) + + + -d Disable session management + -d Disabilita la gestione della sessione + + + -e Enable session management + -e Abilita la gestione della sessione + + + -f Dock window that has the focus(active window) + -f Includi la finestra che ha il focus(finestra attiva) nel pannello + + + -h Display this help + -h Mostra questo aiuto + + + -i iconCustom dock Icon + -i iconIcona del pannello personalizzata + + + -l Launch on startup + -l Lancia all'avvio + + + -m Keep application window mapped (dont hide on dock) + -m Mantieni la finestra dell'applicazione mappata (non nascondere nel pannello) + + + -o Dock when obscured + -o Includi nel pannello quando oscurato + + + -p secsSet ballooning timeout (popup time) + -p secsImposta timeout dei suggerimenti (durata popup) + + + -q Disable ballooning title changes (quiet) + -q Disabilita cambio titolo nei suggerimenti (calmo) + + + -t Remove this application from the task bar + -t Rimuovi questa applicazione dalla barra delle applicazioni + + + -v Display version + -v Mostra versione + + + -w wid Window id of the application to dock + + -w widId della Finestra da includere nel pannello + + + + NOTE: Use -d for all startup scripts. + + NOTA: Usa -d per tutti gli script di avvio. + + + + Bugs and wishes to gramakri@uiuc.edu + Bugs e richieste a gramakri@uiuc.edu + + + Project information at http://kdocker.sourceforge.net + Informazioni sul Progetto su http://kdocker.sourceforge.net + + + Caught signal %1. Cleaning up. + Ricevuto segnale %1. Pulire. + + + + TrayLabelMgr + + About KDocker + Informazioni su KDocker + + + Bugs/wishes to Girish Ramakrishnan (gramakri@uiuc.edu) +English translation by Girish (gramakri@uiuc.edu) + +http://kdocker.sourceforge.net for updates + Bugs/richieste a Girish Ramakrishnan (gramakri@uiuc.edu) +Tradotto in Italiano da Alessio Cassibba (swapon@gmail.com) + + +http://kdocker.sourceforge.net per aggiornamenti + + + KDocker + KDocker + + + Girish Ramakrishnan (gramakri@uiuc.edu) + Girish Ramakrishnan (gramakri@uiuc.edu) + + + Select the application/window to dock with button1. + Seleziona l'applicazione/finestra da includere nel pannello con il tasto1. + + + Click any other button to abort + + Clicca un tasto qualsiasi per annullare + + + + The window you are attempting to dock does not seem to be a normal window. + La finestra che si sta cercando di includere nel pannello non sembra essere una finestra normale. + + + This window is already docked. +Click on system tray icon to toggle docking. + Questa finestra è già inclusa nel pannello. +Clicca sull'icona del pannello per alternare l'inclusione nel pannello. + + + Failed to exec [%1]: %2 + Fallito exec: [%1]: %2 + + + Failed to fork: %1 + Fallito fork: %1 + + + The System tray was hidden or removed + Il Vassoio di sistema è stato nascosto o rimosso + + + Undock All + Escludi dal pannello + + + Ignore + Ignora + + + diff --git a/i18n/kdocker_ja.qm b/i18n/kdocker_ja.qm new file mode 100644 index 0000000..9955c04 Binary files /dev/null and b/i18n/kdocker_ja.qm differ diff --git a/i18n/kdocker_ja.ts b/i18n/kdocker_ja.ts new file mode 100644 index 0000000..a4240d5 --- /dev/null +++ b/i18n/kdocker_ja.ts @@ -0,0 +1,340 @@ + + + CustomTrayLabel + + Dock when session restored + 隠れた時にドックに入れる + + + Launch on startup + スタートアップに開始 + + + Set Icon + アイコンをセット + + + Set balloon timeout + バルーン タイムアウト をセット + + + Dock when obscured + 隠れた時にドックに入れる + + + Dock when minimized + 最小化時にドックに入れる + + + Skip taskbar + タスクバーに表示しない + + + About KDocker + KDocker について + + + Options + オプション + + + Dock Another + 他のもドックに入れる + + + Undock All + 全てをドックから出す + + + Undock + ドックから出す + + + Close + 閉じる + + + KDocker + + + + %1 is not a valid icon + %1 は有効なアイコンではありません。 + + + Enter balloon timeout (secs). 0 to disable ballooning + バルーンタイムアウト(秒)を入力して下さい。0にするとバルーニングは無効になります。 + + + "%1" is not a valid executable or was not found in your $PATH + "%1" は実行可能でないか又は $PATH に見つかりませんでした。 + + + Select program + プログラムを選択 + + + Cancel + キャンセル + + + Show %1 + %1 を表示 + + + Hide %1 + %1 を隠す + + + You cannot drop an item into the tray icon. Drop it on the window +that is brought in front when you hover the item over the tray icon + トレイアイコンへ直接 アイテムをドロップする事はできません。 +トレイアイコン上に アイテムをドラッグすると ウィンドウが表示されますので、表示されたウィンドウに アイテムをドロップして下さい 。 + + + Dock when focus lost + + + + + KDocker + + kdocker: invalid option -- %1 + kdocker: 無効なオプション -- %1 + + + Usage: KDocker [options] command + + 使用法: KDocker [オプション] コマンド + + + Docks any application into the system tray + + + + + command Command to execute + + command 実行するコマンド + + + Options + オプション + + + -a Show author information + -a 作者情報の表示 + + + -b Dont warn about non-normal windows (blind mode) + -b 非正常なウィンドウについて警告しない (ブラインド モード) + + + -d Disable session management + -d セッション管理を無効にする + + + -e Enable session management + -e セッション管理を有効にする + + + -f Dock window that has the focus(active window) + -f フォーカスを持ったウィンドウ(アクティブウィンドウ) をドックに入れる + + + -h Display this help + -h このヘルプを表示する + + + -i iconCustom dock Icon + -i icon カスタム ドックアイコン + + + -l Launch on startup + -l スタートアップに開始する + + + -m Keep application window mapped (dont hide on dock) + -m ウィンドウの配置を保つ (ドックに隠さない) + + + -o Dock when obscured + -o 隠れた時にドックに入れる + + + -p secsSet ballooning timeout (popup time) + -p secs バルーニング タイムアウト(ポップアップ タイム) をセット + + + -q Disable ballooning title changes (quiet) + -q バルーニングタイトルの変更を無効にする + + + -t Remove this application from the task bar + -t タスクバーからこのアプリケーションを除く + + + -v Display version + -v バージョンの表示 + + + -w wid Window id of the application to dock + + -w wid ドックに入れるアプリケーションのWindow ID + + + NOTE: Use -d for all startup scripts. + + 注: 全てのスタートアップ スクリプトの変わりに -d を使いましょう。 + + + Bugs and wishes to gramakri@uiuc.edu + バグや要望は gramakri@uiuc.edu まで + + + Project information at http://kdocker.sourceforge.net + プロジェクト情報 http://kdocker.sourceforge.net + + + Caught signal %1. Cleaning up. + + + + command Command to execute + + + + + -a Show author information + + + + -b Dont warn about non-normal windows (blind mode) + + + + -d Disable session management + + + + -e Enable session management + + + + -f Dock window that has the focus(active window) + + + + -h Display this help + + + + -i iconCustom dock Icon + + + + -l Launch on startup + + + + -m Keep application window mapped (dont hide on dock) + + + + -o Dock when obscured + + + + -p secsSet ballooning timeout (popup time) + + + + -q Disable ballooning title changes (quiet) + + + + -t Remove this application from the task bar + + + + -v Display version + + + + -w wid Window id of the application to dock + + + + + + TrayLabelMgr + + About KDocker + KDocker について + + + Bugs/wishes to Girish Ramakrishnan (gramakri@uiuc.edu) +Japanese translation by ka (redline@ma.akari.ne.jp) + +http://kdocker.sourceforge.net for updates + バグ/要望は、Girish Ramakrishnan (gramakri@uiuc.edu) まで +日本語訳 by ka (redline@ma.akari.ne.jp) + +http://kdocker.sourceforge.net for updates + + + KDocker + + + + Girish Ramakrishnan (gramakri@uiuc.edu) + + + + Select the application/window to dock with button1. + button1 にドッキングするためにアプリケーション/ウィンドウを選択してください。 + + + Click any other button to abort + + + + + The window you are attempting to dock does not seem to be a normal window. + あなたがドッキングするのを試みているウィンドウは正常なウィンドウであるように思えません。 + + + This window is already docked. +Click on system tray icon to toggle docking. + このウィンドウは既にドッキングされています。 +システムトレイアイコンをクリックして、ドッキングを切り換えてください。 + + + Failed to exec [%1]: %2 + + + + Failed to fork: %1 + + + + The System tray was hidden or removed + システムトレイは、隠されたか、または取り外されました。 + + + Undock All + 全てをドックから出す + + + Ignore + 無視する + + + Bugs/wishes to Girish Ramakrishnan (gramakri@uiuc.edu) +English translation by Girish (gramakri@uiuc.edu) + +http://kdocker.sourceforge.net for updates + + + + diff --git a/i18n/kdocker_nl.qm b/i18n/kdocker_nl.qm new file mode 100644 index 0000000..b64c319 Binary files /dev/null and b/i18n/kdocker_nl.qm differ diff --git a/i18n/kdocker_nl.ts b/i18n/kdocker_nl.ts new file mode 100644 index 0000000..0183ca3 --- /dev/null +++ b/i18n/kdocker_nl.ts @@ -0,0 +1,271 @@ + + + CustomTrayLabel + + Launch on startup + Uitvoeren tijdens opstarten + + + Dock when obscured + Aankoppelen tijdens verduistering + + + Dock when minimized + Aankoppelen tijdens minimalisering + + + Skip taskbar + Taakbalk overslaan + + + About KDocker + Info over KDocker + + + Options + Opties + + + Dock Another + Andere aankoppelen + + + Undock All + Alles ontkoppelen + + + Undock + Ontkoppelen + + + Close + Afsluiten + + + KDocker + + + + %1 is not a valid icon + %1 is niet een geldig pictogram + + + Set Icon + Pictrogram instellen + + + Dock when session restored + Aankoppelen tijdens herstel van de sessie + + + Show %1 + %1 tonen + + + Hide %1 + Verberg %1 + + + You cannot drop an item into the tray icon. Drop it on the window +that is brought in front when you hover the item over the tray icon + U kunt geen item laten vallen in het tray pictogram. Laat het vallen op een venster dat +naar voren wordt gebracht wanneer u een tijdje boven het tray pictogram blijft hangen + + + Set balloon timeout + Ballon interval instellen + + + Enter balloon timeout (secs). 0 to disable ballooning + Voer ballon interval (sec.) in. 0 om ballonen uit te schakelen + + + "%1" is not a valid executable or was not found in your $PATH + "%1" is een ongeldig uitvoerbaar bestand of is niet gevonden in uw $PATH + + + Select program + Programma selecteren + + + Cancel + Annuleren + + + Dock when focus lost + + + + + KDocker + + Usage: KDocker [options] command + + Gebruik: KDocker [opties] commando + + + + Docks any application into the system tray + + Koppelt elke toepassing aan in het systeem dienblad + + + + command Command to execute + + commando Commando uit te voeren + + + Options + Opties + + + -a Show author information + -a Toon auteur informatie + + + -f Dock window that has the focus(active window) + -f Venster dat focus heeft aankoppelen (actieve venster) + + + -h Display this help + -h Deze hulp tonen + + + -i iconCustom dock Icon + -i pictogram Aangepast pictogram voor aankoppelen + + + -l Launch on startup + -l Uitvoeren tijdens opstarten + + + -o Dock when obscured + -o Aankoppelen tijdens verduisteren + + + -q Disable ballooning title changes (quiet) + -q Ballonnen van titel wijzigingen uitschakelen (stil) + + + -t Remove this application from the task bar + -t Deze toepassing verwijderen uit het systeem dienblad + + + -w wid Window id of the application to dock + + -w wid Venster id van de aan te koppelen applicatie + + + Bugs and wishes to gramakri@uiuc.edu + Bugs en wensen naar gramakri@uiuc.edu + + + Project information at http://kdocker.sourceforge.net + Project informatie op http://kdocker.sourceforge.net + + + Caught signal %1. Cleaning up. + Signaal %1 ontvangen. Opruimen. + + + -d Disable session management + -d Sessiebeheer uitschakelen + + + -m Keep application window mapped (dont hide on dock) + -m Toepassingsvenster zichtbaar houden + + + -e Enable session management + -e Sessiebeheer inschakelen + + + NOTE: Use -d for all startup scripts. + + OPMERKING: Gebruik -d voor alle opstart scripten. + + + + -b Dont warn about non-normal windows (blind mode) + -b Niet waarschuwen over niet normale vensters (blinde modus) + + + -v Display version + -v Versie tonen + + + kdocker: invalid option -- %1 + kdocker: ongeldige optie -- %1 + + + -p secsSet ballooning timeout (popup time) + -p sec. Ballon interval instellen (popup tijd) + + + + TrayLabelMgr + + About KDocker + Info over KDocker + + + KDocker + + + + Girish Ramakrishnan (gramakri@uiuc.edu) + + + + This window is already docked. +Click on system tray icon to toggle docking. + Dit venster is reeds aangekoppeld. +Klik op het systeem dienblad pictogram om de aankoppelen aan/uit te zetten. + + + Failed to fork: %1 + + + + The System tray was hidden or removed + Het systeem dienblad was verborgen of verwijderd + + + Undock All + Alles Loskoppelen + + + Ignore + Negeren + + + Select the application/window to dock with button1. + Programma/venster selecteren om aan te koppelen met knop1. + + + Click any other button to abort + + Druk op elk andere knop om te annuleren + + + + Failed to exec [%1]: %2 + Mislukt [%1] uit te voeren: %2 + + + Bugs/wishes to Girish Ramakrishnan (gramakri@uiuc.edu) +English translation by Girish (gramakri@uiuc.edu) + +http://kdocker.sourceforge.net for updates + Bugs/wensen naar Girish Ramakrishnan (gramakri@uiuc.edu) +Nederlandse vertaling door Jay Kamminga (jay-kamminga@home.nl) + +http://kdocker.sourceforge.net voor updates + + + The window you are attempting to dock does not seem to be a normal window. + Het venster dat u probeert aan te koppelen lijkt niet een normaal venster te zijn. + + + diff --git a/i18n/kdocker_pl.qm b/i18n/kdocker_pl.qm new file mode 100644 index 0000000..e66ab8f Binary files /dev/null and b/i18n/kdocker_pl.qm differ diff --git a/i18n/kdocker_pl.ts b/i18n/kdocker_pl.ts new file mode 100644 index 0000000..7e3c552 --- /dev/null +++ b/i18n/kdocker_pl.ts @@ -0,0 +1,271 @@ + + + CustomTrayLabel + + Launch on startup + Uruchamiaj przy starcie + + + Balloon title changes + Informuj o zmianach tytułu okna + + + Dock when obscured + Dokuj zakryte + + + Dock when minimized + Dokuj zminimalizowane + + + Skip taskbar + Nie wyświetlaj na pasku zadań + + + About KDocker + Informacje o programie KDocker + + + Options + Opcje + + + Dock Another + Zadokuj... + + + Undock All + Oddokuj wszystko + + + Undock + Oddokuj + + + Close + Zamknij + + + KDocker + KDocker + + + %1 is not a valid icon + %1 nie jest poprawną ikoną + + + Set Icon + Ustaw ikonę + + + Dock when session restored + Dokuj po przywróceniu sesji + + + Show %1 + Wyświetl %1 + + + Hide %1 + Ukryj %1 + + + You cannot drop an item into the tray icon. Drop it on the window +that is brought in front when you hover the item over the tray icon + Obiektów nie można upuszczać na ikonie w tacce systemowej. Aby przenieść +obiekt, przesuń go nad ikonę w tacce, a następnie upuść w wyświetlonym oknie + + + Set balloon timeout + Określ czas wyświetlania podpowiedzi + + + Enter balloon timeout (secs). 0 to disable ballooning + Określ czas wyświetlania podpowiedzi (w sekundach). Wartość "0" wyłącza podpowiedzi + + + "%1" is not a valid executable or was not found in your $PATH + "%1" nie jest prawidłową aplikacją lub nie znajduje się w zmiennej $PATH + + + Select program + Wybierz program + + + Cancel + Anuluj + + + Dock when focus lost + + + + + KDocker + + Usage: KDocker [options] command + + Użycie: KDocker [opcje] polecenie + + + Docks any application into the system tray + + KDocker umożliwia zadokowanie dowolnej aplikacji w tacce systemowej + + + command Command to execute + + polecenie Polecenie, które ma zostać wykonane + + + Options + Opcje + + + -a Show author information + -a Wyświetla informacje o autorze + + + -f Dock window that has the focus(active window) + -f Dokuje aktywne okno + + + -h Display this help + -h Wyświetla pomoc + + + -i iconCustom dock Icon + -i Umożliwia określenie własnej ikony dokowania + + + -l Launch on startup + -l Włącza automatyczne uruchamianie + + + -o Dock when obscured + -o Dokuje zakryte + + + -q Disable ballooning title changes (quiet) + -q Wyłącza informowanie o zmianach tytułu okna (tryb cichy) + + + -t Remove this application from the task bar + -t Usuwa aplikację z paska zadań + + + -w wid Window id of the application to dock + + -w Wyświetla identyfikator okna aplikacji, która ma zostać zadokowana + + + Bugs and wishes to gramakri@uiuc.edu + Informacje o błędach i życzenia proszę kierować na adres gramakri@uiuc.edu + + + Project information at http://kdocker.sourceforge.net + Informacje o projekcie: http://kdocker.sourceforge.net + + + Caught signal %1. Cleaning up. + Odebrano sygnał %1. Zamykanie. + + + -d Disable session management + -d Wyłącza zarządzanie sesją + + + -m Keep application window mapped (dont hide on dock) + -m Umożliwia mapowanie okna aplikacji (okno nie jest ukrywane po zadokowaniu) + + + -e Enable session management + -e Włącza zarządzanie sesją + + + NOTE: Use -d for all startup scripts. + + UWAGA: Proszę używać opcji -d w przypadku skryptów startowych. + + + -b Dont warn about non-normal windows (blind mode) + -b Wyłącza ostrzegania o nienormalnych oknach (tryb ślepy) + + + -v Display version + -v Wyświetla informację o wersji programu + + + kdocker: invalid option -- %1 + kdocker: nieprawidłowa opcja -- %1 + + + -p secsSet ballooning timeout (popup time) + -p sekundy(tab)Określa czas wyświetlania podpowiedzi + + + + TrayLabelMgr + + About KDocker + Informacje o programie KDocker + + + KDocker + KDocker + + + Girish Ramakrishnan (gramakri@uiuc.edu) + Girish Ramakrishnan (gramakri@uiuc.edu) + + + This window is already docked. +Click on system tray icon to toggle docking. + To okno zostało już zadokowane. +Kliknij ikonę w tacce, aby je przywrócić. + + + Failed to fork: %1 + Nie można uruchomić: %1 + + + The System tray was hidden or removed + Tacka systemowa jest ukryta lub została usunięta + + + Undock All + Oddokuj wszystko + + + Ignore + Ignoruj + + + Select the application/window to dock with button1. + Wybierz aplikację lub okno do zadokowania, naciskając button1. + + + Click any other button to abort + + Kilknij dowolny przycisk, aby anulować + + + Failed to exec [%1]: %2 + Nie można wykonać [%1]: %2 + + + Bugs/wishes to Girish Ramakrishnan (gramakri@uiuc.edu) +English translation by Girish (gramakri@uiuc.edu) + +http://kdocker.sourceforge.net for updates + Na informacje o błędach i życzenia czeka Girish Ramakrishnan (gramakri@uiuc.edu) +Polskie tłumaczenie opracował KonMan (dedalus@o2.pl) + +Sprawdź, czy nie jest dostępna nowa wersja: http://kdocker.sourceforge.net + + + The window you are attempting to dock does not seem to be a normal window. + Okno, które zamierzasz zadokować, nie jest zwykłym oknem. + + + diff --git a/i18n/kdocker_pt_BR.qm b/i18n/kdocker_pt_BR.qm new file mode 100644 index 0000000..d30183a Binary files /dev/null and b/i18n/kdocker_pt_BR.qm differ diff --git a/i18n/kdocker_pt_BR.ts b/i18n/kdocker_pt_BR.ts new file mode 100644 index 0000000..8fa07cf --- /dev/null +++ b/i18n/kdocker_pt_BR.ts @@ -0,0 +1,274 @@ + + + CustomTrayLabel + + Dock when session restored + Mostrar no painel quando restaurar sessão + + + Launch on startup + Executar ao iniciar + + + Set Icon + Atribuir ícone + + + Balloon title changes + Mostrar mudanças no título + + + Dock when obscured + Mostrar no painel quando sair de foco + + + Dock when minimized + Mostrar no painel quando minimizado + + + Skip taskbar + Não mostrar na barra de tarefas + + + About KDocker + Sobre o KDocker + + + Options + Opções + + + Dock Another + Mostrar outra aplicação no painel + + + Undock All + Remover todos do painel + + + Undock + Remover do painel + + + Close + Fechar + + + KDocker + KDocker + + + %1 is not a valid icon + %1 não é um ícone válido + + + Show %1 + Mostrar %1 + + + Hide %1 + Esconder %1 + + + You cannot drop an item into the tray icon. Drop it on the window +that is brought in front when you hover the item over the tray icon + Você não pode arrastar um item no ícone no painel. Arraste para a +janela que aparece quando você passa o item sobre o ícone no painel + + + Set balloon timeout + + + + Enter balloon timeout (secs). 0 to disable ballooning + + + + "%1" is not a valid executable or was not found in your $PATH + + + + Select program + + + + Cancel + + + + Dock when focus lost + + + + + KDocker + + Usage: KDocker [options] command + + Uso: KDocker [opções] comando + + + Docks any application into the system tray + + Mostra qualquer aplicação no painel do sistema + + + command Command to execute + + comando Comando a ser executado + + + Options + Opções + + + -a Show author information + -a Mostra informações do autor + + + -d Disable session management + -d Desabilita controle de sessão + + + -e Enable session management + -e Habilita controle de sessão + + + -f Dock window that has the focus(active window) + -f Mostra janela que tem o foco (janela ativa) no painel + + + -h Display this help + -h Mostra esta ajuda + + + -i iconCustom dock Icon + -i ico Personalizar ícone para o painel do sistema + + + -l Launch on startup + -l Executar ao iniciar + + + -m Keep application window mapped (dont hide on dock) + -m Mantém janela do aplicativo mapeada (não esconde ao mostrar no painel) + + + -o Dock when obscured + -o Mostrar no painel ao sair de foco + + + -q Disable ballooning title changes (quiet) + -q Desabilita mostrar a mudança nos títulos em popups (silencioso) + + + -t Remove this application from the task bar + -t Remove esta aplicação da barra de tarefas + + + -w wid Window id of the application to dock + + -w janID da janela da aplicação para mostrar no painel do sistema + + + + NOTE: Use -d for all startup scripts. + + NOTA: Use -d para todos os scripts de inicialização. + + + + Bugs and wishes to gramakri@uiuc.edu + Bugs e pedidos para gramakri@uiuc.edu + + + Project information at http://kdocker.sourceforge.net + Informações sobre o projeto em http://kdocker.sourceforge.net + + + Caught signal %1. Cleaning up. + Sinal %1 recebido. Limpando. + + + -b Dont warn about non-normal windows (blind mode) + -b Não avise sobre janelas fora do normal (modo cego) + + + -v Display version + -v Mostrar versão + + + kdocker: invalid option -- %1 + + + + -p secsSet ballooning timeout (popup time) + + + + + TrayLabelMgr + + About KDocker + Sobre o KDocker + + + Bugs/wishes to Girish Ramakrishnan (gramakri@uiuc.edu) +English translation by Girish (gramakri@uiuc.edu) + +http://kdocker.sourceforge.net for updates + Bugs/Pedidos para Girish Ramakrishnan (gramakri@uiuc.edu) +Tradução para Português (Brasil) por Paulo Vinícius Vitto Ruthes (paulo.ruthes@uol.com.br) + +http://kdocker.sourceforge.net para atualizações + + + KDocker + KDocker + + + Girish Ramakrishnan (gramakri@uiuc.edu) + Girish Ramakrishnan (gramakri@uiuc.edu) + + + Select the application/window to dock with button1. + Selecione a aplicação/janela para mostrar no painel do sistema com o botão 1. + + + Click any other button to abort + + Clique qualquer outro botão para cancelar + + + + The window you are attempting to dock does not seem to be a normal window. + A janela que você está tentando mostrar no painel do sistema não aparenta ser uma janela normal. + + + This window is already docked. +Click on system tray icon to toggle docking. + A janela já está no painel do sistema. +Clique na bandeja do sistema para mostrar ou esconder a janela. + + + Failed to exec [%1]: %2 + Falha ao executar [%1]: %2 + + + Failed to fork: %1 + Falha ao executar fork: %1 + + + The System tray was hidden or removed + O painel do sistema estava escondido ou não estava sendo executado + + + Undock All + Remover todos do painel do sistema + + + Ignore + Ignorar + + + diff --git a/i18n/kdocker_ru.qm b/i18n/kdocker_ru.qm new file mode 100644 index 0000000..4cbda31 Binary files /dev/null and b/i18n/kdocker_ru.qm differ diff --git a/i18n/kdocker_ru.ts b/i18n/kdocker_ru.ts new file mode 100644 index 0000000..3432f72 --- /dev/null +++ b/i18n/kdocker_ru.ts @@ -0,0 +1,276 @@ + + + CustomTrayLabel + + Launch on startup + Запускать при загрузке + + + Balloon title changes + Подсказка при изменении заголовка + + + Dock when obscured + Прятать при перекрытии + + + Dock when minimized + В трей при сворачивании + + + Skip taskbar + Не показывать в панели задач + + + About KDocker + О KDocker + + + Options + Настройки + + + Dock Another + Поместить еще + + + Undock All + Убрать все + + + Undock + Убрать + + + Close + Закрыть + + + KDocker + KDocker + + + %1 is not a valid icon + %1 не правильная иконка + + + Set Icon + Выбрать иконку + + + Dock when session restored + В трей при восстановлении сессии + + + Show %1 + Показать %1 + + + Hide %1 + Спрятать %1 + + + You cannot drop an item into the tray icon. Drop it on the window +that is brought in front when you hover the item over the tray icon + Вы не можете переместить объект в трей. Переместите его в окно +которое будет наверху, когда Вы подведете объект к иконке в трее + + + Set balloon timeout + + + + Enter balloon timeout (secs). 0 to disable ballooning + + + + "%1" is not a valid executable or was not found in your $PATH + + + + Select program + + + + Cancel + + + + Dock when focus lost + + + + + KDocker + + Usage: KDocker [options] command + + Использование: KDocker [options] command + + + + Docks any application into the system tray + + Поместить любое приложение в трей + + + + command Command to execute + + command Выполнить команду + + + + Options + Настройки + + + -a Show author information + -a Информация об авторе + + + -f Dock window that has the focus(active window) + -fПоместить в трей окно с фокусом (активное окно) + + + -h Display this help + -hПоказать справку + + + -i iconCustom dock Icon + -i iconДругой значек трея + + + -l Launch on startup + -lЗапуск при старте + + + -o Dock when obscured + -oПрятать при перекрытии + + + -q Disable ballooning title changes (quiet) + -qПрятать всплывающие подсказки + + + -t Remove this application from the task bar + -tУбрать приложение с панели задач + + + -w wid Window id of the application to dock + + -w widWindow id приложения для помещения в трей + + + + Bugs and wishes to gramakri@uiuc.edu + Ошибки и пожелания направляйте к gramakri@uiuc.edu + + + Project information at http://kdocker.sourceforge.net + Информация о проекте на http://kdocker.sourceforge.net + + + Caught signal %1. Cleaning up. + Получен сигнал %1. Очистка. + + + -d Disable session management + -dОтключить менеджер сессий + + + -m Keep application window mapped (dont hide on dock) + -mОставть приложение в панели задач (не прятать в трей) + + + -e Enable session management + -eВключить менеджер сессий + + + NOTE: Use -d for all startup scripts. + + ПРИМЕЧАНИЕ: Используйте ключ -d для всех скриптов. + + + + -b Dont warn about non-normal windows (blind mode) + + + + -v Display version + + + + kdocker: invalid option -- %1 + + + + -p secsSet ballooning timeout (popup time) + + + + + TrayLabelMgr + + About KDocker + + + + KDocker + + + + Girish Ramakrishnan (gramakri@uiuc.edu) + + + + This window is already docked. +Click on system tray icon to toggle docking. + Это окно уже в трее. +Кликните на иконке в трее для изменения статуса. + + + Failed to fork: %1 + + + + The System tray was hidden or removed + + + + Undock All + + + + Ignore + + + + Select the application/window to dock with button1. + Выберите приложение/окно для помещения в трей первой кнопкой мыши. + + + Click any other button to abort + + + + + Failed to exec [%1]: %2 + Невозможно выполнить [%1]: %2 + + + Bugs/wishes to Girish Ramakrishnan (gramakri@uiuc.edu) +English translation by Girish (gramakri@uiuc.edu) + +http://kdocker.sourceforge.net for updates + Ошибки/пожелания направляйте к Girish Ramakrishnan (gramakri@uiuc.edu) +Русский перевод Aleksey kirpichnikov (coder@paco.net) + +Обновления на http://kdocker.sourceforge.net + + + The window you are attempting to dock does not seem to be a normal window. + Окно которое Вы хотите поместить в трей не похоже на обычное окно. + + + diff --git a/i18n/kdocker_sv.qm b/i18n/kdocker_sv.qm new file mode 100644 index 0000000..58588ba Binary files /dev/null and b/i18n/kdocker_sv.qm differ diff --git a/i18n/kdocker_sv.ts b/i18n/kdocker_sv.ts new file mode 100644 index 0000000..b9427ec --- /dev/null +++ b/i18n/kdocker_sv.ts @@ -0,0 +1,336 @@ + + + CustomTrayLabel + + Launch on startup + Starta vid inloggning + + + Dock when obscured + Docka när undangömd + + + Dock when minimized + Docka när minimerad + + + Skip taskbar + Hoppa över åtgärdsrad + + + About KDocker + Om KDocker + + + Options + Flaggor + + + Dock Another + Docka en annan + + + Undock All + Avdocka alla + + + Undock + Avdocka + + + Close + Stäng + + + KDocker + KDocker + + + %1 is not a valid icon + %1 är inte en giltig ikon + + + Set Icon + Ställ in ikon + + + Dock when session restored + Docka när sessionen återställts + + + Show %1 + Visa %1 + + + Hide %1 + Dölj %1 + + + You cannot drop an item into the tray icon. Drop it on the window +that is brought in front when you hover the item over the tray icon + Du kan inte släppa ett objekt på brickans ikon. Släpp det på fönstret +som visas framför när du svävar objektet över brickans ikon + + + Set balloon timeout + Ställ in tidsgräns för ballongtext + + + Enter balloon timeout (secs). 0 to disable ballooning + Ange tidsgräns för ballongtext (sekunder). 0 för att inaktivera ballongtext + + + "%1" is not a valid executable or was not found in your $PATH + "%1" är inte en giltig körbar fil eller fanns inte i din $PATH + + + Select program + Välj program + + + Cancel + Avbryt + + + Dock when focus lost + + + + + KDocker + + Usage: KDocker [options] command + + Användning: KDocker [flaggor] kommando + + + + Docks any application into the system tray + + Dockar program i systembrickan + + + command Command to execute + + command Kommando att köra + + + + Options + Flaggor + + + -a Show author information + -a Visa information om upphovsmannen + + + -f Dock window that has the focus(active window) + -f Docka fönster som har fokus(aktivt fönster) + + + -h Display this help + -h Visa den här hjälpen + + + -i iconCustom dock Icon + -i iconCustom Ikon för docka + + + -l Launch on startup + -l Starta vid inloggning + + + -o Dock when obscured + -o Docka när undangömd + + + -q Disable ballooning title changes (quiet) + -q Inaktivera titeländring för ballongtext (tyst) + + + -t Remove this application from the task bar + -t Tar bort det här programmet från åtgärdsraden + + + -w wid Window id of the application to dock + + -w wid Fönstrets id-nummer för programmet att dock + + + Bugs and wishes to gramakri@uiuc.edu + Felrapporter och önskemål till gramakri@uiuc.edu + + + Project information at http://kdocker.sourceforge.net + Projektinformation på http://kdocker.sourceforge.net + + + Caught signal %1. Cleaning up. + Tog emot signal %1. Rensar upp. + + + -d Disable session management + -d Inaktivera sessionshantering + + + -m Keep application window mapped (dont hide on dock) + -m Behåll programfönstret mappat (dölj inte vid dockning) + + + -e Enable session management + -e Aktivera sessionshantering + + + NOTE: Use -d for all startup scripts. + + OBSERVERA: Använd -d för alla uppstartsskript. + + + + -b Dont warn about non-normal windows (blind mode) + -b Varna inte om icke-normala fönster (blindläge) + + + -v Display version + -v Visa version + + + kdocker: invalid option -- %1 + kdocker: ogiltig flagga -- %1 + + + -p secsSet ballooning timeout (popup time) + -p secsSet tidsgräns för ballongtext (popup-tid) + + + command Command to execute + + + + + -a Show author information + + + + -b Dont warn about non-normal windows (blind mode) + + + + -d Disable session management + + + + -e Enable session management + + + + -f Dock window that has the focus(active window) + + + + -h Display this help + + + + -i iconCustom dock Icon + + + + -l Launch on startup + + + + -m Keep application window mapped (dont hide on dock) + + + + -o Dock when obscured + + + + -p secsSet ballooning timeout (popup time) + + + + -q Disable ballooning title changes (quiet) + + + + -t Remove this application from the task bar + + + + -v Display version + + + + -w wid Window id of the application to dock + + + + + + TrayLabelMgr + + About KDocker + Om KDocker + + + KDocker + KDocker + + + Girish Ramakrishnan (gramakri@uiuc.edu) + Girish Ramakrishnan (gramakri@uiuc.edu) + + + This window is already docked. +Click on system tray icon to toggle docking. + Det här fönstret är redan dockat. +Klicka på systembricksikonen för att växla dockning. + + + Failed to fork: %1 + Misslyckades med att grena process: %1 + + + The System tray was hidden or removed + Systembrickan var dold eller borttagen + + + Undock All + Avdocka alla + + + Ignore + Ignorera + + + Select the application/window to dock with button1. + Välj programmet/fönstret att dock med knapp1. + + + Click any other button to abort + + Klicka på någon annan knapp för att avbryta + + + Failed to exec [%1]: %2 + Misslyckades med att köra [%1]: %2 + + + Bugs/wishes to Girish Ramakrishnan (gramakri@uiuc.edu) +English translation by Girish (gramakri@uiuc.edu) + +http://kdocker.sourceforge.net for updates + Felrapporter/önskemål till Girish Ramakrishnan (gramakri@uiuc.edu) +Svensk översättning av Daniel Nylander (po@danielnylander.se) + +http://kdocker.sourceforge.net för uppdateringar + + + The window you are attempting to dock does not seem to be a normal window. + Fönstret du försöker att docka verkar inte vara ett normalt fönster. + + + diff --git a/icons/anchor.xpm b/icons/anchor.xpm new file mode 100644 index 0000000..e47ed14 --- /dev/null +++ b/icons/anchor.xpm @@ -0,0 +1,45 @@ +/* XPM */ +static char *kdocker_xpm[]={ +"27 24 18 1", +". c None", +"b c #6e6e6e", +"g c #727272", +"h c #777777", +"i c #7a7a7a", +"e c #7b7b7b", +"f c #7c7c7c", +"# c #7d7d7d", +"d c #7e7e7e", +"c c #7f7f7f", +"j c #808080", +"n c #818181", +"a c #828282", +"l c #838383", +"m c #848484", +"k c #858585", +"o c #868686", +"p c #898989", +"...........................", +"...###.....a...............", +"..##b##...aaa..............", +"..##.c#..ada...............", +"..##e###afc................", +"...gh#f###a...........dda..", +"......ei###..........dddda.", +".....aafc###.........dddda.", +"....aaja.e###.........daa..", +"....aaa...####........daa..", +"...aaa.....###a.......daa..", +"....a.......d##k......cca..", +".............##al.....dca..", +"..............#aac....fca..", +"...............jaaj..#fma..", +"................naanaa#aa..", +".................kaaaana...", +"..................aaaao....", +".................aajamp....", +"..........a....aaaaaaco....", +".........aaaaaaaaaaa.......", +"........aaammlalaa.........", +".........aaaaaa............", +"..........a................"}; diff --git a/icons/kdocker.png b/icons/kdocker.png new file mode 100644 index 0000000..b001555 Binary files /dev/null and b/icons/kdocker.png differ diff --git a/icons/question.png b/icons/question.png new file mode 100644 index 0000000..56a353d Binary files /dev/null and b/icons/question.png differ diff --git a/kdocker.desktop b/kdocker.desktop new file mode 100644 index 0000000..bd05989 --- /dev/null +++ b/kdocker.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Name=KDocker +GenericName=Docking utility +Comment=Docks any application into system tray +Exec=kdocker +TryExec=kdocker +Icon=/usr/local/share/kdocker/icons/kdocker.png +Terminal=false +Type=Application +Categories=Application;Utility; diff --git a/kdocker.pro b/kdocker.pro new file mode 100644 index 0000000..df84449 --- /dev/null +++ b/kdocker.pro @@ -0,0 +1,62 @@ +TEMPLATE = app +DEPENDPATH += i18n src +INCLUDEPATH += . src /usr/include/X11 /usr/include/X11R6 +LIBPATH += /usr/X11/lib /usr/X11R6/lib +LIBS = -lX11 -lXpm -lXmu +TARGET = kdocker +INSTALL_PATH = /usr/local/share/kdocker +DOCS_PATH = $$INSTALL_PATH/docs + +# Defines +TRANSLATIONS_PATH = $$INSTALL_PATH/i18n +DEFINES += TRANSLATIONS_PATH='"$$TRANSLATIONS_PATH"' + +ICONS_PATH = $$INSTALL_PATH/icons +DEFINES += ICONS_PATH='"$$ICONS_PATH"' + +# Installation +icons.path = $$ICONS_PATH +icons.files = icons/kdocker.png icons/question.png + +translations.path = $$TRANSLATIONS_PATH +translations.files = i18n/*.qm + +docs.path = $$DOCS_PATH +docs.files = README + +desktop.path = /usr/share/applications +desktop.files = kdocker.desktop + +target.path = /usr/local/bin + +INSTALLS += target icons docs translations desktop + +# Input +HEADERS += src/customtraylabel.h \ + src/kdocker.h \ + src/qtraylabel.h \ + src/trace.h \ + src/traylabelmgr.h \ + src/util.h +SOURCES += src/customtraylabel.cpp \ + src/kdocker.cpp \ + src/main.cpp \ + src/qtraylabel.cpp \ + src/trace.cpp \ + src/traylabelmgr.cpp \ + src/util.cpp + +TRANSLATIONS += i18n/kdocker_en.ts i18n/kdocker_es.ts i18n/kdocker_fr.ts \ + i18n/kdocker_cs.ts i18n/kdocker_ru.ts i18n/kdocker_pt_BR.ts \ + i18n/kdocker_de.ts i18n/kdocker_pl.ts i18n/kdocker_id.ts \ + i18n/kdocker_it.ts i18n/kdocker_bg.ts i18n/kdocker_ja.ts \ + i18n/kdocker_nl.ts i18n/kdocker_hu.ts i18n/kdocker_sv.ts + +# Debugging (Uncomment line below and make clean; make") +# DEFINES += ENABLE_TRACING + +# Output +MOC_DIR = tmp +OBJECTS_DIR = tmp +DESTDIR = . + diff --git a/src/customtraylabel.cpp b/src/customtraylabel.cpp new file mode 100644 index 0000000..aca36e1 --- /dev/null +++ b/src/customtraylabel.cpp @@ -0,0 +1,360 @@ +/* + * Copyright (C) 2004 Girish Ramakrishnan All Rights Reserved. + * + * This 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 software 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 software; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, + * USA. + */ + +// $Id: customtraylabel.cpp,v 1.14 2005/06/21 10:04:35 cs19713 Exp $ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "trace.h" +#include "customtraylabel.h" +#include "traylabelmgr.h" +#include "kdocker.h" + +CustomTrayLabel::CustomTrayLabel(Window w, QWidget* p, const QString& t) + : QTrayLabel(w, p, t), mUndockWhenDead(false) +{ + installMenu(); +} + +CustomTrayLabel::CustomTrayLabel(const QStringList& argv, pid_t pid, + QWidget* parent) + : QTrayLabel(argv, pid, parent), mUndockWhenDead(false) +{ + installMenu(); +} + +/* + * Installs a popup menu on the tray label + */ +void CustomTrayLabel::installMenu() +{ + QPixmap kdocker_png(QString(ICONS_PATH) + "/kdocker.png"); + if (kdocker_png.isNull()) + kdocker_png.load(qApp->applicationDirPath() + "/icons/kdocker.png"); + setIcon(kdocker_png); + TrayLabelMgr *tlMgr = TrayLabelMgr::instance(); + + mOptionsMenu = new QPopupMenu(this); + mSessionManagement = new QAction(tr("Dock when session restored"), 0, this); + mSessionManagement->setToggleAction(true); + connect(mSessionManagement, SIGNAL(toggled(bool)), + this, SLOT(enableSessionManagement(bool))); + mSessionManagement->addTo(mOptionsMenu); + + mAutoLaunch = new QAction(tr("Launch on startup"), 0, this); + mAutoLaunch->setToggleAction(true); + connect(mAutoLaunch, SIGNAL(activated()), + this, SLOT(slotSetLaunchOnStartup())); + mAutoLaunch->addTo(mOptionsMenu); + + mOptionsMenu->insertItem(tr("Set Icon"), this, SLOT(setCustomIcon())); + + mBalloonTimeout = new QAction(tr("Set balloon timeout"), 0, this); + connect(mBalloonTimeout, SIGNAL(activated()), + this, SLOT(slotSetBalloonTimeout())); + mBalloonTimeout->addTo(mOptionsMenu); + + mDockWhenObscured = new QAction(tr("Dock when obscured"), 0, this); + mDockWhenObscured->setToggleAction(true); + connect(mDockWhenObscured, SIGNAL(toggled(bool)), + this, SLOT(setDockWhenObscured(bool))); + mDockWhenObscured->addTo(mOptionsMenu); + + mDockWhenMinimized = new QAction(tr("Dock when minimized"), 0, this); + mDockWhenMinimized->setToggleAction(true); + connect(mDockWhenMinimized, SIGNAL(toggled(bool)), + this, SLOT(setDockWhenMinimized(bool))); + mDockWhenMinimized->addTo(mOptionsMenu); + + mDockWhenFocusLost = new QAction(tr("Dock when focus lost"), 0, this); + mDockWhenFocusLost->setToggleAction(true); + connect(mDockWhenFocusLost, SIGNAL(toggled(bool)), + this, SLOT(setDockWhenFocusLost(bool))); + mDockWhenFocusLost->addTo(mOptionsMenu); + + mSkipTaskbar = new QAction(tr("Skip taskbar"), 0, this); + mSkipTaskbar->setToggleAction(true); + connect(mSkipTaskbar, SIGNAL(toggled(bool)), + this, SLOT(setSkipTaskbar(bool))); + mSkipTaskbar->addTo(mOptionsMenu); + + mMainMenu = new QPopupMenu(this); + mMainMenu->insertItem(QIconSet(kdocker_png), + tr("About KDocker"), tlMgr, SLOT(about())); + mMainMenu->insertSeparator(); + mMainMenu->insertItem(tr("Options"), mOptionsMenu); + mMainMenu->insertItem(tr("Dock Another"), tlMgr, SLOT(dockAnother())); + mMainMenu->insertItem(tr("Undock All"), tlMgr, SLOT(undockAll())); + mMainMenu->insertSeparator(); + + mShowId = mMainMenu->insertItem(QString("Show/Hide [untitled]"), + this, SLOT(toggleShow())); + mMainMenu->insertItem(QString(tr("Undock")), this, SLOT(undock())); + mMainMenu->insertItem(QString(tr("Close")), this, SLOT(close())); + + connect(mMainMenu, SIGNAL(aboutToShow()), this, SLOT(updateMenu())); + + // Apply defaults here + setLaunchOnStartup(false); + setDockWhenObscured(false); + enableSessionManagement(true); + mDockWhenMinimized->setOn(isDockWhenMinimized()); + mSkipTaskbar->setOn(isSkippingTaskbar()); + setAcceptDrops(true); // and you thought this function only installs the menu +} + +/* + * Session Management + */ +bool CustomTrayLabel::restoreState(QSettings& settings) +{ + mAutoLaunch->setOn(settings.readBoolEntry("/LaunchOnStartup")); + setDockWhenObscured(settings.readBoolEntry("/DockWhenObscured")); + TRACE("AutoLaunch=%i DWM=%i DWO=%i", isLaunchOnStartup(), + isDockWhenMinimized(), isDockWhenObscured()); + return QTrayLabel::restoreState(settings); +} + +bool CustomTrayLabel::saveState(QSettings& settings) +{ + if (!mSessionManagement->isOn()) return false; + + QTrayLabel::saveState(settings); + settings.writeEntry("/LaunchOnStartup", isLaunchOnStartup()); + settings.writeEntry("/DockWhenObscured", isDockWhenObscured()); + TRACE("AutoLaunch=%i DWM=%i DWO=%i", isLaunchOnStartup(), + isDockWhenMinimized(), isDockWhenObscured()); + return true; +} + +static bool which(const char *app) +{ + if (access(app, X_OK) == 0) return true; + + // Check if the program exist in the $PATH + char *path = strdup(getenv("PATH")); + char prog[300]; + if (path == NULL) return false; + TRACE("PATH=%s", path); + char *p = strtok(path, ":"); + while (p != NULL) + { + snprintf(prog, sizeof(prog), "%s/%s", p, app); + if (access(prog, X_OK) == 0) break; + p = strtok(NULL, ":"); + } + free(path); + TRACE("Located at (%s)", p); + return p != NULL; +} + +// Overridden to update our menu +void CustomTrayLabel::setDockWhenMinimized(bool dwm) +{ + QTrayLabel::setDockWhenMinimized(dwm); + mDockWhenMinimized->setOn(isDockWhenMinimized()); +} + +void CustomTrayLabel::setSkipTaskbar(bool skip) +{ + QTrayLabel::setSkipTaskbar(skip); + mSkipTaskbar->setOn(isSkippingTaskbar()); +} + +void CustomTrayLabel::setAppName(const QString& name) +{ + QTrayLabel::setAppName(name.lower()); +} + +/* + * This function is called when QTrayLabel wants to know whether it can + * unsubscribe from root window. This is because it doesnt know if someone + * else is interested in root window events + */ +bool CustomTrayLabel::canUnsubscribeFromRoot(void) +{ + return (TrayLabelMgr::instance())->hiddenLabelsCount() == 0; +} + +// Get icon from user, load it and if successful load it. +void CustomTrayLabel::setCustomIcon(void) +{ + QString icon; + + while (true) + { + // Nag the user to give us a valid icon or press cancel + icon = QFileDialog::getOpenFileName(); + if (icon.isNull()) return; // user cancelled + if (!QPixmap(icon).isNull()) break; + TRACE("Attempting to set icon to %s", icon.latin1()); + QMessageBox::critical(this, tr("KDocker"), + tr("%1 is not a valid icon").arg(icon)); + } + + setTrayIcon(icon); +} + +// Get balloon timeout from the user +void CustomTrayLabel::slotSetBalloonTimeout(void) +{ + bool ok; + int timeout = QInputDialog::getInteger(tr("KDocker"), + tr("Enter balloon timeout (secs). 0 to disable ballooning"), + balloonTimeout()/1000, 0, 60, 1, &ok); + + if (!ok) return; + setBalloonTimeout(timeout * 1000); +} + +void CustomTrayLabel::setLaunchOnStartup(bool launch) +{ + mAutoLaunch->setOn(launch); + slotSetLaunchOnStartup(); // fake an "activated" signal +} + +void CustomTrayLabel::slotSetLaunchOnStartup() +{ + TRACE("%i", mAutoLaunch->isOn()); + if (!mAutoLaunch->isOn()) return; + QString app = appName(); + + TRACE("Validating %s", app.latin1()); + + while (true) + { + if (which(app.latin1())) + { + TRACE("Autolaunch enabled to %s", app.latin1()); + setAppName(app); + mAutoLaunch->setOn(true); + return; + } + + // Request user to provide file name himself + if (QMessageBox::critical(NULL, tr("KDocker"), + tr("\"%1\" is not a valid executable " + "or was not found in your $PATH").arg(app), + tr("Select program"), tr("Cancel")) == 1) + { + mAutoLaunch->setOn(false); + return; // cancelled + } + + app = QFileDialog::getOpenFileName(); + if (app.isNull()) + { + TRACE("Disabling auto launch"); + mAutoLaunch->setOn(false); + return; + } + } +} + +// Called when we are just about to display the menu +void CustomTrayLabel::updateMenu(void) +{ + QString title = appClass(); // + "(" + appTitle() + ")"; + mMainMenu->changeItem(mShowId, QIconSet(*pixmap()), + QString((isWithdrawn() ? tr("Show %1") : tr("Hide %1")).arg(title))); +} + +void CustomTrayLabel::mapEvent(void) +{ + TRACE("mapEvent"); + if (mDockWhenObscured->isOn()) + { + /* + * We get a obscured event for the time between the map and focus in of + * the window. So we disable it for sometime and reanable. + */ + mDockWhenObscured->setOn(false); + QTimer::singleShot(800, mDockWhenObscured, SLOT(toggle())); + TRACE("Turning off DWO for some time"); + } +} + +void CustomTrayLabel::obscureEvent(void) +{ + TRACE("obscureEvent"); + if (mDockWhenObscured->isOn() && !isWithdrawn()) + withdraw(); +} + +void CustomTrayLabel::focusLostEvent() +{ + if (mDockWhenFocusLost->isOn()) withdraw(); +} + +void CustomTrayLabel::mouseReleaseEvent(QMouseEvent * ev) +{ + if (ev->button() == Qt::RightButton) + mMainMenu->popup(ev->globalPos()); + else + toggleShow(); +} + +void CustomTrayLabel::destroyEvent(void) +{ + mUndockWhenDead = true; + QTrayLabel::destroyEvent(); +} + +void CustomTrayLabel::processDead(void) +{ + /* + * This is a ugly hack but worth every but of ugliness IMO ;). + * Lets say, an instance of xmms, already exists. You type kdocker xmms. + * KDocker launches xmms. xmms cowardly exists seeing its previous instance. + * Wouldnt it be nice now to dock the previous instance of xmms automatically. + * This is more common than you think (think of session restoration) + */ + + if (!mUndockWhenDead) + { + scanClients(); + if (dockedWindow() != None) return; + } + undock(); +} + +/* + * Can dock this window iff not docked by another one tray label already + */ +bool CustomTrayLabel::canDockWindow(Window w) +{ + TRACE("Checking if 0x%x is already docked", (unsigned) w); + return !(TrayLabelMgr::instance()->isWindowDocked(w)); +} + +void CustomTrayLabel::dropEvent(QDropEvent *) +{ + QMessageBox::information(NULL, "KDocker", + tr("You cannot drop an item into the tray icon. Drop it on the window\n" + "that is brought in front when you hover the item over the tray icon")); +} + diff --git a/src/customtraylabel.h b/src/customtraylabel.h new file mode 100644 index 0000000..c12bcc2 --- /dev/null +++ b/src/customtraylabel.h @@ -0,0 +1,90 @@ +/* + * Copyright (C) 2004 Girish Ramakrishnan All Rights Reserved. + * + * This 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 software 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 software; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, + * USA. + */ + +// $Id: customtraylabel.h,v 1.10 2007/01/02 21:48:37 cs19713 Exp $ + +#ifndef _CUSTOMTRAYLABEL_H +#define _CUSTOMTRAYLABEL_H + +#include +#include +#include "qtraylabel.h" + +class QStringList; +class QPopupMenu; +class QString; +class QSettings; +class QWidget; +class QDropEvent; + +class CustomTrayLabel : public QTrayLabel +{ + Q_OBJECT + +public: + CustomTrayLabel(Window w, QWidget* p = 0, const QString& t = QString::null); + CustomTrayLabel(const QStringList& argv, pid_t pid, QWidget* parent = 0); + + // Session management + bool saveState(QSettings& settings); + bool restoreState(QSettings& settings); + + bool isLaunchOnStartup(void) const { return mAutoLaunch->isOn(); } + bool isDockWhenObscured(void) const { return mDockWhenObscured->isOn(); } + + void setAppName(const QString& name); + +public slots: + // overridden to update our menu + void setDockWhenMinimized(bool dwm); + void setDockWhenFocusLost(bool dfl) { mDockWhenFocusLost->setOn(dfl); } + void setSkipTaskbar(bool skip); + + void setLaunchOnStartup(bool launch); + void setDockWhenObscured(bool dock) { mDockWhenObscured->setOn(dock); } + void enableSessionManagement(bool sm) { mSessionManagement->setOn(sm); } + +protected: + void dropEvent(QDropEvent *ev); + bool canUnsubscribeFromRoot(void); + void mapEvent(void); + void focusLostEvent(); + void obscureEvent(void); + void destroyEvent(void); + void mouseReleaseEvent(QMouseEvent * ev); + bool canDockWindow(Window w); + void processDead(void); + +private slots: + void setCustomIcon(void); + void updateMenu(); + void slotSetBalloonTimeout(void); + void slotSetLaunchOnStartup(void); + +private: + void installMenu(); + bool mUndockWhenDead; + QPopupMenu *mOptionsMenu, *mMainMenu; + QAction *mDockOnRestore, *mAutoLaunch, *mBalloonTimeout, *mSkipTaskbar, + *mDockWhenMinimized, *mDockWhenObscured, *mSessionManagement, + *mDockWhenFocusLost; + int mShowId; +}; + +#endif // _CUSTOMTRAYLABEL_H diff --git a/src/kdocker.cpp b/src/kdocker.cpp new file mode 100644 index 0000000..40cf00a --- /dev/null +++ b/src/kdocker.cpp @@ -0,0 +1,249 @@ +/* + * Copyright (C) 2004 Girish Ramakrishnan All Rights Reserved. + * + * This 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 software 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 software; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, + * USA. + */ + +// $Id: kdocker.cpp,v 1.24 2005/02/04 10:25:46 cs19713 Exp $ + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "trace.h" +#include "traylabelmgr.h" +#include "kdocker.h" + +#include +#include +#include +#include +#include + +// #define TMPFILE_PREFIX QString("/tmp/kdocker.") +#define TMPFILE_PREFIX QDir::homeDirPath() + "/.kdocker." + +KDocker::KDocker(int& argc, char** argv) + :QApplication(argc, argv), mTrayLabelMgr(0) +{ + INIT_TRACE(); + + /* + * Load localisation strings. Most examples I have seen load QTranslator + * in main(). As a result the translator object lingers around till the end + * of the program. I tried the same thing here and all i got was translations + * for usage(). You dont want to know about the sleepless night i spent + * trying to figure this out (yup, the source helped) + */ + QTranslator *translator = new QTranslator(0); + QString f = QString("kdocker_") + QTextCodec::locale(); + + if (!translator->load(f, QString(TRANSLATIONS_PATH)) && + !translator->load(f, applicationDirPath() + "/i18n") && + !translator->load(f, QDir::currentDirPath() + "/i18n")) { + qDebug("Sorry, your locale is not supported. If you are interested " + "in providing translations for your locale, contact " + "gramakri@uiuc.edu\n"); + } + installTranslator(translator); + + // Attempt doing anything only if the CLI arguments were good + opterr = 0; // suppress the warning + int option; + while ((option = getopt(argc, argv, TrayLabelMgr::options().latin1())) != EOF) + { + if (option == '?') + { + if (optopt == 'v') printVersion(); else printUsage(optopt); + ::exit(0); + } + } + + /* + * Detect and transfer control to previous instance (if one exists) + * _KDOCKER_RUNNING is a X Selection. We start out by trying to locate the + * selection owner. If someone else owns it, transfer control to that + * instance of KDocker + */ + Display *display = QPaintDevice::x11AppDisplay(); + Atom kdocker = XInternAtom(display, "_KDOCKER_RUNNING", False); + Window prev_instance = XGetSelectionOwner(display, kdocker); + + if (prev_instance == None) + { + mSelectionOwner = XCreateSimpleWindow(display, qt_xrootwin(), 1, 1, 1, + 1, 1, 1, 1); + XSetSelectionOwner(display, kdocker, mSelectionOwner, CurrentTime); + TRACE("Selection owner set to 0x%x", (unsigned) mSelectionOwner); + mTrayLabelMgr = TrayLabelMgr::instance(); + } + else + notifyPreviousInstance(prev_instance); // does not return +} + +void KDocker::printVersion(void) +{ + qDebug("Qt: %s", qVersion()); + qDebug("KDocker: %s", KDOCKER_APP_VERSION); +} + +// Prints the CLI arguments. Does not return +void KDocker::printUsage(char optopt) +{ + if (optopt != 'h') qDebug(tr("kdocker: invalid option -- %1").arg(optopt)); + + qDebug(tr("Usage: KDocker [options] command\n")); + qDebug(tr("Docks any application into the system tray\n")); + qDebug(tr("command \tCommand to execute\n")); + qDebug(tr("Options")); + qDebug(tr("-a \tShow author information")); + qDebug(tr("-b \tDont warn about non-normal windows (blind mode)")); + qDebug(tr("-d \tDisable session management")); + qDebug(tr("-e \tEnable session management")); + qDebug(tr("-f \tDock window that has the focus(active window)")); + qDebug(tr("-h \tDisplay this help")); + qDebug(tr("-i icon\tCustom dock Icon")); + qDebug(tr("-l \tLaunch on startup")); + qDebug(tr("-m \tKeep application window mapped (dont hide on dock)")); + qDebug(tr("-o \tDock when obscured")); + qDebug(tr("-p secs\tSet ballooning timeout (popup time)")); + qDebug(tr("-q \tDisable ballooning title changes (quiet)")); + qDebug(tr("-t \tRemove this application from the task bar")); + qDebug(tr("-v \tDisplay version")); + qDebug(tr("-w wid \tWindow id of the application to dock\n")); + + qDebug(tr("NOTE: Use -d for all startup scripts.\n")); + + qDebug(tr("Bugs and wishes to gramakri@uiuc.edu")); + qDebug(tr("Project information at http://kdocker.sourceforge.net")); +} + +void KDocker::notifyPreviousInstance(Window prevInstance) +{ + Display *display = QPaintDevice::x11AppDisplay(); + + TRACE("Notifying previous instance [%x]", (unsigned) prevInstance); + + // Dump all arguments in temporary file + QFile f(TMPFILE_PREFIX + QString().setNum(getpid())); + if (!f.open(IO_WriteOnly)) return; + QTextStream s(&f); + + /* + * Its normal to use KDocker in startup scripts. We could be getting restored + * from a session at the same time. So, if we were getting restored and + * another instance already exists, send across the session id. Remember, qt + * strips out all the arguments that it understands. So need to do it by hand. + */ + if (isSessionRestored()) + s << argv()[0] << " " << "-session" << " " << sessionId(); + else + for (int i = 0; i < argc(); i++) s << argv()[i] << " "; + + f.close(); + + /* + * Now tell our previous instance that we came to pass. Actually, it can + * figure it out itself using PropertyNotify events but this is a lot nicer + */ + XClientMessageEvent dock_event; + memset(&dock_event, 0, sizeof(XClientMessageEvent)); + dock_event.display = display; + dock_event.window = prevInstance; + dock_event.send_event = True; + dock_event.type = ClientMessage; + dock_event.message_type = 0x220679; // it all started this day + dock_event.format = 8; + dock_event.data.l[0] = 0xBABE; // love letter ;) + dock_event.data.l[1] = getpid(); + XSendEvent(display, prevInstance, False, 0, (XEvent *) &dock_event); + XSync(display, False); + + ::exit(0); +} + +/* + * The X11 Event filter called by Qt. Look out for ClientMessage events from + * our new instance + */ +bool KDocker::x11EventFilter(XEvent * event) +{ + if (event->type == ClientMessage) + { + // look for requests from a new instance of kdocker + XClientMessageEvent *client = (XClientMessageEvent *) event; + if (!(client->message_type == 0x220679 && client->data.l[0] == 0xBABE)) + return FALSE; + + TRACE("ClientMessage from PID=%ld. SelOwn=0x%x", + client->data.l[1], (unsigned) mSelectionOwner); + char tmp[50]; + struct stat buf; + sprintf(tmp, TMPFILE_PREFIX "%ld", client->data.l[1]); + if (stat(tmp, &buf) || (getuid()!=buf.st_uid)) + { + /* + * We make sure that the owner of this process and the owner of the file + * are the same. This will prevent someone from executing arbitrary + * programs by sending client message. Of course, you can send a message + * only if you are authenticated to the X session and have permission to + * create files in TMPFILE_PREFIX. So this code is there just for the + * heck of it. + */ + TRACE("User %i is trying something fishy...", buf.st_uid); + unlink(tmp); + return TRUE; + } + QFile f(tmp); + if (!f.open(IO_ReadOnly)) return TRUE; + QTextStream s(&f); + QStringList argv; + while (!s.atEnd()) { QString x; s >> x; argv += x; } + f.close(); + unlink(tmp); // delete the tmp file + mTrayLabelMgr->processCommand(argv); + return TRUE; + } + else return mTrayLabelMgr->x11EventFilter(event); +} + +/* + * XSMP Support + */ +void KDocker::saveState(QSessionManager &sm) +{ + QString sf = mTrayLabelMgr->saveSession(); + + QStringList discard_command; + discard_command << "rm" << sf; + sm.setDiscardCommand(discard_command); + + sm.setRestartHint(QSessionManager::RestartIfRunning); + QStringList restart_command; + restart_command << this->argv()[0] + << "-session" << sm.sessionId(); + sm.setRestartCommand(restart_command); + + TRACE("SessionFile=%s AppName=%s", sf.latin1(), this->argv()[0]); + DUMP_TRACE(QDir::homeDirPath() + "/kdocker.trace"); + // sm.setRestartCommand(applicationFilePath()); +} + diff --git a/src/kdocker.h b/src/kdocker.h new file mode 100644 index 0000000..f3126c3 --- /dev/null +++ b/src/kdocker.h @@ -0,0 +1,59 @@ +/* + * Copyright (C) 2004 Girish Ramakrishnan All Rights Reserved. + * + * This 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 software 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 software; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, + * USA. + */ + +// $Id: kdocker.h,v 1.11 2005/02/09 03:32:26 cs19713 Exp $ + +#ifndef _KDOCKER_H +#define _KDOCKER_H + +#include +#include + +#define KDOCKER_APP_VERSION "1.3" + +class TrayLabelMgr; + +class KDocker : public QApplication +{ + Q_OBJECT + +public: + KDocker(int& argc, char** argv); + + TrayLabelMgr *trayLabelMgr(void) { return mTrayLabelMgr; } + + void dumpState(const QString &file); + void printUsage(char optopt = 'h'); + +protected: + bool x11EventFilter(XEvent * event); + void saveState(QSessionManager &sm); + +private: + QString saveSession(); + bool restoreSession(); + void notifyPreviousInstance(Window prevInstance); + + void printVersion(); + + Window mSelectionOwner; + TrayLabelMgr *mTrayLabelMgr; +}; + +#endif // _KDOCKER_H diff --git a/src/kdocker.xpm b/src/kdocker.xpm new file mode 100644 index 0000000..63fb2fa --- /dev/null +++ b/src/kdocker.xpm @@ -0,0 +1,304 @@ +/* XPM */ +static char * kdocker_xpm[] = { +"24 24 277 2", +" c None", +". c #0080FF", +"+ c #007AF3", +"@ c #349AFF", +"# c #43A2FF", +"$ c #43A1FE", +"% c #3694F2", +"& c #3B9AF8", +"* c #409FFD", +"= c #3F9EFD", +"- c #3E9EFC", +"; c #3E9DFC", +"> c #1F87ED", +", c #C5E2FE", +"' c #FEFEFE", +") c #E2E5E4", +"! c #267126", +"~ c #206D20", +"{ c #327734", +"] c #518754", +"^ c #82A688", +"/ c #BECBC9", +"( c #DDE4EB", +"_ c #74AEE8", +": c #FAFBFC", +"< c #EDF0F2", +"[ c #8DAD92", +"} c #3B7B3D", +"| c #045F05", +"1 c #005D00", +"2 c #025F02", +"3 c #056005", +"4 c #37793C", +"5 c #3D7F94", +"6 c #F5F7FA", +"7 c #F0F3F8", +"8 c #EBF0F5", +"9 c #E0E6ED", +"0 c #ADC0B9", +"a c #3B7B40", +"b c #046004", +"c c #539A48", +"d c #4A9243", +"e c #025E03", +"f c #005100", +"g c #FBFCFD", +"h c #F6F8FA", +"i c #F0F4F8", +"j c #E5ECF3", +"k c #E1E8F1", +"l c #DCE5EE", +"m c #D0DAE4", +"n c #6D977A", +"o c #82BB73", +"p c #ADD69F", +"q c #21741F", +"r c #005700", +"s c #FDFDFE", +"t c #F8F9FB", +"u c #F2F5F9", +"v c #ECF1F6", +"w c #E7EDF3", +"x c #E1E9F1", +"y c #D6E1EC", +"z c #D1DDEA", +"A c #CAD6E4", +"B c #679276", +"C c #096308", +"D c #AEDB9B", +"E c #CDEBBE", +"F c #2E7C2B", +"G c #005600", +"H c #EFF3F7", +"I c #E9EFF5", +"J c #E3EAF2", +"K c #DDE6EF", +"L c #D8E2EC", +"M c #D2DDEA", +"N c #CDD9E7", +"O c #C7D6E5", +"P c #BBCADA", +"Q c #307339", +"R c #3E8B35", +"S c #D2F5BA", +"T c #C7E6B9", +"U c #136A12", +"V c #004C00", +"W c #F9FBFC", +"X c #F3F6F9", +"Y c #EDF1F6", +"Z c #DBE4EE", +"` c #D5DFEB", +" . c #CFDBE8", +".. c #C9D7E6", +"+. c #C3D2E3", +"@. c #BECEE0", +"#. c #82A29C", +"$. c #035F02", +"%. c #B0E294", +"&. c #D4F5BD", +"*. c #88BB7E", +"=. c #005B00", +"-. c #C5E1FE", +";. c #F8FAFB", +">. c #ECF0F6", +",. c #DFE7F0", +"'. c #D9E3ED", +"). c #D3DEEA", +"!. c #C6D5E4", +"~. c #C0D0E2", +"{. c #BACCDF", +"]. c #A8BBCD", +"^. c #116415", +"/. c #74BA5C", +"(. c #C5F2A7", +"_. c #D1F2BB", +":. c #156B13", +"<. c #C4E1FE", +"[. c #F2F5F8", +"}. c #E5EBF3", +"|. c #D9E2ED", +"1. c #D2DEEA", +"2. c #CCD9E7", +"3. c #C6D4E4", +"4. c #BFD0E1", +"5. c #B6C7DA", +"6. c #ACBFD3", +"7. c #286E32", +"8. c #52A23C", +"9. c #B7EF90", +"0. c #C7F3AA", +"a. c #559B4C", +"b. c #005400", +"c. c #70B5F8", +"d. c #8CC1F5", +"e. c #89BEF3", +"f. c #85BCF2", +"g. c #82B9F0", +"h. c #7EB6EE", +"i. c #7BB4ED", +"j. c #77B1EB", +"k. c #74AFEA", +"l. c #70ACE8", +"m. c #689FD6", +"n. c #2E7138", +"o. c #276E30", +"p. c #0E6312", +"q. c #449B2D", +"r. c #A8EC79", +"s. c #B9F093", +"t. c #7BBA68", +"u. c #004E00", +"v. c #004D00", +"w. c #096702", +"x. c #359A13", +"y. c #6AC739", +"z. c #99E963", +"A. c #AAED7C", +"B. c #9EDB7E", +"C. c #3B8932", +"D. c #196F16", +"E. c #005C00", +"F. c #015D00", +"G. c #4DB915", +"H. c #7AE233", +"I. c #8BE64C", +"J. c #9BEA66", +"K. c #ACED80", +"L. c #AFE68E", +"M. c #176E14", +"N. c #005000", +"O. c #0E6F02", +"P. c #68DB1B", +"Q. c #7CE335", +"R. c #8DE64F", +"S. c #9DE968", +"T. c #3D902D", +"U. c #005800", +"V. c #005A00", +"W. c #319D07", +"X. c #6DE01F", +"Y. c #7EE338", +"Z. c #5EB835", +"`. c #046200", +" + c #52CA09", +".+ c #65D41E", +"++ c #0A6805", +"@+ c #9C9CA1", +"#+ c #95959A", +"$+ c #E0E0E1", +"%+ c #C7C7C9", +"&+ c #CDCDCF", +"*+ c #005500", +"=+ c #1A8100", +"-+ c #1C8302", +";+ c #BAB9BA", +">+ c #F2DEC0", +",+ c #F8F8F9", +"'+ c #EBEBED", +")+ c #065F06", +"!+ c #086007", +"~+ c #B8B6B3", +"{+ c #E0CDAC", +"]+ c #FAD468", +"^+ c #EFE9D9", +"/+ c #E5DBBD", +"(+ c #B5B5BF", +"_+ c #C5C3B7", +":+ c #BEC1B4", +"<+ c #85A0A1", +"[+ c #B6BDB7", +"}+ c #E1DECF", +"|+ c #D3D1C3", +"1+ c #AABFCA", +"2+ c #307877", +"3+ c #367B7F", +"4+ c #98B0C1", +"5+ c #CCC9BC", +"6+ c #B8B4AC", +"7+ c #958E9D", +"8+ c #BCBAAE", +"9+ c #BEBCAF", +"0+ c #D5D2C4", +"a+ c #BAB4A8", +"b+ c #F3E055", +"c+ c #E8E2AA", +"d+ c #DEC768", +"e+ c #9998A1", +"f+ c #CAC7BA", +"g+ c #77966A", +"h+ c #67A18A", +"i+ c #3B82AB", +"j+ c #D8D6C8", +"k+ c #D3D0C3", +"l+ c #DBE3E4", +"m+ c #F5F8FA", +"n+ c #E2E9F1", +"o+ c #B0BEC8", +"p+ c #8A5593", +"q+ c #8C3BA2", +"r+ c #9687B4", +"s+ c #C5C2B5", +"t+ c #DCDACB", +"u+ c #AFAEB0", +"v+ c #B1ADA8", +"w+ c #C2BBB0", +"x+ c #ADACAE", +"y+ c #B0AEAB", +"z+ c #DDDACB", +"A+ c #729472", +"B+ c #609F92", +"C+ c #3C82AC", +"D+ c #D9D6C8", +"E+ c #D9E2E4", +"F+ c #E6EDF4", +"G+ c #CBD9E7", +"H+ c #A1B3C2", +"I+ c #915A8A", +"J+ c #8C2E8C", +"K+ c #9F8EAF", +"L+ c #DFDCCD", +"M+ c #CDCBBE", +"N+ c #B5B3B0", +"O+ c #E0DDCE", +"P+ c #C2C4B8", +"Q+ c #89A2A6", +"R+ c #BBC0B9", +"S+ c #D5D3C5", +"T+ c #C4C7BF", +"U+ c #AAB2B1", +"V+ c #A6AEAE", +"W+ c #ADB2AD", +"X+ c #CAC8BA", +"Y+ c #C1BEB2", +"Z+ c #A7A19D", +"`+ c #C2C0B3", +" @ c #C2BFB2", +" ", +" . . . . . . . . . . . . . + ", +" @ # # # # $ % % & * = - ; > ", +" , ' ' ' ' ) ! ~ { ] ^ / ( _ ", +" , ' ' ' : < [ } | 1 2 3 4 5 ", +" , ' ' : 6 7 8 9 0 a b c d e f ", +" , ' g h i 8 j k l m n 3 o p q r ", +" , s t u v w x l y z A B C D E F G ", +" , g 6 H I J K L M N O P Q R S T U V ", +" , W X Y w k Z ` ...+.@.#.$.%.&.*.=. ", +" -.;.u >.j ,.'.).N !.~.{.].^./.(._.:. ", +" <.t [.8 }.,.|.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. ", +" G w.x.y.z.A.B.C.D.E. ", +" F.G.H.I.J.K.L.M.N. ", +" N.O.P.Q.R.S.T.U. ", +" V.W.X.Y.Z.F. ", +" `. +.+++v. ", +" @+#+$+%+&+ *+=+-+r ", +" ;+>+,+'+ )+!+ ", +"~+{+]+^+/+(+_+:+<+[+}+}+}+}+|+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+}+}+}+k+E+F+G+H+}+I+J+K+s+", +"}+L+M+N+O+L+}+P+Q+R+}+}+}+}+S+T+U+V+W+X+Y+Z+`+ @"}; diff --git a/src/main.cpp b/src/main.cpp new file mode 100644 index 0000000..e507079 --- /dev/null +++ b/src/main.cpp @@ -0,0 +1,56 @@ +/* + * Copyright (C) 2004 Girish Ramakrishnan All Rights Reserved. + * + * This 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 software 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 software; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, + * USA. + */ + +// $Id: main.cpp,v 1.7 2004/11/08 07:14:18 cs19713 Exp $ + +#include +#include +#include +#include + +#include +#include "kdocker.h" +#include "traylabelmgr.h" +#include "trace.h" +#include + +static void sighandler(int sig) +{ + if (sig == SIGUSR1) + { + DUMP_TRACE(QDir::homeDirPath() + "/kdocker.trace"); + return; + } + + qDebug(qApp->translate("KDocker", "Caught signal %1. Cleaning up.").arg(sig)); + ((KDocker *)qApp)->trayLabelMgr()->undockAll(); +} + +int main(int argc, char *argv[]) +{ + // setup signal handlers that undock and quit + signal(SIGHUP, sighandler); + signal(SIGSEGV, sighandler); + signal(SIGTERM, sighandler); + signal(SIGINT, sighandler); + signal(SIGUSR1, sighandler); + + KDocker app(argc, argv); + return app.exec(); +} diff --git a/src/qtraylabel.cpp b/src/qtraylabel.cpp new file mode 100644 index 0000000..c3daaa3 --- /dev/null +++ b/src/qtraylabel.cpp @@ -0,0 +1,809 @@ +/* + * Copyright (C) 2004 Girish Ramakrishnan All Rights Reserved. + * + * This 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 software 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 software; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, + * USA. + */ + +// $Id: qtraylabel.cpp,v 1.31 2005/06/21 10:04:36 cs19713 Exp $ + +// Include all Qt includes before X +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "trace.h" +#include "qtraylabel.h" + +#include +#include +#include + +#include +#include +#include +#include + +#include "util.h" + +void QTrayLabel::initialize(void) +{ + mDocked = false; + mWithdrawn = true; + mBalloonTimeout = 4000; + mSkippingTaskbar = false; + mDockWhenMinimized = true; + mDesktop = 666; // setDockedWindow would set it a saner value + + // Balloon's properties are set to match a Qt tool tip (see Qt source) + mBalloon = new QLabel(0, "balloon", WType_TopLevel | WStyle_StaysOnTop | + WStyle_Customize | WStyle_NoBorder | + WStyle_Tool | WX11BypassWM); + mBalloon->setFont(QToolTip::font()); + mBalloon->setPalette(QToolTip::palette()); + mBalloon->setAlignment(Qt::AlignLeft | Qt::AlignTop); + mBalloon->setAutoMask(FALSE); + mBalloon->setAutoResize(true); + setAlignment(Qt::AlignCenter); + setBackgroundMode(X11ParentRelative); + + connect(&mRealityMonitor, SIGNAL(timeout()), this, SLOT(realityCheck())); + setDockedWindow(mDockedWindow); + + sysTrayStatus(QPaintDevice::x11AppDisplay(), &mSysTray); + // Subscribe to system tray window notifications + if (mSysTray != None) + subscribe(QPaintDevice::x11AppDisplay(), mSysTray, + StructureNotifyMask, true); +} + +// Describe ourselves in a few words +const char *QTrayLabel::me(void) const +{ + static char temp[100]; + snprintf(temp, sizeof(temp), "(%s,PID=%i,WID=0x%x)", + mProgName[0].latin1(), mPid, (unsigned) mDockedWindow); + return temp; +} + +QTrayLabel::QTrayLabel(Window w, QWidget* parent, const QString& text) + :QLabel(parent, text, WStyle_Customize | WStyle_NoBorder | WStyle_Tool), + mDockedWindow(w), mPid(0) +{ + initialize(); +} + +QTrayLabel::QTrayLabel(const QStringList& pname, pid_t pid, QWidget* parent) + :QLabel(parent, "TrayLabel", WStyle_Customize | WStyle_NoBorder | WStyle_Tool), + mDockedWindow(None), mProgName(pname), mPid(pid) +{ + if (pname[0].at(0) != '/' && pname[0].find('/', 1) > 0) + mProgName[0] = QFileInfo(pname[0]).absFilePath(); // convert to absolute + initialize(); +} + +QTrayLabel::~QTrayLabel() +{ + TRACE("%s Goodbye", me()); + if (mDockedWindow == None) return; + // Leave the docked window is some sane state + mSkippingTaskbar = false; + skipTaskbar(); + map(); +} + +/* + * Scans the windows in the desktop and checks if a window exists that we might + * be interested in + */ +void QTrayLabel::scanClients() +{ + Window r, parent, *children; + unsigned nchildren = 0; + Display *display = QPaintDevice::x11AppDisplay(); + QString ename = QFileInfo(mProgName[0]).fileName(); // strip out the path + + XQueryTree(display, qt_xrootwin(), &r, &parent, &children, &nchildren); + TRACE("%s nchildren=%i", me(), nchildren); + for(unsigned i=0; iNormal state change code does not map them. So we make the + * window go through Withdrawn->Iconify->Normal state. + */ + XWMHints *wm_hint = XGetWMHints(display, mDockedWindow); + if (wm_hint) + { + wm_hint->initial_state = IconicState; + XSetWMHints(display, mDockedWindow, wm_hint); + XFree(wm_hint); + } + + XMapWindow(display, mDockedWindow); + mSizeHint.flags = USPosition; // Obsolete ? + XSetWMNormalHints(display, mDockedWindow, &mSizeHint); + // make it the active window + long l[5] = { None, CurrentTime, None, 0, 0 }; + sendMessage(display, qt_xrootwin(), mDockedWindow, "_NET_ACTIVE_WINDOW", 32, + SubstructureNotifyMask | SubstructureRedirectMask, l, sizeof(l)); + // skipTaskbar modifies _NET_WM_STATE. Make sure we dont override WMs value + QTimer::singleShot(230, this, SLOT(skipTaskbar())); + // disable docking when minized for some time (since we went to Iconic state) + mDockWhenMinimized = !mDockWhenMinimized; + QTimer::singleShot(230, this, SLOT(toggleDockWhenMinimized())); +} + +void QTrayLabel::withdraw(void) +{ + TRACE("%s", me()); + mWithdrawn = true; + if (mDockedWindow == None) return; + + Display *display = QPaintDevice::x11AppDisplay(); + int screen = DefaultScreen(display); + long dummy; + + XGetWMNormalHints(display, mDockedWindow, &mSizeHint, &dummy); + + /* + * A simple call to XWithdrawWindow wont do. Here is what we do: + * 1. Iconify. This will make the application hide all its other windows. For + * example, xmms would take off the playlist and equalizer window. + * 2. Next tell the WM, that we would like to go to withdrawn state. Withdrawn + * state will remove us from the taskbar. + * Reference: ICCCM 4.1.4 Changing Window State + */ + XIconifyWindow(display, mDockedWindow, screen); // good for effects too + XUnmapWindow(display, mDockedWindow); + XUnmapEvent ev; + memset(&ev, 0, sizeof(ev)); + ev.type = UnmapNotify; + ev.display = display; + ev.event = qt_xrootwin(); + ev.window = mDockedWindow; + ev.from_configure = false; + XSendEvent(display, qt_xrootwin(), False, + SubstructureRedirectMask|SubstructureNotifyMask, (XEvent *)&ev); + XSync(display, False); +} + +/* + * Skipping the taskbar is a bit painful. Basically, NET_WM_STATE needs to + * have _NET_WM_STATE_SKIP_TASKBAR. NET_WM_STATE needs to be updated + * carefully since it is a set of states. + */ +void QTrayLabel::skipTaskbar(void) +{ + Atom __attribute__ ((unused)) type; + int __attribute__ ((unused)) format; + unsigned long __attribute__ ((unused)) left; + Atom *data = NULL; + unsigned long nitems = 0, num_states = 0; + Display *display = QPaintDevice::x11AppDisplay(); + + TRACE("%s", me()); + Atom _NET_WM_STATE = XInternAtom(display, "_NET_WM_STATE", True); + Atom skip_atom = XInternAtom(display, "_NET_WM_STATE_SKIP_TASKBAR", False); + int ret = XGetWindowProperty(display, mDockedWindow, _NET_WM_STATE, 0, + 20, False, AnyPropertyType, &type, &format, + &nitems, &left, (unsigned char **) &data); + Atom *old_states = (Atom *) data; + bool append = true, replace = false; + + if ((ret == Success) && data) + { + // Search for the skip_atom. Stop when found + for (num_states = 0; num_states < nitems; num_states++) + if (old_states[num_states] == skip_atom) break; + + if (mSkippingTaskbar) + append = (num_states >= nitems); + else + { + if (num_states < nitems) + { + replace = true; // need to remove skip_atom + for (; num_states < nitems - 1; num_states++) + old_states[num_states] = old_states[num_states + 1]; + } + } + XFree(data); + } + + TRACE("%s SkippingTaskar=%i append=%i replace=%i", me(), mSkippingTaskbar, + append, replace); + + if (mSkippingTaskbar) + { + if (append) + XChangeProperty(display, mDockedWindow, _NET_WM_STATE, XA_ATOM, 32, + PropModeAppend, (unsigned char *) &skip_atom, 1); + } + else if (replace) + XChangeProperty(display, mDockedWindow, _NET_WM_STATE, XA_ATOM, 32, + PropModeReplace, (unsigned char *) &old_states, nitems - 1); +} + +void QTrayLabel::setSkipTaskbar(bool skip) +{ + TRACE("%s Skip=%i", me(), skip); + mSkippingTaskbar = skip; + if (mDockedWindow != None && !mWithdrawn) skipTaskbar(); +} + +/* + * Closes a window by sending _NET_CLOSE_WINDOW. For reasons best unknown we + * need to first map and then send the request. + */ +void QTrayLabel::close(void) +{ + TRACE("%s", me()); + Display *display = QPaintDevice::x11AppDisplay(); + long l[5] = { 0, 0, 0, 0, 0 }; + map(); + sendMessage(display, qt_xrootwin(), mDockedWindow, "_NET_CLOSE_WINDOW", 32, + SubstructureNotifyMask | SubstructureRedirectMask, + l, sizeof(l)); +} + +/* + * Sets the tray icon. If the icon failed to load, we revert to application icon + */ +void QTrayLabel::setTrayIcon(const QString& icon) +{ + mCustomIcon = icon; + if (QPixmap(mCustomIcon).isNull()) mCustomIcon = QString::null; + TRACE("%s mCustomIcon=%s", me(), mCustomIcon.latin1()); + updateIcon(); +} + +/* + * Sets the docked window to w. + * A) Start/stop reality timer. + * B) Subscribe/Unsubscribe for root/w notifications as appropriate + * C) And of course, dock the window and apply some settings + */ +void QTrayLabel::setDockedWindow(Window w) +{ + TRACE("%s %s reality monitor", me(), + mDockedWindow==None ? "Starting" : "Stopping"); + + // Check if we are allowed to dock this window (allows custom rules) + if (w != None) mDockedWindow = canDockWindow(w) ? w : None; + else mDockedWindow = None; + + if (mDockedWindow == None) mRealityMonitor.start(500); + else mRealityMonitor.stop(); + + Display *d = QPaintDevice::x11AppDisplay(); + + // Subscribe for window or root window events + if (w == None) subscribe(d, None, SubstructureNotifyMask, true); + else + { + if (canUnsubscribeFromRoot()) + subscribe(d, None, ~SubstructureNotifyMask, false); + else subscribe(d, None, SubstructureNotifyMask, true); + + subscribe(d, w, + StructureNotifyMask | PropertyChangeMask | + VisibilityChangeMask | FocusChangeMask, + true); + } + + if (mDocked && w!=None) + { + // store the desktop on which the window is being shown + getCardinalProperty(d, mDockedWindow, + XInternAtom(d, "_NET_WM_DESKTOP", True), &mDesktop); + + if (mWithdrawn) + // show the window for sometime before docking + QTimer::singleShot(1000, this, SLOT(withdraw())); + else map(); + dock(); + } +} + +/* + * Balloon text. Overload this if you dont like the way things are ballooned + */ +void QTrayLabel::balloonText() +{ + TRACE("%s BalloonText=%s ToolTipText=%s", me(), + mBalloon->text().latin1(), QToolTip::textFor(this).latin1()); + + if (mBalloon->text() == QToolTip::textFor(this)) return; +#if 0 // I_GOT_NETWM_BALLOONING_TO_WORK + // if you can get NET WM ballooning to work let me know + static int id = 1; + long l[5] = { CurrentTime, SYSTEM_TRAY_BEGIN_MESSAGE, 2000, + mTitle.length(), id++ + }; + sendMessage(display, mSystemTray, winId(), "_NET_SYSTEM_TRAY_OPCODE", 32, + SubstructureNotifyMask | SubstructureRedirectMask, + l, sizeof(l)); + int length = mTitle.length(); + const char *data = mTitle.latin1(); + while (length > 0) + { + sendMessage(display, mSystemTray, winId(), "_NET_SYSTEM_TRAY_MESSAGE_DATA", 8, + SubstructureNotifyMask | SubstructureRedirectMask, + (void *) data, length > 20 ? 20 : length); + length -= 20; + data += 20; + } +#else + // Manually do ballooning. See the Qt ToolTip code + QString oldText = mBalloon->text(); + mBalloon->setText(QToolTip::textFor(this)); + if (oldText.isEmpty()) return; // dont tool tip the first time + QPoint p = mapToGlobal(QPoint(0, -1 - mBalloon->height())); + if (p.x() + mBalloon->width() > QApplication::desktop()->width()) + p.setX(p.x() + width() - mBalloon->width()); + + if (p.y() < 0) p.setY(height() + 1); + + mBalloon->move(p); + mBalloon->show(); + QTimer::singleShot(mBalloonTimeout, mBalloon, SLOT(hide())); +#endif +} + +/* + * Update the title in the menu. Balloon the title change if necessary + */ +void QTrayLabel::handleTitleChange(void) +{ + Display *display = QPaintDevice::x11AppDisplay(); + char *window_name = NULL; + + XFetchName(display, mDockedWindow, &window_name); + mTitle = window_name; + TRACE("%s has title [%s]", me(), mTitle.latin1()); + if (window_name) XFree(window_name); + + XClassHint ch; + if (XGetClassHint(display, mDockedWindow, &ch)) + { + if (ch.res_class) mClass = QString(ch.res_class); + else if (ch.res_name) mClass = QString(ch.res_name); + + if (ch.res_class) XFree(ch.res_class); + if (ch.res_name) XFree(ch.res_name); + } + + updateTitle(); + if (mBalloonTimeout) balloonText(); +} + +/* + * Overload this if you want a tool tip format that is different from the one + * below i.e "Title [Class]". + */ +void QTrayLabel::updateTitle() +{ + TRACE("%s", me()); + QString text = mTitle + " [" + mClass + "]"; + QToolTip::remove(this); + QToolTip::add(this, text); + + if (mBalloonTimeout) balloonText(); +} + +void QTrayLabel::handleIconChange(void) +{ + char **window_icon = NULL; + + TRACE("%s", me()); + if (mDockedWindow == None) return; + + Display *display = QPaintDevice::x11AppDisplay(); + XWMHints *wm_hints = XGetWMHints(display, mDockedWindow); + if (wm_hints != NULL) + { + if (!(wm_hints->flags & IconMaskHint)) + wm_hints->icon_mask = None; + /* + * We act paranoid here. Progams like KSnake has a bug where + * IconPixmapHint is set but no pixmap (Actually this happens with + * quite a few KDE programs) X-( + */ + if ((wm_hints->flags & IconPixmapHint) && (wm_hints->icon_pixmap)) + XpmCreateDataFromPixmap(display, &window_icon, wm_hints->icon_pixmap, + wm_hints->icon_mask, NULL); + XFree(wm_hints); + } + QImage image; + if (!window_icon) + { + if (!image.load(QString(ICONS_PATH) + "/question.png")) + image.load(qApp->applicationDirPath() + "/icons/question.png"); + } + else image = QPixmap((const char **) window_icon).convertToImage(); + if (window_icon) XpmFree(window_icon); + mAppIcon = image.smoothScale(24, 24); // why? + setMinimumSize(mAppIcon.size()); + setMaximumSize(mAppIcon.size()); + + updateIcon(); +} + +/* + * Overload this to possibly do operations on the pixmap before it is set + */ +void QTrayLabel::updateIcon() +{ + TRACE("%s", me()); + setPixmap(mCustomIcon.isEmpty() ? mAppIcon : mCustomIcon); + erase(); + QPaintEvent pe(rect()); + paintEvent(&pe); +} + +/* + * Mouse activity on our label. RightClick = Menu. LeftClick = Toggle Map + */ +void QTrayLabel::mouseReleaseEvent(QMouseEvent * ev) +{ + emit clicked(ev->button(), ev->globalPos()); +} + +/* + * Track drag event + */ +void QTrayLabel::dragEnterEvent(QDragEnterEvent *ev) +{ + ev->accept(); + map(); +} + +/* + * Event dispatcher + */ +bool QTrayLabel::x11EventFilter(XEvent *ev) +{ + XAnyEvent *event = (XAnyEvent *)ev; + + if (event->window == mSysTray) + { + if (event->type != DestroyNotify) return FALSE; // not interested in others + emit sysTrayDestroyed(); + mSysTray = None; + TRACE("%s SystemTray disappeared. Starting timer", me()); + mRealityMonitor.start(500); + return true; + } + else if (event->window == mDockedWindow) + { + if (event->type == DestroyNotify) + destroyEvent(); + else if (event->type == PropertyNotify) + propertyChangeEvent(((XPropertyEvent *)event)->atom); + else if (event->type == VisibilityNotify) + { + if (((XVisibilityEvent *) event)->state == VisibilityFullyObscured) + obscureEvent(); + } + else if (event->type == MapNotify) + { + mWithdrawn = false; + mapEvent(); + } + else if (event->type == UnmapNotify) + { + mWithdrawn = true; + unmapEvent(); + } + else if (event->type == FocusOut) + { + focusLostEvent(); + } + return true; // Dont process this again + } + + if (mDockedWindow != None || event->type != MapNotify) return FALSE; + + TRACE("%s Will analyze window 0x%x", me(), (int)((XMapEvent *)event)->window); + // Check if this window is the soulmate we are looking for + Display *display = QPaintDevice::x11AppDisplay(); + Window w = XmuClientWindow(display, ((XMapEvent *) event)->window); + if (!isNormalWindow(display, w)) return FALSE; + if (!analyzeWindow(display, w, mPid, + QFileInfo(mProgName[0]).fileName().latin1())) return FALSE; + // All right. Lets dock this baby + setDockedWindow(w); + return true; +} + +void QTrayLabel::minimizeEvent(void) +{ + TRACE("minimizeEvent"); + if (mDockWhenMinimized) withdraw(); +} + +void QTrayLabel::destroyEvent(void) +{ + TRACE("%s destroyEvent", me()); + setDockedWindow(None); + if (!mPid) undock(); +} + +void QTrayLabel::propertyChangeEvent(Atom property) +{ + Display *display = QPaintDevice::x11AppDisplay(); + static Atom WM_NAME = XInternAtom(display, "WM_NAME", True); + static Atom WM_ICON = XInternAtom(display, "WM_ICON", True); + static Atom WM_STATE = XInternAtom(display, "WM_STATE", True); + static Atom _NET_WM_STATE = XInternAtom(display, "_NET_WM_STATE", True); + static Atom _NET_WM_DESKTOP = XInternAtom(display, "_NET_WM_DESKTOP", True); + + if (property == WM_NAME) + handleTitleChange(); + else if (property == WM_ICON) + handleIconChange(); + else if (property == _NET_WM_STATE) + ; // skipTaskbar(); + else if (property == _NET_WM_DESKTOP) + { + TRACE("_NET_WM_DESKTOP changed"); + getCardinalProperty(display, mDockedWindow, _NET_WM_DESKTOP, &mDesktop); + } + else if (property == WM_STATE) + { + Atom type = None; + int format; + unsigned long nitems, after; + unsigned char *data = NULL; + int r = XGetWindowProperty(display, mDockedWindow, WM_STATE, + 0, 1, False, AnyPropertyType, &type, + &format, &nitems, &after, &data); + + if ((r == Success) && data && (*(long *) data == IconicState)) + { + minimizeEvent(); + XFree(data); + } + } +} + +// Session Management +bool QTrayLabel::saveState(QSettings &settings) +{ + TRACE("%s saving state", me()); + settings.writeEntry("/Application", mProgName.join(" ")); + settings.writeEntry("/CustomIcon", mCustomIcon); + settings.writeEntry("/BalloonTimeout", mBalloonTimeout); + settings.writeEntry("/DockWhenMinimized", mDockWhenMinimized); + settings.writeEntry("/SkipTaskbar", mSkippingTaskbar); + settings.writeEntry("/Withdraw", mWithdrawn); + return true; +} + +bool QTrayLabel::restoreState(QSettings &settings) +{ + TRACE("%s restoring state", me()); + mCustomIcon = settings.readEntry("/CustomIcon"); + setBalloonTimeout(settings.readNumEntry("/BalloonTimeout")); + setDockWhenMinimized(settings.readBoolEntry("/DockWhenMinimized")); + setSkipTaskbar(settings.readBoolEntry("/SkipTaskbar")); + mWithdrawn = settings.readBoolEntry("/Withdraw"); + + dock(); + + /* + * Since we are getting restored, it is likely that the application that we + * are interested in has already been started (if we didnt launch it). + * So we scan the list of windows and grab the first one that satisfies us + * This implicitly assumes that if mPid!=0 then we launched it. Wait till + * the application really shows itself up before we do a scan (the reason + * why we have 2s + */ + if (!mPid) QTimer::singleShot(2000, this, SLOT(scanClients())); + + return true; +} + +// End kicking butt + diff --git a/src/qtraylabel.h b/src/qtraylabel.h new file mode 100644 index 0000000..1ae83bc --- /dev/null +++ b/src/qtraylabel.h @@ -0,0 +1,161 @@ +/* + * Copyright (C) 2004 Girish Ramakrishnan All Rights Reserved. + * + * This 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 software 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 software; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, + * USA. + */ + +// $Id: qtraylabel.h,v 1.21 2005/06/21 10:04:36 cs19713 Exp $ + +#ifndef _QTRAYLABEL_H +#define _QTRAYLABEL_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include + +class QMouseEvent; +class QDragEnterEvent; +class QPoint; + +class QTrayLabel : public QLabel +{ + Q_OBJECT + +public: + QTrayLabel(Window w, QWidget* p = 0, const QString& text = QString::null); + QTrayLabel(const QStringList& argv, pid_t pid, QWidget* parent = 0); + virtual ~QTrayLabel(); + + // Accessors + Window dockedWindow(void) const { return mDockedWindow; } + int balloonTimeout(void) const { return mBalloonTimeout; } + bool isSkippingTaskbar(void) const { return mSkippingTaskbar; } + bool isWithdrawn(void) const { return mWithdrawn; } + bool isDockWhenMinimized(void) const { return mDockWhenMinimized; } + + QString appName(void) const { return mProgName[0]; } + virtual void setAppName(const QString& prog) { mProgName[0] = prog; } + QString appClass(void) const { return mClass; } + QString appTitle(void) const { return mTitle; } + QPixmap appIcon(void) const { return mAppIcon; } + + // Pass on all events through this interface + bool x11EventFilter(XEvent * event); + + // Session Management + virtual bool saveState(QSettings& settings); + virtual bool restoreState(QSettings& settings); + +public slots: + void dock(void); // puts us in the system tray + void undock(void); // removes us from the system tray + void map(void); // maps the window that we are docking + void withdraw(void); // withdraws the window that we are docking + void toggleShow(void) // convenience slot + { if (mWithdrawn) map(); else withdraw(); } + void close(void); // close the docked window + void setTrayIcon(const QString& icon); // sets custom icon + + // and some property setters + virtual void setSkipTaskbar(bool skip); // skip the taskbar + virtual void setBalloonTimeout(int msecs) { mBalloonTimeout = msecs; } + virtual void setDockWhenMinimized(bool dwm) { mDockWhenMinimized = dwm; } + +protected slots: + void scanClients(void); // scans existing client connections + +signals: + void clicked(const ButtonState&, const QPoint&); + void docked(QTrayLabel *); // emitted when we get docked + void docked(void); // emitted when we get docked + void undocked(QTrayLabel *); // emitted when we get undocked + void undocked(void); // emitted when we get undock + // window are monitoring dies + void sysTrayDestroyed(void); // emitted when the system tray disappears + +protected: + // reimplement these event handlers in subclass as needed + virtual void mouseReleaseEvent(QMouseEvent *event); + virtual void dragEnterEvent(QDragEnterEvent *event); + + // the events that follow are events of the docked window (NOT QTrayLabel) + virtual void updateIcon(void); // updates the icon + virtual void updateTitle(void); // sets the tooltip + virtual void balloonText(void); // balloons text + virtual void obscureEvent(void) { } + virtual void mapEvent(void) { } + virtual void focusLostEvent(void) { } + virtual void unmapEvent(void) { } + virtual void minimizeEvent(void); + virtual void destroyEvent(void); + + // needs to return if we can unsubscribe for root + virtual bool canUnsubscribeFromRoot(void) { return true; } + // needs to return if we can dock a candidate window + virtual bool canDockWindow(Window) { return true; } + virtual void processDead(void) { } + + void propertyChangeEvent(Atom); + void setDockedWindow(Window w); // set docked window to anything you want + +private slots: + void realityCheck(void); + void showOnAllDesktops(void); + void toggleDockWhenMinimized(void) + { mDockWhenMinimized = !mDockWhenMinimized; } + void skipTaskbar(void); + +private: + // Helpers + void initialize(void); + void handleTitleChange(void); + void handleIconChange(void); + const char *me(void) const; + + // Member variables + long mDesktop; // desktop on which the window is being shown + QLabel *mBalloon; // tooltip text simulator + QString mCustomIcon; // CustomIcon of the docked application + Window mDockedWindow; // the window which is being docked + int mBalloonTimeout; + bool mDocked, mWithdrawn, mSkippingTaskbar; + bool mDockWhenMinimized; + + QString mTitle, mClass; // Title and hint of mDockedWindow + QPixmap mAppIcon; // The current app icon (may not be same as pixmap()) + XSizeHints mSizeHint; // SizeHint of mDockedWindow + + QTimer mRealityMonitor; // Helps us sync up with reality + QStringList mProgName; // The program whose window we are docking + pid_t mPid; // The PID of program whose window we are docking + + Window mSysTray; // System tray window id +}; + +#endif // _QTRAYLABEL_H diff --git a/src/question.xpm b/src/question.xpm new file mode 100644 index 0000000..112452d --- /dev/null +++ b/src/question.xpm @@ -0,0 +1,39 @@ +/* XPM */ +static char * question_xpm[] = { +"32 32 4 1", +" c None", +". c #000000", +"+ c #008000", +"@ c #FFFFFF", +" ........ ", +" ...++++++++... ", +" ..++++++++++++++.. ", +" .++++++@@@@@@++++++. ", +" .+++++@@@@@@@@@@+++++. ", +" .+++++@@@@@@@@@@@@+++++. ", +" .++++++@@@@@@@@@@@@++++++. ", +" .++++++@@@@@@@@@@@@@@++++++. ", +" .++++++@@@@@@@@@@@@@@++++++. ", +" .+++++++@@@@@@++@@@@@@+++++++. ", +" .+++++++@@@@@@++@@@@@@+++++++. ", +" .+++++++@@@@@@++@@@@@@+++++++. ", +".+++++++++++++++@@@@@@+++++++++.", +".+++++++++++++++@@@@@@+++++++++.", +".++++++++++++++@@@@@@++++++++++.", +".++++++++++++++@@@@@@++++++++++.", +".+++++++++++++@@@@@@+++++++++++.", +".+++++++++++++@@@@@@+++++++++++.", +".++++++++++++@@@@@@++++++++++++.", +".++++++++++++@@@@@@++++++++++++.", +" .+++++++++++@@@@@@+++++++++++. ", +" .++++++++++++++++++++++++++++. ", +" .+++++++++++++@@+++++++++++++. ", +" .++++++++++@@@@@@++++++++++. ", +" .++++++++++@@@@@@++++++++++. ", +" .++++++++@@@@@@@@++++++++. ", +" .+++++++@@@@@@@@+++++++. ", +" .+++++++@@@@@@+++++++. ", +" .++++++@@@@@@++++++. ", +" ..++++++@@++++++.. ", +" ...++++++++... ", +" ........ "}; diff --git a/src/trace.cpp b/src/trace.cpp new file mode 100644 index 0000000..c41247e --- /dev/null +++ b/src/trace.cpp @@ -0,0 +1,44 @@ +#ifdef ENABLE_TRACING +#include +#include +#include +#include + +static QTextEdit *tracer = NULL; + +void TRACER(QtMsgType, const char *msg) +{ + tracer->append(&msg[*msg == '~' ? 1 : 0]); + if (msg[0] != '~') + { + fprintf(stderr, msg); + fprintf(stderr, "\r\n"); + } +} + +void INIT_TRACE() +{ + if (tracer) return; // de javu + tracer = new QTextEdit(); + tracer->setTextFormat(Qt::LogText); + tracer->setMaxLogLines(10000); + tracer->resize(750, 300); + qInstallMsgHandler(TRACER); +} + +void SHOW_TRACE() +{ + tracer->show(); +} + +void DUMP_TRACE(const char *f) +{ + QFile file(f); // Write the text to a file + if (file.open(IO_WriteOnly)) + { + QTextStream stream(&file); + stream << tracer->text(); + } +} + +#endif // ENABLE_TRACER diff --git a/src/trace.h b/src/trace.h new file mode 100644 index 0000000..b3425ec --- /dev/null +++ b/src/trace.h @@ -0,0 +1,30 @@ +#ifndef _TRACE_H +#define _TRACE_H + +#ifdef ENABLE_TRACING + extern void INIT_TRACE(void); + extern void SHOW_TRACE(void); + extern void DUMP_TRACE(const char *file); + + /* + * Lets admit it, shall we. C macros are sometimes are so much cooler than + * C++ static inlines ;) + * WARNING: fmt has to be a static string + */ + #define TRACE(fmt,args...) \ + do { qDebug("~%s - \t" fmt, __PRETTY_FUNCTION__, ##args); } while (0) + + #define SHOW_TRACE_TEXT "Show Trace" + +#else // !ENABLE_TRACING + + #define INIT_TRACE() + #define TRACE(fmt, ...) + #define SHOW_TRACE() + #define SHOW_TRACE_TEXT QString::null + #define DUMP_TRACE(file) + +#endif // ENABLE_TRACING + +#endif // _TRACE_H + diff --git a/src/traylabelmgr.cpp b/src/traylabelmgr.cpp new file mode 100644 index 0000000..3b63cfc --- /dev/null +++ b/src/traylabelmgr.cpp @@ -0,0 +1,523 @@ +/* + * Copyright (C) 2004 Girish Ramakrishnan All Rights Reserved. + * + * This 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 software 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 software; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, + * USA. + */ + +// $Id: traylabelmgr.cpp,v 1.10 2005/02/09 03:38:43 cs19713 Exp $ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "trace.h" +#include "traylabelmgr.h" +#include "util.h" + +#include +#include +#include + +TrayLabelMgr* TrayLabelMgr::gTrayLabelMgr = NULL; +const char *TrayLabelMgr::mOptionString = "+abdefi:lmop:qtw:"; + +TrayLabelMgr* TrayLabelMgr::instance(void) +{ + if (gTrayLabelMgr) return gTrayLabelMgr; + TRACE("Creating new instance"); + return (gTrayLabelMgr = new TrayLabelMgr()); +} + +TrayLabelMgr::TrayLabelMgr() : mReady(false), mHiddenLabelsCount(0) +{ + // Set ourselves up to be called from the application loop + QTimer::singleShot(0, this, SLOT(startup())); +} + +TrayLabelMgr::~TrayLabelMgr() +{ + undockAll(); +} + +void TrayLabelMgr::about(void) +{ + if (QMessageBox::information(NULL, tr("About KDocker"), + tr("Bugs/wishes to Girish Ramakrishnan (gramakri@uiuc.edu)\n" + "English translation by Girish (gramakri@uiuc.edu)\n\n" + "http://kdocker.sourceforge.net for updates"), + QString::null, SHOW_TRACE_TEXT) == 1) SHOW_TRACE(); +} + +void TrayLabelMgr::startup(void) +{ + const int WAIT_TIME = 10; + static int wait_time = WAIT_TIME; + /* + * If it appears that we were launched from some startup script (check whether + * stdout is a tty) OR if we are getting restored, wait for WAIT_TIME until + * the system tray shows up (before informing the user) + */ + static bool do_wait = !isatty(fileno(stdout)) || qApp->isSessionRestored(); + + SysTrayState state = sysTrayStatus(QPaintDevice::x11AppDisplay()); + + if (state != SysTrayPresent) + { + if (wait_time-- > 0 && do_wait) + { + TRACE("Will check sys tray status after 1 second"); + QTimer::singleShot(1000, this, SLOT(startup())); + return; + } + + if (QMessageBox::warning(NULL, tr("KDocker"), + tr(state == SysTrayAbsent ? "No system tray found" + : "System tray appears to be hidden"), + QMessageBox::Abort, QMessageBox::Ignore) == QMessageBox::Abort) + { + qApp->quit(); + return; + } + } + + // Things are fine or user with OK with the state of system tray + mReady = true; + bool ok = false; + if (qApp->isSessionRestored()) ok = restoreSession(qApp->sessionId()); + else ok = processCommand(qApp->argc(), qApp->argv()); + // Process the request Q from previous instances + + TRACE("Request queue has %i requests", mRequestQ.count()); + for(unsigned i=0; i < mRequestQ.count(); i++) + ok |= processCommand(mRequestQ[i]); + if (!ok) qApp->quit(); +} + +// Initialize a QTrayLabel after its creation +void TrayLabelMgr::manageTrayLabel(QTrayLabel *t) +{ + connect(t, SIGNAL(destroyed(QObject *)), + this, SLOT(trayLabelDestroyed(QObject *))); + connect(t, SIGNAL(undocked(QTrayLabel *)), t, SLOT(deleteLater())); + + // All QTrayLabels will emit this signal. We just need one of them + if (mTrayLabels.count() == 0) + connect(t, SIGNAL(sysTrayDestroyed()), this, SLOT(sysTrayDestroyed())); + mTrayLabels.prepend(t); + + TRACE("New QTrayLabel prepended. Count=%i", mTrayLabels.count()); +} + +void TrayLabelMgr::dockAnother() +{ + QTrayLabel *t = selectAndDock(); + if (t == NULL) return; + manageTrayLabel(t); + t->withdraw(); + t->dock(); +} + +// Undock all the windows +void TrayLabelMgr::undockAll() +{ + TRACE("Number of tray labels = %i", mTrayLabels.count()); + QPtrListIterator it(mTrayLabels); + QTrayLabel *t; + while ((t = it.current()) != 0) + { + ++it; + t->undock(); + } +} + +// Process the command line +bool TrayLabelMgr::processCommand(const QStringList& args) +{ + if (!mReady) + { + // If we are still looking for system tray, just add it to the Q + mRequestQ.append(args); + return true; + } + + const int MAX_ARGS = 20; + const char *argv[MAX_ARGS]; + int argc = args.count(); + if (argc >= MAX_ARGS) argc = MAX_ARGS - 1; + + for(int i =0 ; i(argv)); +} + +// Process the command line +bool TrayLabelMgr::processCommand(int argc, char** argv) +{ + TRACE("CommandLine arguments"); + for(int i = 0; i < argc; i++) TRACE("\t%s", argv[i]); + + if (argc < 1) return false; + + // Restore session (See the comments in KDocker::notifyPreviousInstance() + if (qstrcmp(argv[1], "-session") == 0) + { + TRACE("Restoring session %s (new instance request)", argv[2]); + return restoreSession(QString(argv[2])); + } + + int option; + Window w = None; + const char *icon = NULL; + int balloon_timeout = 4000; + bool withdraw = true, skip_taskbar = false, + auto_launch = false, dock_obscure = false, check_normality = true, + enable_sm = true; + + optind = 0; // initialise the getopt static + + while ((option = getopt(argc, argv, mOptionString)) != EOF) + { + switch (option) + { + case '?': + return false; + case 'a': + qDebug(tr("Girish Ramakrishnan (gramakri@uiuc.edu)")); + return false; + case 'b': + check_normality = false; + break; + case 'd': + enable_sm = false; + break; + case 'e': + enable_sm = true; + break; + case 'f': + w = activeWindow(QPaintDevice::x11AppDisplay()); + TRACE("Active window is %i", (unsigned) w); + break; + case 'i': + icon = optarg; + break; + case 'l': + auto_launch = true; + break; + case 'm': + withdraw = false; + break; + case 'o': + dock_obscure = true; + break; + case 'p': + balloon_timeout = atoi(optarg) * 1000; // convert to ms + break; + case 'q': + balloon_timeout = 0; // same as '-p 0' + break; + case 't': + skip_taskbar = true; + break; + case 'w': + if ((optarg[1] == 'x') || (optarg[1] == 'X')) + sscanf(optarg, "%x", (unsigned *) &w); + else + w = (Window) atoi(optarg); + if (!isValidWindowId(QPaintDevice::x11AppDisplay(), w)) + { + qDebug("Window 0x%x invalid", (unsigned) w); + return false; + } + break; + } // switch (option) + } // while (getopt) + + // Launch an application if present in command line. else request from user + CustomTrayLabel *t = (CustomTrayLabel *) // this should be dynamic_cast + ((optind < argc) ? dockApplication(&argv[optind]) + : selectAndDock(w, check_normality)); + if (t == NULL) return false; + // apply settings and add to tray + manageTrayLabel(t); + if (icon) t->setTrayIcon(icon); + t->setSkipTaskbar(skip_taskbar); + t->setBalloonTimeout(balloon_timeout); + t->setDockWhenObscured(dock_obscure); + if (withdraw) t->withdraw(); else t->map(); + t->enableSessionManagement(enable_sm); + t->dock(); + t->setLaunchOnStartup(auto_launch); + return true; +} + +/* + * Request user to make a window selection if necessary. Dock the window. + */ +QTrayLabel *TrayLabelMgr::selectAndDock(Window w, bool checkNormality) +{ + if (w == None) + { + qDebug(tr("Select the application/window to dock with button1.")); + qDebug(tr("Click any other button to abort\n")); + + const char *err = NULL; + + if ((w = selectWindow(QPaintDevice::x11AppDisplay(), &err)) == None) + { + if (err) QMessageBox::critical(NULL, tr("KDocker"), tr(err)); + return NULL; + } + } + + if (checkNormality && !isNormalWindow(QPaintDevice::x11AppDisplay(), w)) + { + /* + * Abort should be the only option here really. "Ignore" is provided here + * for the curious user who wants to screw himself very badly + */ + if (QMessageBox::warning(NULL, tr("KDocker"), + tr("The window you are attempting to dock does not seem to be a" + " normal window."), QMessageBox::Abort, + QMessageBox::Ignore) == QMessageBox::Abort) + return NULL; + } + + if (!isWindowDocked(w)) return new CustomTrayLabel(w); + + TRACE("0x%x is not docked", (unsigned) w); + + QMessageBox::message(tr("KDocker"), + tr("This window is already docked.\n" + "Click on system tray icon to toggle docking.")); + return NULL; +} + +bool TrayLabelMgr::isWindowDocked(Window w) +{ + QPtrListIterator it(mTrayLabels); + for(QTrayLabel *t; (t = it.current()); ++it) + if (t->dockedWindow() == w) return true; + + return false; +} + +/* + * Forks application specified by argv. Requests root window SubstructreNotify + * notifications (for MapEvent on children). We will monitor these new windows + * to make a pid to wid mapping (see HACKING for more details) + */ +QTrayLabel *TrayLabelMgr::dockApplication(char *argv[]) +{ + pid_t pid = -1; + int filedes[2]; + char buf[4] = { 't', 'e', 'e', 'e' }; // teeeeeee :x :-* + + /* + * The pipe created here serves as a synchronization mechanism between the + * parent and the child. QTrayLabel ctor keeps looking out for newly created + * windows. Need to make sure that the application is actually exec'ed only + * after we QTrayLabel is created (it requires pid of child) + */ + pipe(filedes); + + if ((pid = fork()) == 0) + { + close(filedes[1]); + read(filedes[0], buf, sizeof(buf)); + close(filedes[0]); + + if (execvp(argv[0], argv) == -1) + { + qDebug(tr("Failed to exec [%1]: %2").arg(argv[0]).arg(strerror(errno))); + ::exit(0); // will become a zombie in some systems :( + return NULL; + } + } + + if (pid == -1) + { + QMessageBox::critical(NULL, "KDocker", + tr("Failed to fork: %1").arg(strerror(errno))); + return NULL; + } + + QStringList cmd_line; + for(int i=0;;i++) + if (argv[i]) cmd_line << argv[i]; else break; + + QTrayLabel *label = new CustomTrayLabel(cmd_line, pid); + qApp->syncX(); + write(filedes[1], buf, sizeof(buf)); + close(filedes[0]); + close(filedes[1]); + return label; +} + +/* + * Returns the number of QTrayLabels actually created but not show in the + * System Tray + */ +int TrayLabelMgr::hiddenLabelsCount(void) const +{ + QPtrListIterator it(mTrayLabels); + int count = 0; + for(QTrayLabel *t; (t=it.current()); ++it) + if (t->dockedWindow() == None) ++count; + return count; +} + +// The number of labes that are docked in the system tray +int TrayLabelMgr::dockedLabelsCount(void) const +{ + return mTrayLabels.count() - hiddenLabelsCount(); +} + +void TrayLabelMgr::trayLabelDestroyed(QObject *t) +{ + bool reconnect = ((QObject *)mTrayLabels.getLast() == t); + mTrayLabels.removeRef((QTrayLabel*)t); + if (mTrayLabels.isEmpty()) qApp->quit(); + else if (reconnect) + { + TRACE("Reconnecting"); + connect(mTrayLabels.getFirst(), SIGNAL(sysTrayDestroyed()), + this, SLOT(sysTrayDestroyed())); + } +} + +void TrayLabelMgr::sysTrayDestroyed(void) +{ + /* + * The system tray got destroyed. This could happen when it was + * hidden/removed or killed/crashed/exited. Now we must be genteel enough + * to not pop up a box when the user is logging out. So, we set ourselves + * up to notify user after 3 seconds. + */ + QTimer::singleShot(3000, this, SLOT(notifySysTrayAbsence())); +} + +void TrayLabelMgr::notifySysTrayAbsence() +{ + SysTrayState state = sysTrayStatus(QPaintDevice::x11AppDisplay()); + + if (state == SysTrayPresent) + return; // So sweet of the systray to come back so soon + + if (QMessageBox::warning(NULL, tr("KDocker"), + tr("The System tray was hidden or removed"), + tr("Undock All"), tr("Ignore")) == 0) + undockAll(); +} + +/* + * Session Management. Always return "true". Atleast, for now + */ +bool TrayLabelMgr::restoreSession(const QString& sessionId) +{ + QString session_file = "kdocker_" + sessionId; + + QSettings settings; + settings.beginGroup(QString("/" + session_file)); + + for(int i = 1;; i++) + { + settings.beginGroup(QString("/Instance") + QString("").setNum(i)); + QString pname = settings.readEntry("/Application"); + TRACE("Restoring Application[%s]", pname.latin1()); + if (pname.isEmpty()) break; + if (settings.readBoolEntry("/LaunchOnStartup")) + { + QStringList args("kdocker"); + args += QStringList::split(" ", pname); + TRACE("Triggering AutoLaunch"); + if (!processCommand(args)) continue; + } + else + manageTrayLabel(new CustomTrayLabel(QStringList::split(" ", pname), 0)); + + QTrayLabel *tl = mTrayLabels.getFirst(); // the one that was created above + tl->restoreState(settings); + settings.endGroup(); + } + + return true; +} + +QString TrayLabelMgr::saveSession(void) +{ + QString session_file = "kdocker_" + qApp->sessionId(); + + QSettings settings; + settings.beginGroup(QString("/" + session_file)); + + TRACE("Saving session"); + + QPtrListIterator it(mTrayLabels); + QTrayLabel *t; + int i = 1; + while ((t = it.current()) != 0) + { + ++it; + TRACE("Saving instance %i", i); + settings.beginGroup(QString("/Instance") + QString("").setNum(i)); + bool ok = t->saveState(settings); + settings.endGroup(); + if (ok) ++i; else TRACE("Saving of instance %i was skipped", i); + } + + // Aaaaaaaaaaaaaa......... + settings.removeEntry(QString("/Instance") + QString("").setNum(i)); + + return QDir::homeDirPath() + "/.qt/" + session_file + "rc"; +} + +/* + * The X11 Event Filter. Pass on events to the QTrayLabels that we created. + * The logic and the code below is a bit fuzzy. + * a) Events about windows that are being docked need to be processed only by + * the QTrayLabel object that is docking that window. + * b) Events about windows that are not docked but of interest (like + * SystemTray) need to be passed on to all QTrayLabel objects. + * c) When a QTrayLabel manages to find the window that is was looking for, we + * need not process the event further + */ +bool TrayLabelMgr::x11EventFilter(XEvent *ev) +{ + QPtrListIterator it(mTrayLabels); + bool ret = false; + + // We pass on the event to all tray labels + for(QTrayLabel *t; (t = it.current()); ++it) + { + Window w = t->dockedWindow(); + bool res = t->x11EventFilter(ev); + if (w == (((XAnyEvent *)ev)->window)) return res; + if (w != None) ret |= res; + else if (res) return TRUE; + } + + return ret; +} + diff --git a/src/traylabelmgr.h b/src/traylabelmgr.h new file mode 100644 index 0000000..016460f --- /dev/null +++ b/src/traylabelmgr.h @@ -0,0 +1,81 @@ +/* + * Copyright (C) 2004 Girish Ramakrishnan All Rights Reserved. + * + * This 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 software 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 software; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, + */ + +// $Id: traylabelmgr.h,v 1.3 2005/01/07 12:16:07 cs19713 Exp $ + +#ifndef _TRAYLABELMGR_H +#define _TRAYLABELMGR_H + +#include +#include +#include +#include + +#include "customtraylabel.h" + +class CustomTrayLabel; + +class TrayLabelMgr : public QObject +{ + Q_OBJECT + +public: + static TrayLabelMgr* instance(); + static QString options(void) { return QString(mOptionString); } + + ~TrayLabelMgr(); + + QString saveSession(); + + bool x11EventFilter(XEvent *); + bool processCommand(const QStringList& argv); + int hiddenLabelsCount(void) const; + int dockedLabelsCount(void) const; + bool isWindowDocked(Window w); + +public slots: + void about(); + void undockAll(); + void dockAnother(); + +private slots: + void startup(); + void trayLabelDestroyed(QObject *); + void sysTrayDestroyed(void); + void notifySysTrayAbsence(); + +private: + TrayLabelMgr(); + bool processCommand(int argc, char** argv); + void manageTrayLabel(QTrayLabel *l); + bool restoreSession(const QString& sessionId); + + QTrayLabel *dockApplication(char *argv[]); + QTrayLabel *selectAndDock(Window w = None, bool checkNormality = true); + + QPtrList mTrayLabels; + QValueList mRequestQ; + bool mReady; + int mHiddenLabelsCount; + + static const char *mOptionString; + static TrayLabelMgr *gTrayLabelMgr; +}; + +#endif // _TRAYLABELMGR_H + diff --git a/src/util.cpp b/src/util.cpp new file mode 100644 index 0000000..6ddf920 --- /dev/null +++ b/src/util.cpp @@ -0,0 +1,324 @@ +/* + * Copyright (C) 2004 Girish Ramakrishnan All Rights Reserved. + * + * This 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 software 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 software; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, + * USA. + */ + +// $Id: util.cpp,v 1.7 2005/01/29 09:56:08 cs19713 Exp $ + +#include "trace.h" +#include "util.h" + +#include +#include +#include +#include + +#include + +/* + * Assert validity of the window id. Get window attributes for the heck of it + * and see if the request went through. + */ +bool isValidWindowId(Display *display, Window w) +{ + XWindowAttributes attrib; + return XGetWindowAttributes(display, w, &attrib) != 0; +} + +/* + * Checks if this window is a normal window (i.e) + * - Has a WM_STATE + * - Not modal window + * - Not a purely transient window (with no window type set) + * - Not a special window (desktop/menu/util) as indicated in the window type + */ +bool isNormalWindow(Display *display, Window w) +{ + Atom __attribute__ ((unused)) type; + int __attribute__ ((unused)) format; + unsigned long __attribute__ ((unused)) left; + Atom *data = NULL; + unsigned long nitems; + Window transient_for = None; + + static Atom wmState = XInternAtom(display, "WM_STATE", False); + static Atom windowState = XInternAtom(display, "_NET_WM_STATE", False); + static Atom modalWindow = + XInternAtom(display, "_NET_WM_STATE_MODAL", False); + + static Atom windowType = XInternAtom(display, "_NET_WM_WINDOW_TYPE", False); + static Atom normalWindow = + XInternAtom(display, "_NET_WM_WINDOW_TYPE_NORMAL", False); + static Atom dialogWindow = + XInternAtom(display, "_NET_WM_WINDOW_TYPE_DIALOG", False); + + int ret = XGetWindowProperty(display, w, wmState, 0, + 10, False, AnyPropertyType, &type, &format, + &nitems, &left, (unsigned char **) &data); + + TRACE("0x%x (%i)", (unsigned) w, (unsigned) w); + + if (ret != Success || data == NULL) return false; + TRACE("\tHas WM_STATE"); + if (data) XFree(data); + + ret = XGetWindowProperty(display, w, windowState, 0, + 10, False, AnyPropertyType, &type, &format, + &nitems, &left, (unsigned char **) &data); + if (ret == Success) + { + unsigned int i; + for (i = 0; i < nitems; i++) + { + if (data[i] == modalWindow) break; + } + XFree(data); + if (i < nitems) { TRACE("\tMODAL"); return false; } + } + else TRACE("\tNo _NET_WM_STATE"); + + XGetTransientForHint(display, w, &transient_for); + TRACE("\tTransientFor=0x%x", (unsigned) transient_for); + + ret = XGetWindowProperty(display, w, windowType, 0, + 10, False, AnyPropertyType, &type, &format, + &nitems, &left, (unsigned char **) &data); + + if ((ret == Success) && data) + { + unsigned int i; + for (i = 0; i < nitems; i++) + { + if (data[i] != normalWindow && data[i] != dialogWindow) break; + } + XFree(data); + TRACE("\tAbnormal = %i", (i == nitems)); + return (i == nitems); + } + else + return (transient_for == None); +} + +/* + * Returns the contents of the _NET_WM_PID (which is supposed to contain the + * process id of the application that created the window) + */ +pid_t pid(Display *display, Window w) +{ + Atom actual_type; + int actual_format; + unsigned long nitems, leftover; + unsigned char *pid; + pid_t pid_return = -1; + + if (XGetWindowProperty(display, w, + XInternAtom(display, "_NET_WM_PID", False), 0, + 1, False, XA_CARDINAL, &actual_type, + &actual_format, &nitems, &leftover, &pid) == Success) + { + if (pid) pid_return = *(pid_t *) pid; + XFree(pid); + } + TRACE("0x%x has PID=%i", (unsigned) w, pid_return); + return pid_return; +} + +/* + * Sends ClientMessage to a window + */ +void sendMessage(Display* display, Window to, Window w, char* type, + int format, long mask, void* data, int size) +{ + XEvent ev; + memset(&ev, 0, sizeof(ev)); + ev.xclient.type = ClientMessage; + ev.xclient.window = w; + ev.xclient.message_type = XInternAtom(display, type, True); + ev.xclient.format = format; + memcpy((char *) &ev.xclient.data, (const char *) data, size); + XSendEvent(display, to, False, mask, &ev); + XSync(display, False); +} + +/* + * The Grand Window Analyzer. Checks if window w has a expected pid of epid + * or a expected name of ename + */ +bool analyzeWindow(Display *display, Window w, pid_t epid, const QString &ename) +{ + XClassHint ch; + pid_t apid = pid(display, w); + + TRACE("WID=0x%x PID=%i ExpectedName=%s", (unsigned) w, (unsigned) epid, + ename.latin1()); + if (epid == apid) return true; + + // no plans to analyze windows without a name + char *window_name = NULL; + if (!XFetchName(display, w, &window_name)) return false; + TRACE("Window has name [%s]", window_name); + if (window_name) XFree(window_name); else return false; + + bool this_is_our_man = false; + // lets try the program name + if (XGetClassHint(display, w, &ch)) + { + if (QString(ch.res_name).find(ename, 0, FALSE) != -1) + { + TRACE("ResName [%s] matched", ch.res_name); + this_is_our_man = true; + } + else if (QString(ch.res_class).find(ename, 0, FALSE) != -1) + { + TRACE("ResClass [%s] matched", ch.res_class); + this_is_our_man = true; + } + else + { + // sheer desperation + char *wm_name = NULL; + XFetchName(display, w, &wm_name); + if (wm_name && (QString(wm_name).find(ename, 0, FALSE) != -1)) + { + TRACE("WM_NAME [%s] matched", wm_name); + this_is_our_man = true; + } + } + + if (ch.res_class) XFree(ch.res_class); + if (ch.res_name) XFree(ch.res_name); + } + + // its probably a good idea to check (obsolete) WM_COMMAND here + return this_is_our_man; +} + +Window activeWindow(Display *display) +{ + Atom active_window_atom = XInternAtom(display, "_NET_ACTIVE_WINDOW", True); + Atom type = None; + int format; + unsigned long nitems, after; + unsigned char *data = NULL; + int screen = DefaultScreen(display); + Window root = RootWindow(display, screen); + int r = XGetWindowProperty(display, root, active_window_atom,0, 1, + False, AnyPropertyType, &type, &format, &nitems, &after, &data); + + Window w = None; + if ((r == Success) && data && (*(Window *)data != None)) + w = *(Window *)data; + else + { + int revert; + XGetInputFocus(display, &w, &revert); + } + TRACE("Active window is 0x%x", (unsigned) w); + return w; +} + +/* + * Requests user to select a window by grabbing the mouse. A left click will + * select the application. Clicking any other button will abort the selection + */ +Window selectWindow(Display *display, const char **err) +{ + int screen = DefaultScreen(display); + Window root = RootWindow(display, screen); + + if (err) *err = NULL; + + Cursor cursor = XCreateFontCursor(display, XC_draped_box); + if (cursor == None) + { + if (err) *err = "Failed to create XC_draped_box"; + return None; + } + + if (XGrabPointer(display, root, False, ButtonPressMask | ButtonReleaseMask, + GrabModeSync, GrabModeAsync, None, cursor, CurrentTime) + != GrabSuccess) + { + if (err) *err = "Failed to grab mouse"; + return None; + } + + XAllowEvents(display, SyncPointer, CurrentTime); + XEvent event; + XWindowEvent(display, root, ButtonPressMask, &event); + Window selected_window = + (event.xbutton.subwindow == None) ? RootWindow(display, screen) + : event.xbutton.subwindow; + XUngrabPointer(display, CurrentTime); + XFreeCursor(display, cursor); + + if (event.xbutton.button != Button1) return None; + return XmuClientWindow(display, selected_window); +} + +void subscribe(Display *display, Window w, long mask, bool set) +{ + Window root = RootWindow(display, DefaultScreen(display)); + XWindowAttributes attr; + + TRACE("Window=0x%x Mask=%ld Set=%i", (unsigned) w, mask, set); + + XGetWindowAttributes(display, w == None ? root : w, &attr); + + if (set && (attr.your_event_mask & mask == mask)) return; + if (!set && (attr.your_event_mask | mask == attr.your_event_mask)) return; + + XSelectInput(display, w == None ? root : w, + set ? attr.your_event_mask | mask : attr.your_event_mask & mask); + XSync(display, False); +} + +// Returns the state of the SystemTray and the Wid if it exists +SysTrayState sysTrayStatus(Display *display, Window *tray) +{ + Screen *screen = XDefaultScreenOfDisplay(display); + Window sys_tray; + Atom selection = None; + + char temp[50]; + sprintf(temp, "_NET_SYSTEM_TRAY_S%i", XScreenNumberOfScreen(screen)); + selection = XInternAtom(display, temp, True); + if (selection == None) return SysTrayAbsent; + sys_tray = XGetSelectionOwner(display, selection); + if (tray) *tray = sys_tray; + return sys_tray == None ? SysTrayHidden : SysTrayPresent; +} + +bool getCardinalProperty(Display *display, Window w, Atom prop, long *data) +{ + Atom type; + int format; + unsigned long nitems, bytes; + unsigned char *d = NULL; + + if (XGetWindowProperty(display, w, prop, 0, 1, False, XA_CARDINAL,&type, + &format, &nitems, &bytes, &d) == Success && d) + { + TRACE("%ld", *(long *)d); + if (data) *data = *(long *)d; + XFree(d); + return true; + } + TRACE("FAILED"); + return false; +} + diff --git a/src/util.h b/src/util.h new file mode 100644 index 0000000..5d27cc1 --- /dev/null +++ b/src/util.h @@ -0,0 +1,47 @@ +/* + * Copyright (C) 2004 Girish Ramakrishnan All Rights Reserved. + * + * This 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 software 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 software; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, + * USA. + */ + +// $Id: util.h,v 1.3 2004/11/19 15:44:51 cs19713 Exp $ + +#ifndef _UTIL_H +#define _UTIL_H + +#include +#include +#include + +extern bool isNormalWindow(Display *display, Window w); +extern bool isValidWindowId(Display *display, Window w); +extern pid_t pid(Display *display, Window w); +extern void sendMessage(Display *display, Window to, Window w, char *type, + int format, long mask, void *data, int size); +extern bool analyzeWindow(Display *display, Window w, pid_t epid, + const QString &ename); +extern Window activeWindow(Display *display); +extern Window selectWindow(Display *display, const char **err = 0); +extern void subscribe(Display *display, Window w, long mask, bool set); +extern bool getCardinalProperty(Display *display, Window w, Atom prop, + long *data); + +typedef enum { SysTrayAbsent, SysTrayHidden, SysTrayPresent } SysTrayState; + +extern SysTrayState sysTrayStatus(Display *display, Window *tray = 0); + +#endif +