From 431faf8097d1354475bb6f5422aa8a0fb3e3d6ea Mon Sep 17 00:00:00 2001 From: Doug Torrance Date: Tue, 27 Dec 2016 11:09:31 -0500 Subject: [PATCH] cnslock: Add version 1.02 to repository. From http://www.gnu-darwin.org/distfiles/cnslock-1.02.tar.gz (Note that this file is not really gzipped, just use "tar -xf".) --- cnslock/CHANGES | 8 + cnslock/COPYING | 340 ++++++++++++ cnslock/INSTALL | 15 + cnslock/Makefile | 29 ++ cnslock/README | 37 ++ cnslock/TODO | 9 + cnslock/applet.c | 83 +++ cnslock/cnslock.c | 265 ++++++++++ cnslock/graphics/.xvpics/caps_num_scroll.h | Bin 0 -> 3207 bytes cnslock/graphics/.xvpics/caps_num_scroll.png | Bin 0 -> 3205 bytes cnslock/graphics/.xvpics/caps_scroll.h | Bin 0 -> 3207 bytes cnslock/graphics/.xvpics/none.h | Bin 0 -> 3207 bytes cnslock/graphics/.xvpics/num.h | Bin 0 -> 3207 bytes cnslock/graphics/.xvpics/num_scroll.h | Bin 0 -> 3207 bytes cnslock/graphics/.xvpics/scroll.h | Bin 0 -> 3207 bytes cnslock/graphics/caps.h | 488 ++++++++++++++++++ cnslock/graphics/caps_num.h | 488 ++++++++++++++++++ cnslock/graphics/caps_num_scroll.h | 488 ++++++++++++++++++ cnslock/graphics/caps_scroll.h | 488 ++++++++++++++++++ cnslock/graphics/master.xpm | 71 +++ cnslock/graphics/none.h | 488 ++++++++++++++++++ cnslock/graphics/num.h | 488 ++++++++++++++++++ cnslock/graphics/num_scroll.h | 488 ++++++++++++++++++ cnslock/graphics/pngs/.xvpics/caps.h | Bin 0 -> 3207 bytes cnslock/graphics/pngs/.xvpics/caps.png | Bin 0 -> 3205 bytes cnslock/graphics/pngs/.xvpics/caps_num.h | Bin 0 -> 3207 bytes cnslock/graphics/pngs/.xvpics/caps_num.png | Bin 0 -> 3206 bytes .../graphics/pngs/.xvpics/caps_num_scroll.h | Bin 0 -> 3207 bytes .../graphics/pngs/.xvpics/caps_num_scroll.png | Bin 0 -> 3206 bytes cnslock/graphics/pngs/.xvpics/caps_scroll.h | Bin 0 -> 3207 bytes cnslock/graphics/pngs/.xvpics/caps_scroll.png | Bin 0 -> 3205 bytes cnslock/graphics/pngs/.xvpics/none.png | Bin 0 -> 3205 bytes cnslock/graphics/pngs/.xvpics/num.h | Bin 0 -> 3207 bytes cnslock/graphics/pngs/.xvpics/num.png | Bin 0 -> 3205 bytes cnslock/graphics/pngs/.xvpics/num_scroll.h | Bin 0 -> 3207 bytes cnslock/graphics/pngs/.xvpics/num_scroll.png | Bin 0 -> 3205 bytes cnslock/graphics/pngs/.xvpics/scroll.h | Bin 0 -> 3207 bytes cnslock/graphics/pngs/.xvpics/scroll.png | Bin 0 -> 3205 bytes cnslock/graphics/pngs/caps.png | Bin 0 -> 898 bytes cnslock/graphics/pngs/caps_num.png | Bin 0 -> 1081 bytes cnslock/graphics/pngs/caps_num_scroll.png | Bin 0 -> 1138 bytes cnslock/graphics/pngs/caps_scroll.png | Bin 0 -> 955 bytes cnslock/graphics/pngs/none.png | Bin 0 -> 142 bytes cnslock/graphics/pngs/num.png | Bin 0 -> 827 bytes cnslock/graphics/pngs/num_scroll.png | Bin 0 -> 889 bytes cnslock/graphics/pngs/scroll.png | Bin 0 -> 696 bytes cnslock/graphics/scroll.h | 488 ++++++++++++++++++ cnslock/include/applet.h | 2 + cnslock/include/cnslock.h | 35 ++ cnslock/include/defines.h | 20 + cnslock/include/kleds.h | 2 + cnslock/kleds.c | 37 ++ 52 files changed, 4857 insertions(+) create mode 100644 cnslock/CHANGES create mode 100644 cnslock/COPYING create mode 100644 cnslock/INSTALL create mode 100644 cnslock/Makefile create mode 100644 cnslock/README create mode 100644 cnslock/TODO create mode 100644 cnslock/applet.c create mode 100644 cnslock/cnslock.c create mode 100644 cnslock/graphics/.xvpics/caps_num_scroll.h create mode 100644 cnslock/graphics/.xvpics/caps_num_scroll.png create mode 100644 cnslock/graphics/.xvpics/caps_scroll.h create mode 100644 cnslock/graphics/.xvpics/none.h create mode 100644 cnslock/graphics/.xvpics/num.h create mode 100644 cnslock/graphics/.xvpics/num_scroll.h create mode 100644 cnslock/graphics/.xvpics/scroll.h create mode 100644 cnslock/graphics/caps.h create mode 100644 cnslock/graphics/caps_num.h create mode 100644 cnslock/graphics/caps_num_scroll.h create mode 100644 cnslock/graphics/caps_scroll.h create mode 100644 cnslock/graphics/master.xpm create mode 100644 cnslock/graphics/none.h create mode 100644 cnslock/graphics/num.h create mode 100644 cnslock/graphics/num_scroll.h create mode 100644 cnslock/graphics/pngs/.xvpics/caps.h create mode 100644 cnslock/graphics/pngs/.xvpics/caps.png create mode 100644 cnslock/graphics/pngs/.xvpics/caps_num.h create mode 100644 cnslock/graphics/pngs/.xvpics/caps_num.png create mode 100644 cnslock/graphics/pngs/.xvpics/caps_num_scroll.h create mode 100644 cnslock/graphics/pngs/.xvpics/caps_num_scroll.png create mode 100644 cnslock/graphics/pngs/.xvpics/caps_scroll.h create mode 100644 cnslock/graphics/pngs/.xvpics/caps_scroll.png create mode 100644 cnslock/graphics/pngs/.xvpics/none.png create mode 100644 cnslock/graphics/pngs/.xvpics/num.h create mode 100644 cnslock/graphics/pngs/.xvpics/num.png create mode 100644 cnslock/graphics/pngs/.xvpics/num_scroll.h create mode 100644 cnslock/graphics/pngs/.xvpics/num_scroll.png create mode 100644 cnslock/graphics/pngs/.xvpics/scroll.h create mode 100644 cnslock/graphics/pngs/.xvpics/scroll.png create mode 100644 cnslock/graphics/pngs/caps.png create mode 100644 cnslock/graphics/pngs/caps_num.png create mode 100644 cnslock/graphics/pngs/caps_num_scroll.png create mode 100644 cnslock/graphics/pngs/caps_scroll.png create mode 100644 cnslock/graphics/pngs/none.png create mode 100644 cnslock/graphics/pngs/num.png create mode 100644 cnslock/graphics/pngs/num_scroll.png create mode 100644 cnslock/graphics/pngs/scroll.png create mode 100644 cnslock/graphics/scroll.h create mode 100644 cnslock/include/applet.h create mode 100644 cnslock/include/cnslock.h create mode 100644 cnslock/include/defines.h create mode 100644 cnslock/include/kleds.h create mode 100644 cnslock/kleds.c diff --git a/cnslock/CHANGES b/cnslock/CHANGES new file mode 100644 index 0000000..43cd819 --- /dev/null +++ b/cnslock/CHANGES @@ -0,0 +1,8 @@ +cnslock 1.02 (27th October 2002) + + * Added feature to allow applet to be run in window managers such as + enlightenment, fvwm, etc. + +cnslock 1.01 (11th October 2002) + + * First public release. diff --git a/cnslock/COPYING b/cnslock/COPYING new file mode 100644 index 0000000..eeb586b --- /dev/null +++ b/cnslock/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) 19yy + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 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) 19yy name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. diff --git a/cnslock/INSTALL b/cnslock/INSTALL new file mode 100644 index 0000000..a7c4910 --- /dev/null +++ b/cnslock/INSTALL @@ -0,0 +1,15 @@ +Requirements +------------------------------------------------------ + - gtk+ ( >= 2.1.x ) + - Xlib, Xpm, gdk-pixbuf + - root access for install + +Installation +------------------------------------------------------ +1) Untar/gunzip sources + $ tar zxvf cnslock-x.x.x.tar.gz + +2) Compilation + 'make' + become root (via 'su') + 'make install' diff --git a/cnslock/Makefile b/cnslock/Makefile new file mode 100644 index 0000000..96bc22b --- /dev/null +++ b/cnslock/Makefile @@ -0,0 +1,29 @@ +INSTALL = /usr/bin/install -m 755 +PREFIX = /usr/local + +VERSION = 1.02 +CFLAGS = -O3 -Wall `gtk-config --cflags` -DVERSION=$(VERSION) ${EXTRA} +CC = gcc +OBJS = cnslock.o kleds.o applet.o + +LIBS = `gtk-config --libs | sed "s/-lgtk//g"` + +all: cnslock + +cnslock.o: cnslock.c include/cnslock.h include/defines.h + $(CC) $(CFLAGS) -c cnslock.c -o cnslock.o + +applet.o: applet.c include/applet.h include/defines.h + gcc $(CFLAGS) -c applet.c -o applet.o + +kleds.o: kleds.c include/kleds.h include/defines.h + $(CC) -Wall -I/usr/X11R6/include -c kleds.c -o kleds.o + +cnslock: $(OBJS) + $(CC) -o cnslock $(OBJS) $(LIBS) + +clean: + rm -rf cnslock *.o *~ .xvpics + +install : cnslock + $(INSTALL) cnslock $(PREFIX)/bin diff --git a/cnslock/README b/cnslock/README new file mode 100644 index 0000000..d915956 --- /dev/null +++ b/cnslock/README @@ -0,0 +1,37 @@ +Description +------------------------------------------------------------ + +cnslock is a dock application (dockapp) which provides a +visual indication of the states of the three "lock" buttons +(caps, num, and scroll). + +It was written so that I could see the state of those keys +as I have a wireless keyboard with no leds on it. + +Bugs +------------------------------------------------------------ +If you discover any bug in this software, please send a +bugreport to lists@sprig.dyn.dhs.org and describe the +problem with as many details as possible. + +Copyright +------------------------------------------------------------- +cnslock is Copyright (C) 2002 by Simon Hunter, +SPRIG Positive Research Intelligent Gizmos. + +cnslock is licensed through the GNU General Public License. +Read the COPYING file for the complete GNU license. + +Usage +------------------------------------------------------------- + +Simply launch: + cnslock + +If you have problems running it under a different window +manager, such as fvwm or enlightenment, there is a command +line argument that may help: + cnslock -w + + + diff --git a/cnslock/TODO b/cnslock/TODO new file mode 100644 index 0000000..10a6967 --- /dev/null +++ b/cnslock/TODO @@ -0,0 +1,9 @@ +Ideas: +--------- +* Ability to use user defined images for the various states. +* Configuration panel access via mouse click. +* Application launch via mouse clicks (Idea from Fabio Stumbo). + +External suggestions: +--------------------- +* If you have a suggestion, please email me at lists@sprig.dyn.dhs.org. diff --git a/cnslock/applet.c b/cnslock/applet.c new file mode 100644 index 0000000..e9f457c --- /dev/null +++ b/cnslock/applet.c @@ -0,0 +1,83 @@ +#include + +#include "include/defines.h" +#include "include/cnslock.h" +#include "include/applet.h" + +#include "graphics/master.xpm" + +/* This function makes the dockapp window */ +void make_new_cnslock_dockapp(int manager_style) +{ +#define MASK GDK_BUTTON_PRESS_MASK | GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK + + GdkWindowAttr attr; + GdkWindowAttr attri; + + Window win; + Window iconwin; + XWMHints wmhints; + XSizeHints sizehints; + + memset(&attr, 0, sizeof(GdkWindowAttr)); + + attr.width = WINDOWSIZE_X; + attr.height = WINDOWSIZE_Y; + attr.x = 100; + attr.y = 100; + attr.title = "cnslockapplet"; + attr.event_mask = MASK; + attr.wclass = GDK_INPUT_OUTPUT; + attr.visual = gdk_visual_get_system(); + attr.colormap = gdk_colormap_get_system(); + attr.wmclass_name = "cnslockapplet"; + attr.wmclass_class = "cnslockapplet"; + attr.window_type = GDK_WINDOW_TOPLEVEL; + + /* make a copy for the iconwin - parameters are the same */ + memcpy(&attri, &attr, sizeof(GdkWindowAttr)); + + ad.win = gdk_window_new(NULL, &attr, GDK_WA_TITLE | GDK_WA_WMCLASS | GDK_WA_VISUAL | GDK_WA_COLORMAP | GDK_WA_X |GDK_WA_Y); + if (!ad.win) + { + fprintf(stderr, "FATAL: cannot make toplevel window\n"); + exit(1); + } + + ad.iconwin = gdk_window_new(ad.win, &attri, GDK_WA_TITLE | GDK_WA_WMCLASS | GDK_WA_VISUAL | GDK_WA_COLORMAP | GDK_WA_X |GDK_WA_Y); + if (!ad.iconwin) + { + fprintf(stderr, "FATAL: cannot make icon window\n"); + exit(1); + } + + if(manager_style==0) + { + win = GDK_WINDOW_XWINDOW(ad.win); + iconwin = GDK_WINDOW_XWINDOW(ad.iconwin); + sizehints.flags = USSize; + sizehints.width = WINDOWSIZE_X; + sizehints.height = WINDOWSIZE_Y; + XSetWMNormalHints(GDK_WINDOW_XDISPLAY(ad.win), win, &sizehints); + wmhints.initial_state = WithdrawnState; + wmhints.icon_window = iconwin; + wmhints.icon_x = 0; + wmhints.icon_y = 0; + wmhints.window_group = win; + wmhints.flags = StateHint | IconWindowHint | IconPositionHint | WindowGroupHint; + XSetWMHints(GDK_WINDOW_XDISPLAY(ad.win), win, &wmhints); + } + + ad.gc = gdk_gc_new(ad.win); + ad.pixmap = gdk_pixmap_create_from_xpm_d(ad.win, &(ad.mask), NULL, master_xpm); + gdk_window_shape_combine_mask(ad.win, ad.mask, 0, 0); + gdk_window_shape_combine_mask(ad.iconwin, ad.mask, 0, 0); + gdk_window_set_back_pixmap(ad.win, ad.pixmap, False); + gdk_window_set_back_pixmap(ad.iconwin, ad.pixmap, False); + gdk_window_show(ad.win); + + if(posx!=-1 && posy!=-1) + gdk_window_move(ad.win, posx, posy); + +#undef MASK +} diff --git a/cnslock/cnslock.c b/cnslock/cnslock.c new file mode 100644 index 0000000..f063475 --- /dev/null +++ b/cnslock/cnslock.c @@ -0,0 +1,265 @@ +/* csnlock v1.02 + * Copyright (C) 2002 Simon Hunter (lists@sprig.dyn.dhs.org) + * + * cnslock is a dock application that displays the current state of the + * three lock keys (caps, num, and scroll) + * + * 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 receive a copy of the GNU General Public License along with + * this program; if you still want it, write to the Free Software Foundation, Inc., + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * Hacked from various wm applets. + * + */ + +/* general includes */ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#define _GNU_SOURCE +#include +#include + +/* gdk includes */ +#include +#include + +/* x11 includes */ +#include +#include +#include + +/* header includes */ +#include "include/defines.h" +#include "include/applet.h" +#include "include/cnslock.h" +#include "include/kleds.h" + +/* graphic includes */ +#include "graphics/none.h" +#include "graphics/caps.h" +#include "graphics/num.h" +#include "graphics/scroll.h" +#include "graphics/caps_num.h" +#include "graphics/caps_scroll.h" +#include "graphics/num_scroll.h" +#include "graphics/caps_num_scroll.h" + +/* stuff */ +void cnslock_update(void); + +/* misc support functions */ +void prepare_backbuffer(int solid); +void parse_options(int argc, char **argv); +void do_help(void); +void do_version(void); +void make_rgb_buffer256(unsigned char *target, unsigned char *source,int width, int height, int frames, char *cmap); + +/* globals */ +AppletData ad; + +/* keeps track of mouse focus */ +int proximity; + +/* background style (n/a) */ +int selected_background=1; + +/* initial positional data (n/a) */ +int posx=-1, posy=-1; + +/* window manager style (0=wm, 1=other) */ +int manager_style=0; + +/* the main routine */ +int main(int argc, char **argv) +{ + GdkEvent *event; + + srand(time(NULL)); + + /* initialize GDK */ + if (!gdk_init_check(&argc, &argv)) + { + fprintf(stderr, "GDK init failed, bye bye. Check \"DISPLAY\" variable.\n"); + exit(-1); + } + gdk_rgb_init(); + + /* parse command line options */ + parse_options(argc, argv); + + /* zero main data structure */ + memset(&ad, 0, sizeof(ad)); + + /* intialise keyboard leds */ + init_kleds(); + + /* create dockapp window. creates windows, allocates memory, etc */ + make_new_cnslock_dockapp(manager_style); + + /* draw initial background */ + prepare_backbuffer(selected_background); + + while(1) + { + while(gdk_events_pending()) + { + event = gdk_event_get(); + if(event) + { + switch (event->type) + { + case GDK_DESTROY: + gdk_exit(0); + exit(0); + break; + case GDK_BUTTON_PRESS: + /* printf("button press\n"); */ + break; + case GDK_ENTER_NOTIFY: + proximity = 1; + break; + case GDK_LEAVE_NOTIFY: + proximity = 0; + break; + default: + break; + } + } + } + + usleep(20000); + cnslock_update(); + + /* actually draw the rgb buffer to screen */ + + if (manager_style==0) + gdk_draw_rgb_image(ad.iconwin, ad.gc, XMIN, YMIN, XMAX, YMAX, GDK_RGB_DITHER_NONE, ad.rgb, XMAX * 3); + else + gdk_draw_rgb_image(ad.win, ad.gc, XMIN, YMIN, XMAX, YMAX, GDK_RGB_DITHER_NONE, ad.rgb, XMAX * 3); + } + return 0; +} /* main */ + +/* update caps, num, scroll lock */ +void cnslock_update(void) +{ + int status; + + memcpy(&ad.rgb, &ad.bgr, RGBSIZE); + + status = check_kleds(); + if ((status & 0) == 0) + make_rgb_buffer256(ad.rgb,none_data,none_width,none_height,1, *none_cmap); + if ((status & 1) == 1) + make_rgb_buffer256(ad.rgb,c_data,c_width,c_height,1, *c_cmap); + if ((status & 2) == 2) + make_rgb_buffer256(ad.rgb,n_data,n_width,n_height,1, *n_cmap); + if ((status & 3) == 3) + make_rgb_buffer256(ad.rgb,cn_data,cn_width,cn_height,1, *cn_cmap); + if ((status & 4) == 4) + make_rgb_buffer256(ad.rgb,s_data,s_width,s_height,1, *s_cmap); + if ((status & 5) == 5) + make_rgb_buffer256(ad.rgb,cs_data,cs_width,cs_height,1, *cs_cmap); + if ((status & 6) == 6) + make_rgb_buffer256(ad.rgb,ns_data,ns_width,ns_height,1, *ns_cmap); + if ((status & 7) == 7) + make_rgb_buffer256(ad.rgb,cns_data,cns_width,cns_height,1, *cns_cmap); + + memcpy(&ad.bgr, &ad.rgb, RGBSIZE); +} + +void prepare_backbuffer(int solid) +{ + make_rgb_buffer256(ad.rgb,none_data,none_width,none_height,1, *none_cmap); + + /* copy it to the "frequent use" buffer */ + memcpy(&ad.bgr, &ad.rgb, RGBSIZE); + +} /* prepare_backbuffer */ + +void make_rgb_buffer256(unsigned char *target, unsigned char *source, int width, int height, int frames, char *cmap) +{ + int i, j = 0; + + for (i = 0; i < (width * height * frames); i++) + { + target[j] = cmap[3*source[i]]; + target[j+1] = cmap[3*source[i]+1]; + target[j+2] = cmap[3*source[i]+2]; + j += 3; + } +} + +void parse_options(int argc, char *argv[]) +{ + int c = 0; + + struct option long_options[] = { + {"help", no_argument, NULL, 1}, + {"h", no_argument, NULL, 1}, + {"version", no_argument, NULL, 2}, + {"v", no_argument, NULL, 2}, + {"window", no_argument, NULL, 3}, + {"w", no_argument, NULL, 3}, + + {0, 0, 0, 0} + }; + + while ((c = getopt_long_only(argc, argv, "", long_options, NULL)) != -1) + { + switch(c) + { + case 1: + do_help(); + exit(0); + break; + case 2: + do_version(); + exit(0); + break; + case 3: + manager_style = 1; + break; + } + } +} + +void do_version(void) +{ + printf("\ncnslock applet v%.2f\n\n", VERSION); +} + +/* +-h,--help Display help +-v,--version Display version +-w,--window Alternative window system +*/ + +void do_help(void) +{ + do_version(); + printf("This is an applet that displays the various states of the CAPS, NUM and SCROLL LOCK keys.\n" + "\nUsage: cnslock [options]\n\n" + " -h\t--help\t\tShow this message and exit.\n" + " -v\t--version\tShow version and exit.\n" + " -w\t--window\tUse alternative windowing system.\n\n" + ); +} + diff --git a/cnslock/graphics/.xvpics/caps_num_scroll.h b/cnslock/graphics/.xvpics/caps_num_scroll.h new file mode 100644 index 0000000000000000000000000000000000000000..a5244c815a734d1ba79ef32a2b5cf23a1b07c94a GIT binary patch literal 3207 zcmeHHJx@YG5Tt&;;w3cN3HUIvRWKBQiS{H$S{p6!*Xz!H-+5qXBQJQjJ3BLbZx4LD z>1VTPH(sqDR-5Jac9U^{l#Q*eKqS}K0o&Fm)&@=x!-M}6s(qxK;qzIRNggV z+$++_SDApx97f>7DbW9rG{;fAc$;A;?G~~sl8CaMT~5-07#9#xmicwpx>RU3%>9(W z{rn3=Km4MRCI%}RsD*54Nv%Dh^KY%4DQofn2R)K+gfT03n_8vI1BHl`ZTBqeBa3wyczfXV$kEbBkc~R6PuFLc=(aSF{ zvoQCB11ug;B%PI`n>6$z28xI?3$&!09u%HNP^;VqwYCoKC~6fn34PUy6Re{+I($^; z3>O0NhQ)6wozu?iD(UAinTQ9w!BLsE2P6ow&7OsEqv|6YTnrFLnJmZ2J9xs9x|t^I J9RBG9z5#rKb-e%p literal 0 HcmV?d00001 diff --git a/cnslock/graphics/.xvpics/caps_num_scroll.png b/cnslock/graphics/.xvpics/caps_num_scroll.png new file mode 100644 index 0000000000000000000000000000000000000000..73eddad07add5b29d732a4e7922026e46a64d531 GIT binary patch literal 3205 zcmeHHJx@YG5Tt&;;w3cNLLMfzDux0u(VoOWYoi7JdcE1%uR9;u*~kmt?at23-rED8 zZuP*yX|s!w_UFvHZRXz z;g!#97`n;jIWvJTJU{EBV4{h}gl+*9m4K|AWRuj27E&aNHPy2$<3TRHKoZ>vVZa)3 z!>Zz70|=R%H$loJn4uL2pHZ~rZmSiAjwg%#&iWN9DIx_yC#Br zg`Irm1We{I0v}F={)c3A9My}DGYl=eg`$ciqHJfElXM`)1w@o(e%-Au6-FE8eoByj z{sk&O{Hl>A1}hn;g<@$*t39LhZ>^mvYw`aFJ(6#PHWMJtQy^$qiB%(RKBJ^XrTitH zgv_1Sq}0Gp3y4N_t&q9B2hOaBw_?!hw0r_?#FzB<36#O(sfcY}6*Y?YypHKZlD6J;V);%CtQoB86@CB8(eVA8v3lfR3E3#K}8&WU+3h3A==U GI)QK9-gRF9 literal 0 HcmV?d00001 diff --git a/cnslock/graphics/.xvpics/caps_scroll.h b/cnslock/graphics/.xvpics/caps_scroll.h new file mode 100644 index 0000000000000000000000000000000000000000..97eca60688cc75377a9fb34924a11e25a7245b72 GIT binary patch literal 3207 zcmeHIJ#WH53}w!*h{V#45QU1aEuaiZDz!UOMb<8KpufJ{^LHRrojOz(MQ8i@J^NxL z^YTzu)v}m3?XKyz{bRj4)vL1kI1H!ZP~I&T)p}jNe|-+e`(nQ7p7;HB|J1kbrh9uW z5;MKax-Mq<`C$Uzc&_u4V4#skg;oM8Rszy=kj+9XEjM&go@sw>}#X!`+4?3EFup&A7CJ#Es7;qT1N0HDB6NgELf;FW}VB+9aDp?5# zw+wf(lP91ugW=e4MraQ51o8y(1pdj<;!^hXb@%jh^S3fJt1vZF@XSj|tw>E#&@ePKwlq>msw_z@*5p!l^>c~$ zcZ+xS_w{x43kl`|ssthwvs$-$!f2*^h`Ym2a#|W0rH$vSGnCu}6LaxNOAP)MeUWy9+yS@N9 zx5g}G4eX=E#X3;_)Pnd7cy{iPxoin8@X)mzkJb z5&&KX2=Qd;k-!7(h>-;fnF1+Ekb}Zg8^p?wL2X_KcNC?HHiq_=iZ$p&b~JiXXB{R4 zV*``lk~^oK*Hk>uXfk1s;08zO)EFsds9WuWFy5&6aDa;v?8uu9*m=i3?&7+dI(e>%p&>RDumLIjZ8b@6M@izwkwo zyR52rRa3UBFz>_MSJz9|cNagNPK)KtpC9+`HgVau*__()v~KHq+Z+!LlNB!k^sG524Zx z9dSsz*PT!mD^eCe*?xBNc#G5NBpGG-Lsl%yyL7frXPCWL^}4R`dOS|&bA0*wtUqp& z(W0PLxm?|sdA=x~pAyNGXOgA~3~`AD%y~nZpYu3x0Su~H3IKtly4hgBHDFj8MV3Y~1YQWyU?k-X8pQDv}drgZFsAJle z{HumL+zC*l`&{{uuJR#`(ZPn61K$_a9wtzb$x#1u0NDZuiyE27T%F1zHM|D{gMq=o He=zV1l3!Ni literal 0 HcmV?d00001 diff --git a/cnslock/graphics/pngs/.xvpics/caps.png b/cnslock/graphics/pngs/.xvpics/caps.png new file mode 100644 index 0000000000000000000000000000000000000000..f9d8166387f93fd8c21099bcb932f8012df2d1b5 GIT binary patch literal 3205 zcmeH{u};H43_v|FLe}2^OSIJ~q z@VZ>B@5(%17Eh0fy+5Rf!#T? z*J0p|ixyt@{g5Za-C^Q3F!`_QWJnU_Fa?YiVFTfsyCU}nDqQ42 zROsGhi#*5$RHV#U+ISOXt^8C+&>~si&dfKn^X=fX5gQB+8wb2!Xwm;}S?V92IF zm#gd5l6Ct1(P+Sa{Q155)omOc&&9>!%7*niqK98_q0{ zge%d4qF0!DtSIWqpn>$$EMnJOd5I+uMV^vEiX5*tpEi1@O|Bl~;M^J&L+7kW-WtSys4 zx<19%u@I#Wf1-yeOZ*xMJmOk96j}`{4>LH};Ml^0I4}5QFipJ;a@)P<2E7vsJ7eb0 np%B!fx{-n%w=$I~WH0TR#UhD`+?mpZRH#y*QlL`cKULrXJU3wA literal 0 HcmV?d00001 diff --git a/cnslock/graphics/pngs/.xvpics/caps_num.png b/cnslock/graphics/pngs/.xvpics/caps_num.png new file mode 100644 index 0000000000000000000000000000000000000000..a9f85a399a52d4f187b9c356a2c556e8f7a2d08e GIT binary patch literal 3206 zcmeHHy=vn?5T0TUvWdVOP$7fELbk9WhB!gKv*D`SBywRpko19I!yX)Iaz*Y9RJh24 zsL;L17I}~hs7RTywDIP2Yvrd3L5pO4J2T(R&bNb4zp%r@gU0T7ax$JC&ql%ECK#~s z)qHWYn6plQ|7)LJ{{FSN?lyLhrs86DeDQrYnH){e&l(tr&p{A0pjw|%0sg+G_}};O z;t+tdH*|#QIBJ8-MHaNSN*TFxbqDji2uQXa;K#vo^}s3T$~g1uLuT0T z66(LypvqND**ZO?y>?xfUmJ^nag`wDHd;Gs?NJllVSR0|0rn7qyozFiFv>Hrys|1h#%uPVkzzqlo6NxEy7@7uQCyRE68%Su*)z1|* zQEs1r;|&O2rDZXkf0>3@@1f}JQa^BkezS_B#EO$7BK}e2k)18*`LtuZ3q2xiO^)sZgarr9h>?2UXw^aL!<- literal 0 HcmV?d00001 diff --git a/cnslock/graphics/pngs/.xvpics/caps_num_scroll.h b/cnslock/graphics/pngs/.xvpics/caps_num_scroll.h new file mode 100644 index 0000000000000000000000000000000000000000..a5db9b3268bdd1c5052862587a179e089f7eba5f GIT binary patch literal 3207 zcmeHH&1%~~5T1h!vWdV72qA;RLiS)oeXxV9+R#%sseG_qXzzhy!xl;}?IC>w9el`x z=-|AG4tbCUbjY!z-L*H7*Gl4BLk8PB^UZwow~IeVNudW_ z%MG3yFq2!%$u_;~_S$t-ehZcrLbEkeu9K~!)*d&(8P&IdNg?+M@Y^K5)6V9xWsjRr zTzncQIfoy2a!5t?ypB#|)QX2mt}{l{n}rT&YITo>4-<(wP8jO};Y36`qdg>q<@V)9 zb(GV$!1jg~UZp_@zJH#_Sns~-3TnA(kP?n2&v_P;U0fiBmFUR5DRsyz)cokUm@4uIhT+f|8DI(d@-PGlj{$!c z4}-87OcAN3Hcg1E1-v7VJ-&<(V4+GAgk7S_)XJmc#8E)XE>x5FrGPR|(RZi^@I(vI iW&)L1ft7u#)%lU!r|d-yjTmMs43TN4&o|(|+rU4Q!*4tQ literal 0 HcmV?d00001 diff --git a/cnslock/graphics/pngs/.xvpics/caps_num_scroll.png b/cnslock/graphics/pngs/.xvpics/caps_num_scroll.png new file mode 100644 index 0000000000000000000000000000000000000000..ec503358ee9a88fb24a6b50dc44771788c91c620 GIT binary patch literal 3206 zcmeHH&1%~~5T1h!vWdV72qA;RLiS)oeXxzJ+R#%sseG_qXzzhy!xl;}?IC>w9el`x z=-|AG4tbCUbjY!z-L*H7*UHbWA%pFm`DVWP+r^(FG8_&Xr_HK^#2}hUVh)jPj zSC^|L>Gb=<_vG83->YBU#_8FdT`bNoJ}zdnv-#IA4GhH3APgJuCa-Y=^kqZQzc1sZ zF#sjc=CTYRm9fTT$&k+C4wg3wSi&6PVPm;^XjgN2D*UQRp$A>d z4IUdXlUvNmF1_pa+I3Za2bL8=vkg+NlAWX0o;1N3*LQ$PA$JMznSV?hab0cNJaL%j!t9Liib(AGDg$ur4DFn^?-&C6Nx!a80!JyL_|B|10;my_T@%( zl+(As_C^+7r9lY3f1bx!@2>3axChNa)jJnQ5LdV$+9-GzE5z}AMB zVRZu+zqWzMRrtMq=(1K&vqH~u3==Z74I>XT*f`+Wz=Kp4y!SA5y+U)^y@!CZSca1k z{pU~$YPo8V5{@R%c@~p>Tp)&(=*WX9b;v8!{OGutD)I-0;m{cwUwDj5l}z);>GLxw(xhwvsI`XE&D z(2?^;2HFVqx)t?QDe?J!=l`8AeGshI>n0bY@%?BroZe>rMb>Adw_?7S7wodr5jWTD z`SWA`ewADdCUQ0%&hDn;@nG`wm|!ISx>=UM$^K&p_+dry@54Bq18_!Wr2#O?lEoSh zWd&SO4^*64fU2T$(kcZUQIbi7&}yPgX}GQ>aO@4q+#M9F63$2zDDC5kBJtir7cHY5 z$GE8xS(Zd>Q-WHR`I?4-&P%J{bsdV_8+L=qmPT^@RqPF6APy#i7Awq21%~d^=91z3 zE1Tna8;V3Q(lK={^$UfIa{{uWeXc5ollpe4kk#0l`;CC1K=$vlQT*) zn^;;a8|v7fsW^8fh_u^M32urOcW|ZQ(GuWyTKs!)7=&Ulg@~dW5k9MP@7V91G(>o( zdkstQ>n${-jyo~VKb$MB-D{hrTLIf##COmGI4?mo6~x5R`KQjSUI1}(8@^kF8q N@R@dWo*YNlfggHkWi|i+ literal 0 HcmV?d00001 diff --git a/cnslock/graphics/pngs/.xvpics/caps_scroll.png b/cnslock/graphics/pngs/.xvpics/caps_scroll.png new file mode 100644 index 0000000000000000000000000000000000000000..9c506bb6913d406ab46643a9e0e3e74c92c211e8 GIT binary patch literal 3205 zcmeH{y-ve05XWy|%E*${Qa!-hDz#w6E$Pq}3HC}Tk&J{`U?^{pAwwU;LwFMpeGn>n z=*ama18szQ-HLjul=ytV^Z(A5J_t4#^poCXdOw+s=eOB#nGM1kUy!JHU@Cihm!+=^TJFGAj*$QI;&$aHwkF zih7{p%mUOkm6KK};E0k;B81iuWlF{+40K*u1+SY>#yQq2m^625wuugPAV{TpEj2a=U>?z z&)ZTYf{~7C8mV6>T$~e-HSKd%F`U#76eeRgs2u2UAayW78mx@b{~Q2sL7ALUn%TzE zTG>*k{!GQCD?z0Fj!JM-bhv{n4UdihztiDAh{GThgDFH5)r#<0oqNxI@1!BZJKbwo zf?w~TA$8n|asJ_4aqV8aEZqs%IADqOBk%j?O=I#@3}G^fPFQMWYWhxrNWP Lr}OMMxeojQoy=s@ literal 0 HcmV?d00001 diff --git a/cnslock/graphics/pngs/.xvpics/none.png b/cnslock/graphics/pngs/.xvpics/none.png new file mode 100644 index 0000000000000000000000000000000000000000..c3e902eab49ad3775fb2358774ebb50fb6549433 GIT binary patch literal 3205 zcmWGAS1>j<;!^hXb@%jh^S3fJt1vZF@XSj|tw>E#&@ePHQb?*SNiEjoQg-!oiT8Jl zclP)7b@dAg<^rk%A|q2%E{0Js8UmvsFd71*Aut*OqaiRF0;3@?8UmvsFd70xh5!IN CmJzW4 literal 0 HcmV?d00001 diff --git a/cnslock/graphics/pngs/.xvpics/num.h b/cnslock/graphics/pngs/.xvpics/num.h new file mode 100644 index 0000000000000000000000000000000000000000..2a61dba80b64b52445384a9d74e4ec985ab8132d GIT binary patch literal 3207 zcmeH_v1-FW42D%WgKFeK&^tH}#*hvUG=m+^A%;wCQasoWqHBrulN|Zk&ZQ7vH1PiosGt=v-v)3>YiHyf+ZC`FqkIKmGcl(K{iY)_m;(25gwhxJTI{>y-0OfrKQ9iz3Cz<%x&?rEs6R}d{P7~CH7%V(xvr2w$ wWNL*uEv1I6x}Dm+ID7z=0q>;aZvB)$-34%#9|I`=&mby7(Lgj14g7fnKl!8^WdHyG literal 0 HcmV?d00001 diff --git a/cnslock/graphics/pngs/.xvpics/num.png b/cnslock/graphics/pngs/.xvpics/num.png new file mode 100644 index 0000000000000000000000000000000000000000..6070abb5d860ab8578efe0dd386bc65290f0571d GIT binary patch literal 3205 zcmeH_v1-FW42D%WgJR@C&^tH}#*hvUG(#NDX$+m(qtWmywM8^9^8osn~Fm%w6-@+E-H#GLj7)c|Nv&SK)U9An~^ zK%9gswhYvY=aEs^+$ZAg0N7Rml=m4#`S`9*GV!gUQGiY-Vx`EfCRi0>u<(@4D*3sQ wSt-nEAvI*x<8JehE`YQA5J35V22l};2BLvz;N}gS0Ua3|0ssI2 literal 0 HcmV?d00001 diff --git a/cnslock/graphics/pngs/.xvpics/num_scroll.h b/cnslock/graphics/pngs/.xvpics/num_scroll.h new file mode 100644 index 0000000000000000000000000000000000000000..89c294bb28cdf561a612f0b82d563ee576effa32 GIT binary patch literal 3207 zcmeH{&uhXk6vy8nLRQj4#@f;zq~Hz;^Uz8fEbO%D@SqO1yD;>+%XV=8{a%_V_ygtT z<}j2deffU!UcL!^)A?Xf2A#?Dbut^zYgMgPl~2BwtMzJ`cZ)(-W&Zj5v-<7@ozd)N zF&{6U=hNwE_VFH|5}#730Iu!oz~wu@ytcrzp$EsJNX2wcrhSlPOk{n4G$eBo5~2j) zF{iV+%XV=8{a%_>@CVAv z&0#1_`ttqcy?hh;R;0t>!0XKBud~IpDpkHwc{=-AtvBmcnvF)|^z-*;{oVCClf}!j znl7KK`FyhYc=u3;&p;^;uI=i;+8FJ&^bn{~C&l zJH5Xm!vE7j!^z?x*aRXoI3lQLj>HXchC>k+gQCI~)f91-vl%1P*K$2yEi$YxtGv190cJ)Ah~z%U0&W1 zOqQi;SyqR#E}E@%gLS67cKy(IX5}`{TpsuSwpPo$-nUKB?wYE~>+?w=4|i&%4ni#i(vS>6ECg^( z2BL2XF(Lz4JOuu?v zc2Ng-QwJ|01LK?x5exwYFc}S`RSvjd4Xj!ND;Gm91aVFWYDoqR2mt{A0H|~d0TBrb zg+&q9a0p{G3V=hyg$qhD1UM!G2xc`A+HnekL;(&64X0ND2Lwn^6zJWCa8OgIWkB83GD?K?{yb z5#V(QY&Zc31Op)vBNzgaV+ev-2m>S&3yVks7YqkoF%Z#h2x~a;r4E^C2_O~%Q8)z& z1_23oJ`Ji_1U4K6J|KBh2lA#4s&onf0Ra%nX$Ms-33NOe5dp!43w%`v0vQbt3IPN! z7$zD5Fd+kINCqDj0tQGW4!L0xRRO<%hshXDa_`9(1 zv4~Px;+?Djm1?a{Lsf%rpwXn^%&cj(FgH)bg~g>d?Bx}bt*&*}v4L)fbed{+9T%Gp z>7dAf=Nntw$zkXBt|+F}W`Dr0u$Po+?UV4JASxQr>yxf^7z|`JI1+{=H1seE5k|+P zbA4bCsB*F>=y>sV5}n%6&M2sx$sV3l=;CsOk)_9Pjjkv-ZeGVzHGD4!DR(pZY4`Sy za=34#_3-$_Ine>`TWWNA(cy6Se`t2^8DF+ Y1JRl&J{nCg>Hq)$07*qoM6N<$f>-z)b^rhX literal 0 HcmV?d00001 diff --git a/cnslock/graphics/pngs/caps_num.png b/cnslock/graphics/pngs/caps_num.png new file mode 100644 index 0000000000000000000000000000000000000000..2e790a2d7266074f30f9b732834a5b35c152352d GIT binary patch literal 1081 zcmV-91jhS`P)%4ni#i(vS>6ECg^( z2BL2XF(Lz4JOuu?v zc2Ng-QwJ|01LK?x5exwYFc}S`RSvjd4Xj!ND;Gm91aVFWYDoqR2mt{A0H|~d0TBrb zg+&q9a0p{G3V=hyg$qhD1UM!G2xc`A+HnekL;(&64X0ND2Lwn^6zJWCa8OgIWkB83GD?K?{yb z5#V(QY&Zc31Op)vBNzgaV+ev-2m>S&3yVks7YqkoF%Z#h2x~a;r4E^C2_O~%Q8)z& z1_23oJ`Ji_1U4K6J|KBh2lA#4s&onf0Ra%nX$Ms-33NOe5dp!43w%`v0vQbt3IPN! z7$zD5Fd+kINCqDj0tQGW4!L0xe4b#49KyBqk-N;MXUenwHKbke0!m2^Y%B&dK%5&LLo-uuxup9z$M! z0Yb>W(6p$SfHnpzX9kA!GyyIUMu?UW(#F7G=>#N7^UKs21k2%qj>%wm78h0E)+i(i zBJ(OyMU%3t7;>`xa^taUs;;SJsFe}|x;4KJO{zYyAvq~Aq0tko#wO8bV5kZ^JEi5J zOSQCyMMXx0wY6i@*U<@~t-87~B`f@c0t5VmdU~;F>=OY~{Szi)k(}i189mwCbIMdK za{SZ4RAxCAIS`m`V{d0W1DnjuSzwLKvvKG&H#0TCDlw<2b1nmCTr75N71~;wI7|eF z4<9ejy!kjJ7vR(e1e_e~_@qa{C>RB!V8{Ug5%4ni#i(vS>6ECg^( z2BL2XF(Lz4JOuu?v zc2Ng-QwJ|01LK?x5exwYFc}S`RSvjd4Xj!ND;Gm91aVFWYDoqR2mt{A0H|~d0TBrb zg+&q9a0p{G3V=hyg$qhD1UM!G2xc`A+HnekL;(&64X0ND2Lwn^6zJWCa8OgIWkB83GD?K?{yb z5#V(QY&Zc31Op)vBNzgaV+ev-2m>S&3yVks7YqkoF%Z#h2x~a;r4E^C2_O~%Q8)z& z1_23oJ`Ji_1U4K6J|KBh2lA#4s&onf0Ra%nX$Ms-33NOe5dp!43w%`v0vQbt3IPN! z7$zD5Fd+kINCqDj0tQGW4!L0xe4b#49KyBqk-N;MXUenwHKbke0!m2^Y%B&dK%5&LLo-uuxup9z$M! z0Yb>W(6p$SfHnpzX9kA!GyyIUMu?UW(#F7G=>#N7^UKs21k2%qj>%wm78h0E)+i(i zBJ(OyMU%3t7;>`xa^taUs;;SJsFe}|x;4KJO{zYyAvq~Aq0tko#wO8bV5kZ^JEi5J zOSQCyMMXx0wY6i@*U<@~t-87~B`f@c0t5VmdU~;F>=OY~{Szi)k(}i189mwCbIMdK za{SZ4RAxCAIS`m`V{d0W1DnjuSzwLKvvKG&H#0TCDlw<2b1nmCTr75N71~;wI7|eF z4<9ejy!kjJ7vR(e1e_e~_@sw3Sh#Q@5`{$;t2jgwg~F7=sgsaKxWx;h?t(dkutpfQ z5Y-uYG{UXIFouvuhy)!qE+pH=g~;KE7RD&lC>Txv01=pvPp_FL#{d8T07*qoM6N<$ Ef+>A^7XSbN literal 0 HcmV?d00001 diff --git a/cnslock/graphics/pngs/caps_scroll.png b/cnslock/graphics/pngs/caps_scroll.png new file mode 100644 index 0000000000000000000000000000000000000000..7628405955b58dd3e70fa8bbc87aeb79d51546d3 GIT binary patch literal 955 zcmV;s14R6ZP)%4ni#i(vS>6ECg^( z2BL2XF(Lz4JOuu?v zc2Ng-QwJ|01LK?x5exwYFc}S`RSvjd4Xj!ND;Gm91aVFWYDoqR2mt{A0H|~d0TBrb zg+&q9a0p{G3V=hyg$qhD1UM!G2xc`A+HnekL;(&64X0ND2Lwn^6zJWCa8OgIWkB83GD?K?{yb z5#V(QY&Zc31Op)vBNzgaV+ev-2m>S&3yVks7YqkoF%Z#h2x~a;r4E^C2_O~%Q8)z& z1_23oJ`Ji_1U4K6J|KBh2lA#4s&onf0Ra%nX$Ms-33NOe5dp!43w%`v0vQbt3IPN! z7$zD5Fd+kINCqDj0tQGW4!L0xIeRx?@5%#z{U{6Y@e;u4W9ujE&;hC-g`BvC6A zOIR-w9ijqIt|%Lu_QTfST`1^8j`{~|b31mZnO!2>3k0JQP^}SNc3-axqJF?Nh)|IY z(|} d`(j*vs!!1KV_cU3B!vI~002ovPDHLkV1nE!GAjT8 literal 0 HcmV?d00001 diff --git a/cnslock/graphics/pngs/none.png b/cnslock/graphics/pngs/none.png new file mode 100644 index 0000000000000000000000000000000000000000..60b3dfea196be0dce71e80e5981e4220b655a0f8 GIT binary patch literal 142 zcmeAS@N?(olHy`uVBq!ia0vp^79h;X3?wIctc(RxYymzYu0Z<#|Nl#G&c6#}F(!Gt zyD)UH%6b4foCO|{#S9GG0wBz|R(WqJP>{XE)7O>#5*Ig*qQzp7JGMX}K2I0Nkcv6U e2@%4ni#i(vS>6ECg^( z2BL2XF(Lz4JOuu?v zc2Ng-QwJ|01LK?x5exwYFc}S`RSvjd4Xj!ND;Gm91aVFWYDoqR2mt{A0H|~d0TBrb zg+&q9a0p{G3V=hyg$qhD1UM!G2xc`A+HnekL;(&64X0ND2Lwn^6zJWCa8OgIWkB83GD?K?{yb z5#V(QY&Zc31Op)vBNzgaV+ev-2m>S&3yVks7YqkoF%Z#h2x~a;r4E^C2_O~%Q8)z& z1_23oJ`Ji_1U4K6J|KBh2lA#4s&onf0Ra%nX$Ms-33NOe5dp!43w%`v0vQbt3IPN! z7$zD5Fd+kINCqDj0tQGW4!L0xTP%>w0X)eVjYgyWW-p{hEINb+;4%OJ002ovPDHLk FV1l`|;=lj^ literal 0 HcmV?d00001 diff --git a/cnslock/graphics/pngs/num_scroll.png b/cnslock/graphics/pngs/num_scroll.png new file mode 100644 index 0000000000000000000000000000000000000000..b1150e19ccbce39c93920d4b25f8b373ed3b20a6 GIT binary patch literal 889 zcmV-<1BU#GP)%4ni#i(vS>6ECg^( z2BL2XF(Lz4JOuu?v zc2Ng-QwJ|01LK?x5exwYFc}S`RSvjd4Xj!ND;Gm91aVFWYDoqR2mt{A0H|~d0TBrb zg+&q9a0p{G3V=hyg$qhD1UM!G2xc`A+HnekL;(&64X0ND2Lwn^6zJWCa8OgIWkB83GD?K?{yb z5#V(QY&Zc31Op)vBNzgaV+ev-2m>S&3yVks7YqkoF%Z#h2x~a;r4E^C2_O~%Q8)z& z1_23oJ`Ji_1U4K6J|KBh2lA#4s&onf0Ra%nX$Ms-33NOe5dp!43w%`v0vQbt3IPN! z7$zD5Fd+kINCqDj0tQGW4!L0xtnDlG%YG7T^k6Lkf)8oF&XU6;-U&tbtYw3G2~?X z<;Ih2XMJEpa#CVKqbI2vTUx`SA|t}u+DW#u!apc5z(1&`msE|Dygj2QdwWiqO0ty< z4AX7w?QCa|p^?Gd%+!PoZ57&Dn&eo=z_5TkZNnZcT(}U4!Xk@R93qKAVM^iDNk}8y z;)PIm!JI)@BaB*z>I^&@;Z|W7Lr5b;f{q#&l5OKc3?~2pqn~G36Nn6q P00000NkvXXu0mjf;UNK{ literal 0 HcmV?d00001 diff --git a/cnslock/graphics/pngs/scroll.png b/cnslock/graphics/pngs/scroll.png new file mode 100644 index 0000000000000000000000000000000000000000..8d672c3c1407e9362e405027be4bad2c40aa1ead GIT binary patch literal 696 zcmWksSx8h-0KNCU`|i7Mn|aUFnK8$GG;v%p9ZJQ~nVd0oT*ev&$-OK~#c@kPu{6^X zg;Xjv37VF!dE8>JE1vUvH!d2-J5`>yI{9T((F6_^+fL#{1NS|~wD{!Cg>M-lsHPPO3X z0fh2e9b0VV+$lN*F82vt#Vnd8ynVWvIUkmKkJj>&Z^4|aD>a9)y literal 0 HcmV?d00001 diff --git a/cnslock/graphics/scroll.h b/cnslock/graphics/scroll.h new file mode 100644 index 0000000..3a7282f --- /dev/null +++ b/cnslock/graphics/scroll.h @@ -0,0 +1,488 @@ +int s_width = 56; +int s_height = 56; + +char s_cmap[256][3] = { + { 0, 0, 0}, + { 54, 37, 3}, + { 56, 39, 3}, + {218,150, 13}, + { 6, 4, 0}, + {177,122, 10}, + { 97, 67, 6}, + { 9, 6, 0}, + { 29, 20, 2}, + { 26, 18, 2}, + { 89, 61, 5}, + {186,127, 11}, + {196,134, 11}, + {123, 85, 7}, + {236,162, 14}, + { 66, 45, 4}, + {210,144, 12}, + { 65, 44, 4}, + {112, 77, 6}, + {162,111, 9}, + { 49, 34, 3}, + { 88, 60, 5}, + { 4, 55, 29}, + {108, 74, 6}, + { 50, 34, 3}, + { 24, 16, 1}, + {233,160, 13}, + { 41, 28, 2}, + {136, 93, 8}, + {138, 95, 8}, + { 6, 79, 41}, + { 15,195,102}, + { 18,232,121}, + { 2, 31, 16}, + { 90, 62, 5}, + {225,154, 13}, + {118, 81, 7}, + {120, 83, 7}, + { 47, 33, 3}, + {227,156, 13}, + { 17, 12, 1}, + { 4, 48, 25}, + { 13,164, 85}, + { 14,184, 96}, + { 13,172, 90}, + { 3, 43, 23}, + { 67, 46, 4}, + {113, 78, 7}, + {106, 73, 6}, + { 12, 8, 1}, + { 1, 0, 0}, + {168,116, 10}, + { 1, 17, 9}, + { 10,133, 69}, + { 17,215,112}, + { 8, 99, 52}, + { 10,128, 67}, + {195,133, 11}, + { 74, 50, 4}, + { 56, 38, 3}, + { 8,102, 53}, + { 17,218,113}, + { 10,130, 68}, + { 1, 14, 8}, + { 13,167, 87}, + { 1, 7, 4}, + { 80, 55, 5}, + {201,138, 12}, + { 7, 5, 0}, + { 24, 17, 1}, + { 1, 13, 7}, + { 12,151, 79}, + { 4, 46, 24}, + { 5, 70, 37}, + { 12,149, 78}, + { 14,186, 97}, + { 5, 65, 34}, + { 0, 6, 3}, + { 14,178, 93}, + { 6, 77, 40}, + { 3, 39, 21}, + { 12,155, 81}, + { 15,193,100}, + { 5, 4, 0}, + {131, 90, 8}, + { 37, 25, 2}, + { 10,124, 65}, + { 11,142, 74}, + { 17,224,117}, + { 8,108, 56}, + { 1, 8, 4}, + { 3, 33, 17}, + { 35, 24, 2}, + {145, 99, 8}, + {130, 89, 8}, + { 3, 36, 19}, + { 11,139, 72}, + { 2, 23, 12}, + { 7, 93, 49}, + { 16,209,109}, + { 8,107, 56}, + {241,165, 14}, + {153,105, 9}, + { 32, 22, 2}, + { 81, 56, 5}, + { 9, 6, 1}, + { 9,119, 62}, + { 13,170, 89}, + { 4, 54, 28}, + { 5, 62, 32}, + {121, 83, 7}, + {242,166, 14}, + {170,116, 10}, + { 0, 1, 1}, + { 16,201,105}, + { 7, 85, 44}, + { 9,116, 60}, + { 25, 17, 1}, + {193,133, 11}, + {124, 85, 7}, + { 2, 25, 13}, + { 15, 10, 1}, + { 4, 47, 24}, + { 38, 26, 2}, + { 48, 33, 3}, + {104, 72, 6}, + { 31, 21, 2}, + { 6, 72, 37}, + { 14,185, 97}, + { 18,228,119}, + {203,139, 12}, + { 69, 48, 4}, + { 2, 29, 15}, + { 17,225,117}, + { 6, 82, 43}, + { 8,100, 52}, + {115, 79, 7}, + {160,110, 9}, + {142, 98, 8}, + { 64, 44, 4}, + { 8,101, 52}, + { 7, 84, 44}, + {103, 71, 6}, + { 8, 6, 0}, + {123, 84, 7}, + { 3, 2, 0}, + { 2, 22, 11}, + { 13,162, 84}, + { 6, 73, 38}, + { 5, 66, 34}, + {148,102, 9}, + { 4, 50, 26}, + { 3, 44, 23}, + {169,116, 10}, + { 71, 49, 4}, + { 45, 31, 3}, + { 82, 56, 5}, + { 39, 27, 2}, + {111, 76, 6}, + { 23, 16, 1}, + { 4, 58, 30}, + { 20,171,226}, + {255,255,255}, + {255,255,255}, + {255,255,255}, + {255,255,255}, + {255,255,255}, + {255,255,255}, + {255,255,255}, + {255,255,255}, + {255,255,255}, + {255,255,255}, + {255,255,255}, + {255,255,255}, + {255,255,255}, + {255,255,255}, + {255,255,255}, + {255,255,255}, + {255,255,255}, + {255,255,255}, + {255,255,255}, + {255,255,255}, + {255,255,255}, + {255,255,255}, + {255,255,255}, + {255,255,255}, + {255,255,255}, + {255,255,255}, + {255,255,255}, + {255,255,255}, + {255,255,255}, + {255,255,255}, + {255,255,255}, + {255,255,255}, + {255,255,255}, + {255,255,255}, + {255,255,255}, + {255,255,255}, + {255,255,255}, + {255,255,255}, + {255,255,255}, + {255,255,255}, + {255,255,255}, + {255,255,255}, + {255,255,255}, + {255,255,255}, + {255,255,255}, + {255,255,255}, + {255,255,255}, + {255,255,255}, + {255,255,255}, + {255,255,255}, + {255,255,255}, + {255,255,255}, + {255,255,255}, + {255,255,255}, + {255,255,255}, + {255,255,255}, + {255,255,255}, + {255,255,255}, + {255,255,255}, + {255,255,255}, + {255,255,255}, + {255,255,255}, + {255,255,255}, + {255,255,255}, + {255,255,255}, + {255,255,255}, + {255,255,255}, + {255,255,255}, + {255,255,255}, + {255,255,255}, + {255,255,255}, + {255,255,255}, + {255,255,255}, + {255,255,255}, + {255,255,255}, + {255,255,255}, + {255,255,255}, + {255,255,255}, + {255,255,255}, + {255,255,255}, + {255,255,255}, + {255,255,255}, + {255,255,255}, + {255,255,255}, + {255,255,255}, + {255,255,255}, + {255,255,255}, + {255,255,255}, + {255,255,255}, + {255,255,255}, + {255,255,255}, + {255,255,255}, + {255,255,255}, + {255,255,255} + }; + +char s_data[] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,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0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,161,161,161,0,0,0,0,161,161,161,0,0, + 0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,161,161,161,161,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,161,0,0,0,0,0,0,161,0,0, + 0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,161,0,0,0,0,161,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,161,0,0,0,0,0,0,161,0,0, + 0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,161,0,0,0,0,0,0,0, + 161,161,161,161,0,0,161,0,161,161,161,0,0,0,161,161, + 161,161,0,0,0,0,161,0,0,0,0,0,0,161,0,0, + 0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,161,0,0,0,0,0,0,161, + 0,0,0,0,0,0,161,161,0,0,0,0,0,161,0,0, + 0,0,161,0,0,0,161,0,0,0,0,0,0,161,0,0, + 0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,161,161,161,161,0,0,161, + 0,0,0,0,0,0,161,0,0,0,0,0,0,161,0,0, + 0,0,161,0,0,0,161,0,0,0,0,0,0,161,0,0, + 0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,161,0,161, + 0,0,0,0,0,0,161,0,0,0,0,0,0,161,0,0, + 0,0,161,0,0,0,161,0,0,0,0,0,0,161,0,0, + 0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,161,0,161, + 0,0,0,0,0,0,161,0,0,0,0,0,0,161,0,0, + 0,0,161,0,0,0,161,0,0,0,0,0,0,161,0,0, + 0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,161,0,0,0,0,161,0,161, + 0,0,0,0,0,0,161,0,0,0,0,0,0,161,0,0, + 0,0,161,0,0,0,161,0,0,0,0,0,0,161,0,0, + 0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,161,161,161,161,0,0,0, + 161,161,161,161,0,0,161,0,0,0,0,0,0,0,161,161, + 161,161,0,0,161,161,161,161,161,0,0,161,161,161,161,161, + 0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0 + }; diff --git a/cnslock/include/applet.h b/cnslock/include/applet.h new file mode 100644 index 0000000..4744a03 --- /dev/null +++ b/cnslock/include/applet.h @@ -0,0 +1,2 @@ + +void make_new_cnslock_dockapp(int); diff --git a/cnslock/include/cnslock.h b/cnslock/include/cnslock.h new file mode 100644 index 0000000..d0103bb --- /dev/null +++ b/cnslock/include/cnslock.h @@ -0,0 +1,35 @@ +#ifndef CNSLOCK_H_ +#define CNSLOCK_H_ + +#include +#include +#include "defines.h" + +/* this is the max size of the RGB buffer: 56 * 56 * 3 + * used for memcpy, memset, etc operations */ +#define RGBSIZE (XMAX * YMAX * 3) + +/* main dockapp info structure. windows, buffers, etc */ +typedef struct { + Display *display; /* X11 display */ + GdkWindow *win; /* main window */ + GdkWindow *iconwin; /* icon window */ + GdkGC *gc; /* drawing GC */ + GdkPixmap *pixmap; /* main dockapp pixmap */ + GdkBitmap *mask; /* dockapp mask */ + + /* main image buffer */ + unsigned char rgb[RGBSIZE]; + + /* back buffer - stores things we dont want to redraw all the time */ + unsigned char bgr[RGBSIZE]; + +} AppletData; + +extern AppletData ad; +extern int posx; +extern int posy; +#endif + + + diff --git a/cnslock/include/defines.h b/cnslock/include/defines.h new file mode 100644 index 0000000..52fbd2e --- /dev/null +++ b/cnslock/include/defines.h @@ -0,0 +1,20 @@ +#ifndef DEFINES_H +#define DEFINES_H + +/* Below this line, there are only defines that users don't have to + care about normally. +-----------------------------------------------------------------------------*/ + +/* perform clipping outside this range, also this is the size of the + * drawing area */ + +#define XMIN 4 +#define XMAX 56 +#define YMIN 4 +#define YMAX 56 + +#define WINDOWSIZE_X 64 +#define WINDOWSIZE_Y 64 + +#endif + diff --git a/cnslock/include/kleds.h b/cnslock/include/kleds.h new file mode 100644 index 0000000..3001054 --- /dev/null +++ b/cnslock/include/kleds.h @@ -0,0 +1,2 @@ +void init_kleds(void); +int check_kleds(void); \ No newline at end of file diff --git a/cnslock/kleds.c b/cnslock/kleds.c new file mode 100644 index 0000000..4c93386 --- /dev/null +++ b/cnslock/kleds.c @@ -0,0 +1,37 @@ +/* + This code is based upon some lines(actually two lines :-) + in E-Leds by Mathias Meisfjordskar + Released under GPL. +*/ + +#include +#include + +#include "include/defines.h" +#include "include/kleds.h" + +Display *display; + +/* + Returns the turned on leds: + Bit 0 is Capslock + Bit 1 is Numlock + Bit 2 is Scrollock +*/ + +int check_kleds() +{ + unsigned int states; + + if (XkbGetIndicatorState(display, XkbUseCoreKbd, &states) != Success) + { + perror("Error while reading Indicator status\n"); + return -1; + } + return (states & 0x7); +} + +void init_kleds() +{ + display = XOpenDisplay(NULL); +}